您好,论坛有很多例子,您可以搜下
http://www.weistock.com/bbs/dispbbs.asp?boardid=10&Id=2160
您看可以看下这个代码范例,论坛相关的帖子您也可以搜索下。
手数:1;
ma5:=ma(c,5);
ma20:=ma(c,20);
开多条件:=cross(ma5,ma20);
开空条件:=cross(ma20,ma5);
//移动止盈
//多单
variable:win=0;
if 开多条件 and holding=0 then begin
BUY(1,手数,THISCLOSE);;
win:=c-enterprice;
end
if c-enterprice>win then win:=c-enterprice;
if win>=10 and c-enterprice<=3 then 平多1:sell(1,0,THISCLOSE); //盈利10个点后回撤达到7个点后平仓。