전일마지막 신호와 상관없이 당일첫신호를 발생시키고자합니다
전일 마지막봉이 매도인데 매도청산후 당일첫신호가 매도가 나오질 않습니다
오류수정부탁드립니다
var : entrycnt(0),cond(false);
if stime == 170000 or (stime > 170000 and stime[1] < 170000) Then{ # 현지시간_뉴욕 17:00 장시작 #
Entrycnt = 0;
cond = false;
}
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
Entrycnt = Entrycnt+1;
cond = false;
if entrycnt >= 2 Then{
if MarketPosition == 0 and PositionProfit(1) < 0 and PositionProfit(2) < 0 Then
cond = true;
if MarketPosition != 0 and PositionProfit(0) < 0 and PositionProfit(1) < 0 Then
cond = true;
}
if (stime >= 170000 or stime < 143000) and (DayPL < 당일손익*PriceScale) Then{ # 현지시간_뉴욕 17:00 장시작~익일 14:30 장종료 #
##############################
##### 1_ 매매식 #####
##############################
if ((entrycnt == 0) or (entrycnt >= 1 and MarketPosition == 0 and
MarketPosition(1) != 1) or (MarketPosition == -1)) and #동일방향 재진입금지#
c>v25 Then{
if cond == false Then
buy("B_uparoon");
Else
ExitShort();
}
if ((entrycnt == 0) or (entrycnt >= 1 and MarketPosition == 0 and
MarketPosition(1) != -1) or (MarketPosition == 1)) and #동일방향 재진입금지#
c<v27 Then{
if cond == false Then
sell("S_dnaroon");
Else
ExitLong();
}
}
답변 1
예스스탁
예스스탁 답변
2016-04-15 13:59:55
안녕하세요
예스스탁입니다.
현재 수식에 따로 첫신호를 제한하는 내용이 없습니다.
진입식의 조건들의 ()가 잘못되어 있는 것 같아 해당 부분 수정했습니다.
var : entrycnt(0),cond(false);
if stime == 170000 or (stime > 170000 and stime[1] < 170000) Then{ # 현지시간_뉴욕 17:00 장시작 #
Entrycnt = 0;
cond = false;
}
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
Entrycnt = Entrycnt+1;
cond = false;
if entrycnt >= 2 Then{
if MarketPosition == 0 and PositionProfit(1) < 0 and PositionProfit(2) < 0 Then
cond = true;
if MarketPosition != 0 and PositionProfit(0) < 0 and PositionProfit(1) < 0 Then
cond = true;
}
if (stime >= 170000 or stime < 143000) and (DayPL < 당일손익*PriceScale) Then{ # 현지시간_뉴욕 17:00 장시작~익일 14:30 장종료 #
##############################
##### 1_ 매매식 #####
##############################
if ((entrycnt == 0) or
(entrycnt >= 1 and ((MarketPosition == 0 and MarketPosition(1) != 1) or (MarketPosition == -1)))) and #동일방향 재진입금지#
c>v25 Then{
if cond == false Then
buy("B_uparoon");
Else
ExitShort();
}
if ((entrycnt == 0) or
(entrycnt >= 1 and ((MarketPosition == 0 and MarketPosition(1) != -1) or (MarketPosition == 1)))) and #동일방향 재진입금지#
c<v27 Then{
if cond == false Then
sell("S_dnaroon");
Else
ExitLong();
}
}
즐거운 하루되세요
> 조민철 님이 쓴 글입니다.
> 제목 : 시스템 첫신호 오류수정
> 전일마지막 신호와 상관없이 당일첫신호를 발생시키고자합니다
전일 마지막봉이 매도인데 매도청산후 당일첫신호가 매도가 나오질 않습니다
오류수정부탁드립니다
var : entrycnt(0),cond(false);
if stime == 170000 or (stime > 170000 and stime[1] < 170000) Then{ # 현지시간_뉴욕 17:00 장시작 #
Entrycnt = 0;
cond = false;
}
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
Entrycnt = Entrycnt+1;
cond = false;
if entrycnt >= 2 Then{
if MarketPosition == 0 and PositionProfit(1) < 0 and PositionProfit(2) < 0 Then
cond = true;
if MarketPosition != 0 and PositionProfit(0) < 0 and PositionProfit(1) < 0 Then
cond = true;
}
if (stime >= 170000 or stime < 143000) and (DayPL < 당일손익*PriceScale) Then{ # 현지시간_뉴욕 17:00 장시작~익일 14:30 장종료 #
##############################
##### 1_ 매매식 #####
##############################
if ((entrycnt == 0) or (entrycnt >= 1 and MarketPosition == 0 and
MarketPosition(1) != 1) or (MarketPosition == -1)) and #동일방향 재진입금지#
c>v25 Then{
if cond == false Then
buy("B_uparoon");
Else
ExitShort();
}
if ((entrycnt == 0) or (entrycnt >= 1 and MarketPosition == 0 and
MarketPosition(1) != -1) or (MarketPosition == 1)) and #동일방향 재진입금지#
c<v27 Then{
if cond == false Then
sell("S_dnaroon");
Else
ExitLong();
}
}