커뮤니티
수식 부탁드립니다.
2014-09-10 01:14:30
147
글번호 78412
수고하십니다.
아래의 수식을 매매횟수 2회로 제한하려 합니다.
(단, 11시 이후에는 매매횟수가 1번이더라도 시그널이 나오지 않게 부탁드립니다)
EX) 09:15 첫 시그널 발생 10:10 2번째 시그널 발생하면 2번으로 제한해 주시고,
09:15 첫 시그널 발생 후 11시가 넘어가면 청산만 하고 진입은 안되게 부탁드립니다.
input:DayProfit(4.0), DayLos(-2.0);
var : PLR(0),OpenPL(0),dayPL(0),count(0);
PLR = 0;
count = 0;
for var1 = 1 to 10 begin
if sdate == EntryDate(var1) Then begin
PLR = PLR+PositionProfit(var1);
end;
end;
if MarketPosition == 0 Then begin
OpenPL = 0;
dayPL = PLR;
End
Else begin
OpenPL = (PositionProfit);
dayPL = PLR+OpenPL;
end;
if (DayPL < DayProfit) and (DayPL > DayLos) then Begin
if stime >= 090000 and stime < 150000 Then{
if marketposition <> 1 and c > ma(h,10) Then
buy("매수",AtLimit,ma(h,5));
if marketposition <> -1 and c < ma(l,10) Then
Sell("매도",AtLimit,ma(l,5));
}
If marketposition <> 0 and stime >= 150000 then {
ExitLong("0", AtMarket);
ExitShort("1", AtMarket);
}
SetStopLoss(1.0,PointStop);
SetStopProfittarget(2.0,PointStop);
SetStopEndofday;
End;
답변 1
예스스탁 예스스탁 답변
2014-09-11 14:59:47
안녕하세요
예스스탁입니다.
input:DayProfit(4.0), DayLos(-2.0);
var : PLR(0),OpenPL(0),dayPL(0),count(0);
PLR = 0;
count = 0;
for var1 = 1 to 10 begin
if sdate == EntryDate(var1) Then begin
PLR = PLR+PositionProfit(var1);
count = count+1;
end;
end;
if MarketPosition == 0 Then begin
OpenPL = 0;
dayPL = PLR;
End
Else begin
OpenPL = (PositionProfit);
dayPL = PLR+OpenPL;
end;
if (DayPL < DayProfit) and (DayPL > DayLos) then Begin
if stime >= 090000 and stime < 110000 and count < 2 Then{
if marketposition <> 1 and c > ma(h,10) Then
buy("매수",AtLimit,ma(h,5));
if marketposition <> -1 and c < ma(l,10) Then
Sell("매도",AtLimit,ma(l,5));
}
If marketposition <> 0 and stime >= 150000 then {
ExitLong("0", AtMarket);
ExitShort("1", AtMarket);
}
SetStopLoss(1.0,PointStop);
SetStopProfittarget(2.0,PointStop);
SetStopEndofday;
End;
즐거운 하루되세요
> 마녀사냥 님이 쓴 글입니다.
> 제목 : 수식 부탁드립니다.
> 수고하십니다.
아래의 수식을 매매횟수 2회로 제한하려 합니다.
(단, 11시 이후에는 매매횟수가 1번이더라도 시그널이 나오지 않게 부탁드립니다)
EX) 09:15 첫 시그널 발생 10:10 2번째 시그널 발생하면 2번으로 제한해 주시고,
09:15 첫 시그널 발생 후 11시가 넘어가면 청산만 하고 진입은 안되게 부탁드립니다.
input:DayProfit(4.0), DayLos(-2.0);
var : PLR(0),OpenPL(0),dayPL(0),count(0);
PLR = 0;
count = 0;
for var1 = 1 to 10 begin
if sdate == EntryDate(var1) Then begin
PLR = PLR+PositionProfit(var1);
end;
end;
if MarketPosition == 0 Then begin
OpenPL = 0;
dayPL = PLR;
End
Else begin
OpenPL = (PositionProfit);
dayPL = PLR+OpenPL;
end;
if (DayPL < DayProfit) and (DayPL > DayLos) then Begin
if stime >= 090000 and stime < 150000 Then{
if marketposition <> 1 and c > ma(h,10) Then
buy("매수",AtLimit,ma(h,5));
if marketposition <> -1 and c < ma(l,10) Then
Sell("매도",AtLimit,ma(l,5));
}
If marketposition <> 0 and stime >= 150000 then {
ExitLong("0", AtMarket);
ExitShort("1", AtMarket);
}
SetStopLoss(1.0,PointStop);
SetStopProfittarget(2.0,PointStop);
SetStopEndofday;
End;
이전글