以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  新手的买入问题  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=48841)

--  作者:shark
--  发布时间:2013/2/24 23:03:07
--  新手的买入问题
 <!--[if gte mso 9]> Normal 0 7.8 磅 0 2 false false false MicrosoftInternetExplorer4 <![endif]-->

你好,

 

上叉买多盈利后止盈,其后未下叉且符合条件再次买多,希望控制“再买”次数,最多2次。

超过2次后等待下叉卖出。 写了2个方法控制次数,都无法成功,具体表现是经常超过2次。请帮助修改一下。谢谢

 

IF long then

begin

SELLSHORT(HOLDING<0,HOLDING,MARKET);

BUY (holding=0,1,thisclose);

end

方法1

variable:cishu=1;

IF MA1>MA2 and cishu<3 then begin

if止盈 then SELL(HOLDING>0,0,MARKET);

If再买then begin

buy(1,0,market) ;

Cishu:=cishu+1;

End

 

方法2

variable:cishu=1;

if 止盈

then begin

sell(holding>0,0,MARKET);

if再买then

for cishu=1 to 2 do begin

BUYSHORT (holding=0,1,thisclose);

Cishu:=cishu+1;

end

end

<!--[if gte mso 9]> <![endif]--><!--[if gte mso 10]> <![endif]-->
--  作者:jinzhe
--  发布时间:2013/2/25 9:07:53
--  

variable:cishu=1;

if cishu<=2 and 再买条件 then begin

buy;

cishu:=cishu+1;

end


--  作者:shark
--  发布时间:2013/2/25 11:42:28
--  
 我发了个邮件,请查收
--  作者:shark
--  发布时间:2013/2/25 11:42:43
--  
 还是有问题