커뮤니티
10200에 문의했었는데요...
2009-03-27 13:14:20
754
글번호 21234
count=0;
For cnt= 0 to 10{
if sdate==entrydate(cnt) Then
count=count+1;
}
if DayIndex==0 and count==0 then{
if c[1]<ma(c,long)[1] and o>ma(c,long) and o>c[1]*(1+uppercent/100) Then
sell("신규매도");
}
SetStopLoss(lpoint,PercentStop);
SetStopProfittarget(ppoint,PercentStop);
if count==1 and MarketPosition==0 Then{
if IsExitName("stoploss",1)==true Then
sell("재매도",AtLimit,ExitPrice(1)*(1+kpoint/100));
if IsExitName("stopprofittarget",1)==True Then
buy("매수진입",AtLimit,ExitPrice(1)*(1-jpoint/100));
}
SetStopEndofday(145900);
위와같이 작성했는데요...
다 잘나오는데...
손절후 다시 매도 진입은 1%상승시인데요...손절역시 1%이고요..
근데 문제는 매도---손절(1%)---1%상승시재매도진입인데 당일에는 1%상승 만족이
안돼서 재매도진입이 이뤄지지 않고 있다가 다음날 시초가 갭상하면서 만족되어
재매도진입이 발생하네요...
당일에 안나오면 그냥 끝나고 다음날 부터는 신규매도조건으로만 진행시키고 싶습니다.
도와주세요~
그리고
SetStopLoss(lpoint,PercentStop);
SetStopProfittarget(ppoint,PercentStop);
와
if MarketPosition==-1 Then{
if EntryPrice(1)*(1+lpoint/100)<c and IsEntryName("신규매도",1)==True Then
exitshort("손절");
if EntryPrice(1)*(1-ppoint/100)>c and IsEntryName("신규매도",1)==True Then
exitshort("익절");
}
가 신호가 전혀 다르게 나오는데...다른건가요?
답변 1
예스스탁 예스스탁 답변
2009-03-27 13:34:24
안녕하세요
예스스탁입니다.
문의하신 부분을 누락했습니다.
1.
AtLimit가격 조건이 분봉에서 마지막봉에 셋팅이 되면
다음봉의 시세를 보고 진입해서 해당 사항이 발생했습니다.
if count==1 and MarketPosition==0 and stime < 145900 Then{
if IsExitName("stoploss",1)==true Then
sell("재매도",AtLimit,ExitPrice(1)*(1+kpoint/100));
if IsExitName("stopprofittarget",1)==True Then
buy("매수진입",AtLimit,ExitPrice(1)*(1-jpoint/100));
}
와 같이 재매도와 매수진입의 AtLimit 조건설징이 당일 마지막 봉에
걸리지 않게 끔 시간으로 제어해 주셔야 합니다.
당일청산시간 전에만 발동될수 잇게 해주시면 됩니다.
2.
풀어서 작성한 식은 onclose타입으로
봉완성시 발동합니다.
그러므로 강제청산함수를 사용한 것과 다릅니다.
즐거운 하루되세요
> 데스페로 님이 쓴 글입니다.
> 제목 : 10200에 문의했었는데요...
> count=0;
For cnt= 0 to 10{
if sdate==entrydate(cnt) Then
count=count+1;
}
if DayIndex==0 and count==0 then{
if c[1]<ma(c,long)[1] and o>ma(c,long) and o>c[1]*(1+uppercent/100) Then
sell("신규매도");
}
SetStopLoss(lpoint,PercentStop);
SetStopProfittarget(ppoint,PercentStop);
if count==1 and MarketPosition==0 Then{
if IsExitName("stoploss",1)==true Then
sell("재매도",AtLimit,ExitPrice(1)*(1+kpoint/100));
if IsExitName("stopprofittarget",1)==True Then
buy("매수진입",AtLimit,ExitPrice(1)*(1-jpoint/100));
}
SetStopEndofday(145900);
위와같이 작성했는데요...
다 잘나오는데...
손절후 다시 매도 진입은 1%상승시인데요...손절역시 1%이고요..
근데 문제는 매도---손절(1%)---1%상승시재매도진입인데 당일에는 1%상승 만족이
안돼서 재매도진입이 이뤄지지 않고 있다가 다음날 시초가 갭상하면서 만족되어
재매도진입이 발생하네요...
당일에 안나오면 그냥 끝나고 다음날 부터는 신규매도조건으로만 진행시키고 싶습니다.
도와주세요~
그리고
SetStopLoss(lpoint,PercentStop);
SetStopProfittarget(ppoint,PercentStop);
와
if MarketPosition==-1 Then{
if EntryPrice(1)*(1+lpoint/100)<c and IsEntryName("신규매도",1)==True Then
exitshort("손절");
if EntryPrice(1)*(1-ppoint/100)>c and IsEntryName("신규매도",1)==True Then
exitshort("익절");
}
가 신호가 전혀 다르게 나오는데...다른건가요?
이전글