以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  [求助]移动止盈问题  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=51960)

--  作者: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);



为什么没有起作用   怎么修改

--  作者:jinzhe
--  发布时间:2013/5/13 14:03:16
--  
什么合约?10这个是点位?
--  作者:rfgvb
--  发布时间:2013/5/13 14:09:52
--  
股指   10点是点位 
--  作者: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编辑过]

--  作者:rfgvb
--  发布时间:2013/5/13 16:31:15
--  
好的  谢谢  我再试试