커뮤니티
문의드립니다.
2014-01-09 22:14:25
163
글번호 71245
항상 수고많으십니다.
전에 짜주신 아래 로직에 추가하고싶은 사항이 있어서 질문드립니다.
하루 누적손실 포인트를 -2Point로 제한을 걸려고 하는데 도움부탁드립니다.
input : dayentry(8),loss(0.4),Profit(0.6);
var : X(0),W(0),cnt(0),count(0);
count = 0;
for cnt = 0 to 20{
if sdate == EntryDate(cnt) Then
count = count+1;
}
if date != date[1] Then
Condition1 = False;
X=MIN(T1, T2, T3, T4);
if T5[1]<T5 Then{
Condition1 = true;
W = X;
}
Else
W = T5;
if count < dayentry and Condition1 == true Then{
if T1 > W Then{
If count == 0 or
(count >= 1 and MarketPosition == -1) Or
(count >= 1 and MarketPosition == 0 and MarketPosition(1) == -1 ) Then
buy();
}
Else{
If count == 0 or
(count >= 1 and MarketPosition == 1) Or
(count >= 1 and MarketPosition == 0 and MarketPosition(1) == 1 ) Then
sell();
}
}
SetStopProfittarget(Profit,PointStop);
SetStopLoss(loss,PointStop);
SetStopEndofday(150000);
답변 1
예스스탁 예스스탁 답변
2014-01-10 16:24:39
안녕하세요
예스스탁입니다.
input : dayentry(8),loss(0.4),Profit(0.6),당일손실(-2);
var : X(0),W(0),cnt(0),count(0),NP(0),PreNP(0),dayPL(0);
count = 0;
for cnt = 0 to 20{
if sdate == EntryDate(cnt) Then
count = count+1;
}
NP = NetProfit;
if date != date[1] Then{
Condition1 = False;
PreNP = NP[1];
}
dayPL = (NP-PreNP)+PositionProfit;
X=MIN(T1, T2, T3, T4);
if T5[1]<T5 Then{
Condition1 = true;
W = X;
}
Else
W = T5;
if count < dayentry and Condition1 == true and dayPL > 당일손실 Then{
if T1 > W Then{
If count == 0 or
(count >= 1 and MarketPosition == -1) Or
(count >= 1 and MarketPosition == 0 and MarketPosition(1) == -1 ) Then
buy();
}
Else{
If count == 0 or
(count >= 1 and MarketPosition == 1) Or
(count >= 1 and MarketPosition == 0 and MarketPosition(1) == 1 ) Then
sell();
}
}
if MarketPosition == 1 Then{
ExitLong("daybx2",AtStop,EntryPrice+(당일손실-DayPL));
}
if MarketPosition == -1 Then{
ExitShort("daysx2",AtStop,EntryPrice-(당일손실-DayPL));
}
SetStopProfittarget(Profit,PointStop);
SetStopLoss(loss,PointStop);
SetStopEndofday(150000);
즐거운 하루되세요
> 마코 님이 쓴 글입니다.
> 제목 : 문의드립니다.
> 항상 수고많으십니다.
전에 짜주신 아래 로직에 추가하고싶은 사항이 있어서 질문드립니다.
하루 누적손실 포인트를 -2Point로 제한을 걸려고 하는데 도움부탁드립니다.
input : dayentry(8),loss(0.4),Profit(0.6);
var : X(0),W(0),cnt(0),count(0);
count = 0;
for cnt = 0 to 20{
if sdate == EntryDate(cnt) Then
count = count+1;
}
if date != date[1] Then
Condition1 = False;
X=MIN(T1, T2, T3, T4);
if T5[1]<T5 Then{
Condition1 = true;
W = X;
}
Else
W = T5;
if count < dayentry and Condition1 == true Then{
if T1 > W Then{
If count == 0 or
(count >= 1 and MarketPosition == -1) Or
(count >= 1 and MarketPosition == 0 and MarketPosition(1) == -1 ) Then
buy();
}
Else{
If count == 0 or
(count >= 1 and MarketPosition == 1) Or
(count >= 1 and MarketPosition == 0 and MarketPosition(1) == 1 ) Then
sell();
}
}
SetStopProfittarget(Profit,PointStop);
SetStopLoss(loss,PointStop);
SetStopEndofday(150000);
이전글