커뮤니티
수식작동하도록 수정 부탁드립니다.
2013-11-29 23:10:10
166
글번호 69984
안녕하세요!
아래 수식이 작동하지 않습니다.
수정 부탁드립니다.
var : cnt(0),EntryCount(0),LossCount(0);
Condition1 = ExitDate(1) == sdate and MarketPosition == 0 And
(IsExitName("bx1",1) == true or IsExitName("bx2",1) == true or IsExitName("StopTrailing",1)==true);
Condition2 = ExitDate(1) == sdate and MarketPosition == 0 And
(IsExitName("sx1",1) == true or IsExitName("sx2",1) == true or IsExitName("StopTrailing",1)==true);
###########
var1 = (c+o)/2;
var2 = ma(var1,5);
var3 = ma(var1,20);
EntryCount = 0;
LossCount = 0;
for cnt = 0 to 20{
if sdate == EntryDate(cnt) Then EntryCount = EntryCount+1;
if sdate == EntryDate(cnt) and PositionProfit(cnt) < 0 Then LossCount = LossCount+1;
}
###########
if crossup (var2, var3) Then{
value3 = sdate;
value4 = TimeToMinutes(stime);
}
if sdate == value3 and TimeToMinutes(stime) >= value4-20 and Condition2 == false or (Condition2 == true
and TimeToMinutes(stime) >= TimeToMinutes(ExitTime(1))-90) Then{
if TimeToMinutes(stime) <= value4 -70 and (absValue(var3-var2)/var3)<=0.05 and Entrycount < 5 and LossCount < 3 Then
sell("s1",onclose);
}
###########
if MarketPosition == -1 and (Isentryname("s1")==true ) Then{
if Lowest(L,BarsSinceEntry) <= EntryPrice*1.20 Then
ExitShort("sx1",atstop,var2*0.98);
}
if MarketPosition == -1 and ( Isentryname("s1") ) Then{
if Lowest(L,BarsSinceEntry) <= EntryPrice*1.30 Then
ExitLong("sx2",atstop,var2*0.985);
}
###########
답변 1
예스스탁 예스스탁 답변
2013-12-02 11:27:01
var : cnt(0),EntryCount(0),LossCount(0);
Condition1 = ExitDate(1) == sdate and MarketPosition == 0 And
(IsExitName("bx1",1) == true or IsExitName("bx2",1) == true or IsExitName("StopTrailing",1)==true);
Condition2 = ExitDate(1) == sdate and MarketPosition == 0 And
(IsExitName("sx1",1) == true or IsExitName("sx2",1) == true or IsExitName("StopTrailing",1)==true);
###########
var1 = (c+o)/2;
var2 = ma(var1,5);
var3 = ma(var1,20);
EntryCount = 0;
LossCount = 0;
for cnt = 0 to 20{
if sdate == EntryDate(cnt) Then EntryCount = EntryCount+1;
if sdate == EntryDate(cnt) and PositionProfit(cnt) < 0 Then LossCount = LossCount+1;
}
###########
if crossup (var2, var3) Then{
value3 = sdate;
value4 = TimeToMinutes(stime);
}
if sdate == value3 and TimeToMinutes(stime) >= value4+20 and Condition2 == false or (Condition2 == true
and TimeToMinutes(stime) >= TimeToMinutes(ExitTime(1))+90) Then{
if TimeToMinutes(stime) <= value4+70 and (absValue(var3-var2)/var3)<=0.05 and Entrycount < 5 and LossCount < 3 Then
sell("s1",onclose);
}
###########
if MarketPosition == -1 and (Isentryname("s1")==true ) Then{
if Lowest(L,BarsSinceEntry) <= EntryPrice*1.20 Then
ExitShort("sx1",atstop,var2*0.98);
}
if MarketPosition == -1 and ( Isentryname("s1") ) Then{
if Lowest(L,BarsSinceEntry) <= EntryPrice*1.30 Then
ExitShort("sx2",atstop,var2*0.985);
}
###########
> 우후훗 님이 쓴 글입니다.
> 제목 : 수식작동하도록 수정 부탁드립니다.
> 안녕하세요!
아래 수식이 작동하지 않습니다.
수정 부탁드립니다.
var : cnt(0),EntryCount(0),LossCount(0);
Condition1 = ExitDate(1) == sdate and MarketPosition == 0 And
(IsExitName("bx1",1) == true or IsExitName("bx2",1) == true or IsExitName("StopTrailing",1)==true);
Condition2 = ExitDate(1) == sdate and MarketPosition == 0 And
(IsExitName("sx1",1) == true or IsExitName("sx2",1) == true or IsExitName("StopTrailing",1)==true);
###########
var1 = (c+o)/2;
var2 = ma(var1,5);
var3 = ma(var1,20);
EntryCount = 0;
LossCount = 0;
for cnt = 0 to 20{
if sdate == EntryDate(cnt) Then EntryCount = EntryCount+1;
if sdate == EntryDate(cnt) and PositionProfit(cnt) < 0 Then LossCount = LossCount+1;
}
###########
if crossup (var2, var3) Then{
value3 = sdate;
value4 = TimeToMinutes(stime);
}
if sdate == value3 and TimeToMinutes(stime) >= value4-20 and Condition2 == false or (Condition2 == true
and TimeToMinutes(stime) >= TimeToMinutes(ExitTime(1))-90) Then{
if TimeToMinutes(stime) <= value4 -70 and (absValue(var3-var2)/var3)<=0.05 and Entrycount < 5 and LossCount < 3 Then
sell("s1",onclose);
}
###########
if MarketPosition == -1 and (Isentryname("s1")==true ) Then{
if Lowest(L,BarsSinceEntry) <= EntryPrice*1.20 Then
ExitShort("sx1",atstop,var2*0.98);
}
if MarketPosition == -1 and ( Isentryname("s1") ) Then{
if Lowest(L,BarsSinceEntry) <= EntryPrice*1.30 Then
ExitLong("sx2",atstop,var2*0.985);
}
###########
다음글