커뮤니티
거래 횟수별 거래횟수, 승률, 수익을 보려면 어떻게 해야할까요?
2011-04-12 00:29:50
712
글번호 37521
아래와 같은 수식이 있다고 가정할 경우 메시지로그나 print등으로 아래의 4가지 조건의 데이터를 출력하려면 어떻게 해야할까요?
1차 진입시 매수의 거래횟수, 승률, 수익
1차 진입시 매도의 거래횟수, 승률, 수익
2차 진입시 매수의 거래횟수, 승률, 수익
2차 진입시 매도의 거래횟수, 승률, 수익
input : count(4);
var : c1(0);
c1=0;
for value1=0 to count {
if EntryDate(value1)==sdate then c1=c1+1;
}
if mp==0 && c1==0 && c1<count && stime>=090000 && stime<=143000 then {
if Bids > Asks then { buy("B"); }
if Asks > Bids then { sell("S"); }
}
if mp==0 && c1>=1 && c1<count && stime>=090000 && stime<=143000 then {
if Bids > Asks then { buy("B2"); }
if Asks > Bids then { sell("S2"); }
}
SetStopTrailing(1,2, pointstop);
SetStopTrailing(1,pointstop)
답변 1
예스스탁 예스스탁 답변
2011-04-12 13:48:29
안녕하세요
예스스탁입니다.
input : count(4);
var : c1(0),mp(0);
var : Bcnt(0),BPL(0),Bwin(0),Brate(0);
var : Scnt(0),SPL(0),Swin(0),Srate(0);
var : B2cnt(0),B2PL(0),B2win(0),B2rate(0);
var : S2cnt(0),S2PL(0),S2win(0),S2rate(0);
if MarketPosition == 0 and MarketPosition[1] != 0 Then{
if IsEntryName("b",1) Then{
Bcnt = Bcnt+1;
BPL = BPL+PositionProfit(1);
if PositionProfit(1) > 0 Then
Bwin = Bwin+1;
Brate = Bwin/Bcnt*100;
}
if IsEntryName("S",1) Then{
Scnt = Scnt+1;
SPL = SPL+PositionProfit(1);
if PositionProfit(1) > 0 Then
Swin = Swin+1;
Srate = Swin/Scnt*100;
}
if IsEntryName("b2",1) Then{
B2cnt = B2cnt+1;
B2PL = B2PL+PositionProfit(1);
if PositionProfit(1) > 0 Then
B2win = B2win+1;
B2rate = B2win/B2cnt*100;
}
if IsEntryName("S2",1) Then{
S2cnt = S2cnt+1;
S2PL = S2PL+PositionProfit(1);
if PositionProfit(1) > 0 Then
S2win = S2win+1;
S2rate = S2win/S2cnt*100;
}
}
mp = MarketPosition;
c1=0;
for value1=0 to count {
if EntryDate(value1)==sdate then c1=c1+1;
}
if mp==0 && c1==0 && c1<count && stime>=090000 && stime<=143000 then {
if Bids > Asks then { buy("B"); }
if Asks > Bids then { sell("S"); }
}
if mp==0 && c1>=1 && c1<count && stime>=090000 && stime<=143000 then {
if Bids > Asks then { buy("B2"); }
if Asks > Bids then { sell("S2"); }
}
SetStopTrailing(1,2, pointstop);
SetStopTrailing(1,pointstop);
MessageLog("1차 매수 : 횟수 %.2f 승률 %.2f 수익 %.2f/ 1차 매도 : 횟수 %.f 승률 %.2f 수익 %.2f/ 2차 매수: 횟수 %.f 승률 %.2f 수익 %.2f/ 2차 매도 : 횟수 %.f 승률 %.2f 수익 %.2f",
Bcnt,Brate,BPL,Scnt,Srate,SPL,B2cnt,B2rate,B2PL,S2cnt,S2rate,S2PL);
Print("Test.txt","1차 매수 : 횟수 %.2f 승률 %.2f 수익 %.2f/ 1차 매도 : 횟수 %.f 승률 %.2f 수익 %.2f/ 2차 매수: 횟수 %.f 승률 %.2f 수익 %.2f/ 2차 매도 : 횟수 %.f 승률 %.2f 수익 %.2f",
Bcnt,Brate,BPL,Scnt,Srate,SPL,B2cnt,B2rate,B2PL,S2cnt,S2rate,S2PL);
즐거운 하루되세요
> kekino 님이 쓴 글입니다.
> 제목 : 거래 횟수별 거래횟수, 승률, 수익을 보려면 어떻게 해야할까요?
>
아래와 같은 수식이 있다고 가정할 경우 메시지로그나 print등으로 아래의 4가지 조건의 데이터를 출력하려면 어떻게 해야할까요?
1차 진입시 매수의 거래횟수, 승률, 수익
1차 진입시 매도의 거래횟수, 승률, 수익
2차 진입시 매수의 거래횟수, 승률, 수익
2차 진입시 매도의 거래횟수, 승률, 수익
input : count(4);
var : c1(0);
c1=0;
for value1=0 to count {
if EntryDate(value1)==sdate then c1=c1+1;
}
if mp==0 && c1==0 && c1<count && stime>=090000 && stime<=143000 then {
if Bids > Asks then { buy("B"); }
if Asks > Bids then { sell("S"); }
}
if mp==0 && c1>=1 && c1<count && stime>=090000 && stime<=143000 then {
if Bids > Asks then { buy("B2"); }
if Asks > Bids then { sell("S2"); }
}
SetStopTrailing(1,2, pointstop);
SetStopTrailing(1,pointstop)
다음글
이전글