-- 作者:rfgvb
-- 发布时间:2013/5/13 14:01:41
-- [求助]移动止盈问题
//移动止盈 //多单 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 sell(1,0,THISCLOSE); if win>=15 and c-enterprice<=6 then sell(1,0,THISCLOSE); if win>=20 and c-enterprice<=12 then sell(1,0,THISCLOSE); if win>=25 and c-enterprice<=20 then sell(1,0,THISCLOSE);
//空单 variable:win1=0; if 开空条件 and holding=0 then begin BUYSHORT(1,手数,THISCLOSE); win1:=enterprice-c; end if enterprice-c>win1 then win1:=enterprice-c; if win1>=10 and enterprice-c<=5 then sellshort(1,0,THISCLOSE); if win1>=15 and enterprice-c<=6 then sellshort(1,0,THISCLOSE); if win1>=20 and enterprice-c<=12 then sellshort(1,0,THISCLOSE); if win1>=25 and enterprice-c<=20 then sellshort(1,0,THISCLOSE);
为什么没有起作用 怎么修改
|
-- 作者:RogarZ
-- 发布时间:2013/5/13 15:22:27
--
请问哪里不起作用,凭什么说不起作用?
手数: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); if win>=15 and c-enterprice<=6 then 平多2:sell(1,0,THISCLOSE); if win>=20 and c-enterprice<=12 then 平多3:sell(1,0,THISCLOSE); if win>=25 and c-enterprice<=20 then 平多4:sell(1,0,THISCLOSE);
//空单 variable:win1=0; if 开空条件 and holding=0 then begin BUYSHORT(1,手数,THISCLOSE); win1:=enterprice-c; end if enterprice-c>win1 then win1:=enterprice-c; if win1>=10 and enterprice-c<=5 then 平空1:sellshort(1,0,THISCLOSE); if win1>=15 and enterprice-c<=6 then 平空2:sellshort(1,0,THISCLOSE); if win1>=20 and enterprice-c<=12 then 平空3:sellshort(1,0,THISCLOSE); if win1>=25 and enterprice-c<=20 then 平空4:sellshort(1,0,THISCLOSE);
if time>=145500 then BEGIN 收盘多:sell(1,0,market); 收盘空:sellshort(1,0,market); end
此主题相关图片如下:搜狗截图13年05月13日1522_1.png

不起作用,哪来的平1 平2 等等
[此贴子已经被作者于2013-5-13 15:23:09编辑过]
|