커뮤니티
안녕하세요?
2017-01-12 11:09:36
132
글번호 105819
안녕하세요
이수식은 청산식이 안먹히네요
한번 매수해서 계속 평가중입니다.
죄송하지만 한번만 더 수식 확인 부탁드립니다.
input : 최대진입횟수(2);
var : Xcond(false),HH(0);
var1 = ma(c,5);
var2 = ma(c,20);
if TotalTrades > TotalTrades[1] Then{
if (IsExitName("dl1",1) == true or IsExitName("dl2",1) == true or IsExitName("bl1",1) or IsExitName("bl2",1)) Then
Xcond = True;
Else
Xcond = false;
}
if MarketPosition == 0 and (Xcond == false or (MarketPosition == 1 and MaxEntries == 1) or (Xcond == true and BarsSinceExit(1) >= 1)) then {
if 매수조건 Then{
buy("b1",AtStop,NextBarOpen+PriceScale*3,2);
}
if MarketPosition == 1 then{
if MaxEntries >= 1 and MaxEntries < 최대진입횟수 Then
buy("b2",AtStop,NextBarOpen+PriceScale*1,1);
}
if CurrentContracts > CurrentContracts[1] Then
HH = H;
if H > HH Then
HH = H;
if MaxEntries == 1 Then
ExitLong("dl1",atlimit,LatestEntryPrice(0)+PriceScale*20,"",1,1);
if MaxEntries == 2 Then
ExitLong("bp2",atlimit,LatestEntryPrice(0)+PriceScale*20);
if HH < AvgEntryPrice+PriceScale*13 Then
ExitLong("bl1",AtStop,LatestEntryPrice(0)-PriceScale*10);
if HH >= AvgEntryPrice+PriceScale*13 Then
ExitLong("bl2",AtStop,LatestEntryPrice(0)+PriceScale*1);
}
- 1. 106356_2017-01-11_20;26;51.PNG (0.01 MB)
답변 1
예스스탁 예스스탁 답변
2017-01-12 12:35:24
안녕하세요
예스스탁입니다.
중괄호가 잘못연결되어 있었습니다.
input : 최대진입횟수(2);
var : Xcond(false),HH(0);
var1 = ma(c,5);
var2 = ma(c,20);
if TotalTrades > TotalTrades[1] Then{
if (IsExitName("dl1",1) == true or IsExitName("dl2",1) == true or IsExitName("bl1",1) or IsExitName("bl2",1)) Then
Xcond = True;
Else
Xcond = false;
}
if MarketPosition == 0 and (Xcond == false or (MarketPosition == 1 and MaxEntries == 1) or (Xcond == true and BarsSinceExit(1) >= 1)) then {
if 매수조건 Then{
buy("b1",AtStop,NextBarOpen+PriceScale*3,2);
}
}
if MarketPosition == 1 then{
if MaxEntries >= 1 and MaxEntries < 최대진입횟수 Then {
buy("b2",AtStop,NextBarOpen+PriceScale*1,1);
}
if CurrentContracts > CurrentContracts[1] Then
HH = H;
if H > HH Then
HH = H;
if MaxEntries == 1 Then{
MessageLog("%.2f",LatestEntryPrice(0));
ExitLong("dl1",atlimit,LatestEntryPrice(0)+PriceScale*20,"",1,1);
}
if MaxEntries == 2 Then
ExitLong("bp2",atlimit,LatestEntryPrice(0)+PriceScale*20);
if HH < AvgEntryPrice+PriceScale*13 Then
ExitLong("bl1",AtStop,LatestEntryPrice(0)-PriceScale*10);
if HH >= AvgEntryPrice+PriceScale*13 Then
ExitLong("bl2",AtStop,LatestEntryPrice(0)+PriceScale*1);
}
즐거운 하루되세요
> 상중하 님이 쓴 글입니다.
> 제목 : 안녕하세요?
> 안녕하세요
이수식은 청산식이 안먹히네요
한번 매수해서 계속 평가중입니다.
죄송하지만 한번만 더 수식 확인 부탁드립니다.
input : 최대진입횟수(2);
var : Xcond(false),HH(0);
var1 = ma(c,5);
var2 = ma(c,20);
if TotalTrades > TotalTrades[1] Then{
if (IsExitName("dl1",1) == true or IsExitName("dl2",1) == true or IsExitName("bl1",1) or IsExitName("bl2",1)) Then
Xcond = True;
Else
Xcond = false;
}
if MarketPosition == 0 and (Xcond == false or (MarketPosition == 1 and MaxEntries == 1) or (Xcond == true and BarsSinceExit(1) >= 1)) then {
if 매수조건 Then{
buy("b1",AtStop,NextBarOpen+PriceScale*3,2);
}
if MarketPosition == 1 then{
if MaxEntries >= 1 and MaxEntries < 최대진입횟수 Then
buy("b2",AtStop,NextBarOpen+PriceScale*1,1);
}
if CurrentContracts > CurrentContracts[1] Then
HH = H;
if H > HH Then
HH = H;
if MaxEntries == 1 Then
ExitLong("dl1",atlimit,LatestEntryPrice(0)+PriceScale*20,"",1,1);
if MaxEntries == 2 Then
ExitLong("bp2",atlimit,LatestEntryPrice(0)+PriceScale*20);
if HH < AvgEntryPrice+PriceScale*13 Then
ExitLong("bl1",AtStop,LatestEntryPrice(0)-PriceScale*10);
if HH >= AvgEntryPrice+PriceScale*13 Then
ExitLong("bl2",AtStop,LatestEntryPrice(0)+PriceScale*1);
}
이전글