커뮤니티
손절후 매수
2011-06-29 23:58:06
688
글번호 40333
if MarketPosition==0 and Condition1==true then {
if ExitName(1)!="stoploss" then
buy("a",atlimit,c-1*PriceScale);
if ExitName(1)=="stoploss" then
if TimeToMinutes(stime)>TimeToMinutes(exittime(1))+30 then
buy("b",atlimit,c-1*PriceScale);
}
condition1==true 이면 매수하는 식에서 이전 청산이 손절이면 30분 후에
매수하도록 식을 작성하였는데 손절 후에도 a 로만 매수가 되네요.
무엇을 잘못하였을까요?
답변 1
예스스탁 예스스탁 답변
2011-06-30 16:12:00
안녕하세요
예스스탁입니다.
현재 isExitName과 달리 ExitName의 청산명의 대소문자를 구별하서
지정한 이름과 비교하게 되어 있어 원하시는 내용으로 발동을 하지
못했습니다.
아래 1번 혹은 2번식으로 사용하셔야 합니다.
1번
if MarketPosition==0 then {
if ExitName(1)!="StopLoss" then
buy("a",atlimit,c-1*PriceScale);
if ExitName(1)=="StopLoss" then
if TimeToMinutes(stime)>TimeToMinutes(exittime(1))+30 then
buy("b",atlimit,c-1*PriceScale);
}
SetStopLoss(0.5);
2.
if MarketPosition==0 then {
if IsExitName("stopLoss",1) == false then
buy("a",atlimit,c-1*PriceScale);
if IsExitName("stopLoss",1) == true then
if TimeToMinutes(stime)>TimeToMinutes(exittime(1))+30 then
buy("b",atlimit,c-1*PriceScale);
}
SetStopLoss(0.5);
즐거운 하루되세요
> bwr 님이 쓴 글입니다.
> 제목 : 손절후 매수
> if MarketPosition==0 and Condition1==true then {
if ExitName(1)!="stoploss" then
buy("a",atlimit,c-1*PriceScale);
if ExitName(1)=="stoploss" then
if TimeToMinutes(stime)>TimeToMinutes(exittime(1))+30 then
buy("b",atlimit,c-1*PriceScale);
}
condition1==true 이면 매수하는 식에서 이전 청산이 손절이면 30분 후에
매수하도록 식을 작성하였는데 손절 후에도 a 로만 매수가 되네요.
무엇을 잘못하였을까요?
다음글
이전글