=====================================
inputs:lossmoney(20000),addcontractN(2),len1(5),len2(20);
vars:ma1(0),ma2(0),markp(0),nprofit(0),Ncontract(0);
ma1=average(c,len1);
ma2=average(c,len2);
markp=marketposition;
if markp<>markp[1] and positionprofit(1)>0 then nprofit=netprofit;
if netprofit-nprofit+openpositionprofit< -lossmoney then Ncontract=addcontractN else Ncontract=1;
if ma1 cross below ma2 then sellshort Ncontract contract next bar at market;
=====================================
沒有留言:
張貼留言
歡迎留言討論!