龙听期货论坛's Archiver

C
+
+


 微信: QQ:

龙听 发表于 2019-8-19 11:08

MACD动量突破(源码 主图 贴图)

金字塔交易系统指标 MACD动量突破
很多都是以前写的指标 现在没事拿来分享的,就没精力去做太多说明啦!我大概就在软件上运行下截图给大家吧!
有兴趣的自己拿去优化

[code]
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;
[/code]

[attach]11811[/attach]

王雷 发表于 2019-10-13 10:52

好策略

卓越 发表于 2019-10-23 15:06

{:smile:}

呆哥哥 发表于 2020-1-3 23:27

感謝分享、版主辛苦了

页: [1]