So.J 15:14:15
请教个策略编写问题
A,B两条均线
在A上穿B后5个周期内 出现A下穿B时 开空 20个点止盈,5个点止损
在A下穿B后5个周期内 出现A上穿B时 开多 20个点止盈,5个点止损
反过来思考,在a下穿b的时候,判断之前5个周期是否存在a上穿b,这个会写吗?
A:=cross(均线1,均线2);
B:=cross(均线2,均线1);
AA:=barslast(A);
BB:=barslast(B);
if A=1 and AA<5 then buy(1,1,market);
if B=1 and BB<5 then buyshort(1,1,market);
if holding>0 and enterprice-c>5*mindiff then sell(1,0,market);
if holding>0 and c-enterprice>20*mindiff then sell(1,0,market);
if holding<0 and enterprice-c>20*mindiff then sellshort(1,0,market);
if holding<0 and c-enterprice>5*mindiff then sellshort(1,0,market);
[此贴子已经被作者于2013-5-8 16:10:54编辑过]