以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  交易策略发布专区  (http://weistock.com/bbs/list.asp?boardid=10)
----  [交易系统]MACD动量突破  (http://weistock.com/bbs/dispbbs.asp?boardid=10&id=5127)

--  作者:z7c9
--  发布时间:2011/2/11 9:10:08
--  [交易系统]MACD动量突破

图片点击可在新窗口打开查看

 

runmode:0;

input:p(26,20,100,8);
input:s(12,5,40,4);
input:m(9,2,60,6);

variable:myasset=300000;

diff:=ema(close,s)-ema(close,p);
dea:=ema(diff,m);
macd:=2*(diff-dea);

entertime:=time>=091000 and time<=145500;
exittime:=time>=150000;

buycond:=ref(cross(macd,0),1);
sellcond:=ref(cross(0,macd),1);

if holding=0 then begin
 if buycond then
  buy(1,1,limitr,open);
end

if holding=0 then begin
 if sellcond then
  buyshort(1,1,limitr,open);
end

if holding>0 then begin
 if exittime then
  sell(1,holding,limitr,close);
 
 if sellcond then begin
  sell(1,holding,limitr,open),orderqueue;
  buyshort(1,1,limitr,open),orderqueue;
 end 
end

if holding<0 then begin
 if exittime then
  sellshort(1,holding,limitr,close);
  
 if buycond then begin
  sellshort(1,holding,limitr,open),orderqueue;
  buy(1,1,limitr,open),orderqueue;
 end 
end

if exittime then
 myasset:=asset;
 
收益:myasset,noaxis,colormagenta;
次数:totaltrade,linethick0;
胜率:percentwin,linethick0;
连亏:maxseqloss,linethick0;
连赢:maxseqwin,linethick0;

[此贴子已经被作者于2011-10-3 11:25:39编辑过]

--  作者:xian_0_9
--  发布时间:2011/2/11 11:01:34
--  

嗯。还是这么发帖子好。

全角号省的我自己改了~


--  作者:hanbin618
--  发布时间:2011/2/14 18:03:55
--  

学习


--  作者:a7777
--  发布时间:2013/1/29 21:15:59
--  
图片点击可在新窗口打开查看
--  作者:roxwang
--  发布时间:2014/4/1 15:22:53
--  
总是显示是使用了交易系统函数,但不是交易系统公式,何解?。
--  作者:bella
--  发布时间:2014/5/1 1:06:25
--  
学习学习
--  作者:金字塔刀客
--  发布时间:2014/6/15 14:03:10
--  
学学习