수식부탁드립니다.
매수와 청산식은 아래와 같고 하루 한번만 진입합니다
if countif(marketposition==0 && crossup(c,ma(c,5)) && dayindex()>0, dayindex())==1 &&
marketposition==0 && crossup(c,ma(c,5)) && dayindex()>0 then buy();
if marketposition==1 && crossdown(c,ma(c,5)) && dayindex()>0 then exitlong();
위와 동일한 식을 참조종목에 적용하고
본봉목의 수익과 참조종목의 수익의 합이 30틱이면 본종목을 청산할수 있도록
수식부탁드립니다.
답변 1
예스스탁
예스스탁 답변
2024-01-24 11:00:45
안녕하세요
예스스탁입니다.
var : E1(0,Data1),E2(0,Data1),P1(0,Data1),P2(0,Data1);
if data1(countif(marketposition==0 && crossup(c,ma(c,5)) && dayindex()>0, dayindex())==1 &&
marketposition==0 && crossup(c,ma(c,5)) && dayindex()>0) then
{
buy();
E1 = Data1(c);
E2 = Data2(c);
}
if marketposition == 1 Then
{
if (crossdown(c,ma(c,5)) && dayindex()>0) then exitlong();
P1 = Data1((c-E1)/PriceScale);
P2 = Data2((c-E2)/PriceScale);
if P1+P2 >= 30 Then
ExitLong();
}
즐거운 하루되세요
> 베스트시스템 님이 쓴 글입니다.
> 제목 : 수식부탁드립니다
> 수식부탁드립니다.
매수와 청산식은 아래와 같고 하루 한번만 진입합니다
if countif(marketposition==0 && crossup(c,ma(c,5)) && dayindex()>0, dayindex())==1 &&
marketposition==0 && crossup(c,ma(c,5)) && dayindex()>0 then buy();
if marketposition==1 && crossdown(c,ma(c,5)) && dayindex()>0 then exitlong();
위와 동일한 식을 참조종목에 적용하고
본봉목의 수익과 참조종목의 수익의 합이 30틱이면 본종목을 청산할수 있도록
수식부탁드립니다.