Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共7 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:[交易系统]MACD动量突破

1楼
z7c9 发表于:2011/2/11 9:10:08

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

 

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编辑过]
2楼
xian_0_9 发表于:2011/2/11 11:01:34

嗯。还是这么发帖子好。

全角号省的我自己改了~

3楼
hanbin618 发表于:2011/2/14 18:03:55

学习

4楼
a7777 发表于:2013/1/29 21:15:59
图片点击可在新窗口打开查看
5楼
roxwang 发表于:2014/4/1 15:22:53
总是显示是使用了交易系统函数,但不是交易系统公式,何解?。
6楼
bella 发表于:2014/5/1 1:06:25
学习学习
7楼
金字塔刀客 发表于:2014/6/15 14:03:10
学学习
共7 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.06689 s, 2 queries.