我写了个三均线的系统ma5、13、62
当13上穿62时做多,13上穿5时平多仓,5上穿13时再次开多仓,13上穿5时再次平多仓。。。依次循环
当13下穿62时做空,13下穿5时平空仓,5下穿13时再次开空仓,13下穿5时再次平空仓。。。依次循环
下面是我写的,求各位大佬帮忙看看哪里出错,谢谢各位!
ma5:ma(c,5);
ma13:ma(c,13);
ma62:ma(c,62);
BPK :=CROSS(ma13,ma62);
bp:=cross(ma13,ma5);
SPK :=CROSS(ma62,ma13);
sp:=cross(ma5,ma13);
if BPK THEN
BUY(bpk,1,THISCLOSE);
if close>ma62 and bp then
sell(bp,0,thisclose);
if close>ma62 and sp then
buy(sp and close>ma62 ,1,thisclose);
if close>ma62 and bp then
sell(bp,0,thisclose);
if SPK THEN
BUYSHORT(spk,1,THISCLOSE);
if close<ma62 and sp then
sellshort(sp,0,thisclose);
if close<ma62 and bp then
buyshort(bp and close<ma62 ,1,thisclose);
if close<ma62 and sp then
sellshort(sp,0,thisclose);
[此贴子已经被作者于2010-9-21 20:55:11编辑过]