Stock

YT

파란마을 2008. 7. 31. 10:36

Input : shortperiod(5), longperiod(50);
var : 단기이평(0), 장기이평(0);

//기본전략

단기이평 =ma(c, shortperiod);
장기이평 =ma(c, longperiod);

//매수

if crossup(단기이평,장기이평) then                 //골든크로스
buy("매수진입");                                          //매수

//매수청산 및 이익대비 손절

if setstoptrailing(5,2,percentstop,0) and         //이익대비손절
crossdown(단기이평,장기이평) then             //데드크로스
exitlong("매수청산");                                  //매수청산

반응형