第一次使用金字塔,感觉功能比较全,但是还不会金字塔的语言,请老师帮编一个模型。
思路:1、当日线的MA20大于日线的MA60,十五分钟周期的20均线金叉60均线,开多。
2、十五分钟周期的20均线死叉60均线,平三分之一的仓位。
3、日线周期的收盘价小于5日均线,平三分之一。
4、日线周期的20均线死叉60均线,全平。
十五分钟的代码,命名为aa
ma20:ma(c,20);
ma60:ma(c,60);
jc:cross(ma20,ma60);
sc:cross(ma60,ma20);
日线周期代码,
ss:3;
minute_sc:STKINDI('','aa.sc',0,3,0);
minute_jc:STKINDI('','aa.jc',0,3,0);
//MINUTE_cd2:=STKINDI('','aa.cd2',0,3,0);
ma15:ma(c,15);
ma60:ma(c,60);
sc:cross(ma60,ma15);
cd1:ma15>ma60;
EM5:(H+L+C)/3;
cd2:c<ema(EM5,5);
if cd1 and minute_jc then buy(holding=0,ss,market);
if cd2 and holding>0 then sell(holding>0,holding/3,market);
if minute_sc and holding>0 then sell(holding>0,holding/2,market);
if sc and holding>0 then sell(holding>0,holding,market);
我不懂什么截图,但是图上只出现那MA线,没有出现买卖信号