跨15分钟周期的5分钟白糖多空模型


调用公式源码 公式名称必须为XDIK 名称不能有变:
MA1:=EMA(CLOSE,12);
MA2:=EMA(CLOSE,47);
B:=(MA1-MA2);//中期方向线


主交易模型源码: #IMPORT[,MIN15,XDIK]AS VAR //引入15分钟周期中期方向线
DB15:=VAR.B;
FILLRGN(DB15>=0,1,1.5,COLORRED);
FILLRGN(DB15<0,1,1.5,COLORGREEN);
A1:=EMA(C,12);
A2:=ISUP&&REF(EVERY(ISDOWN,4),1)&&EVERY(C<A1,5)&&DB15>0&&CLOSEMINUTE>10;//4阴1阳开多仓
DRAWICON(A2,4,'ICO1');//在副图画出开多仓图标
A2,BK;
PLAYSOUND(A2,'A');
HH:=HHV(H,BARSBK+1),
P1:=C>=BKPRICE&&C<=HH-10||C>BKPRICE+20||C<BKPRICE-30||CLOSEMINUTE<=3;//平多仓条件
P1,SP;

B1:=ISDOWN&&REF(EVERY(ISUP,5),1)&&CLOSEMINUTE>10;//4阳1阴开空仓
DRAWICON(B1,3,'ICO2');
B1,SK;
LL:=LLV(L,BARSSK+1);

P2:=C<SKPRICE&&C>=LL+10||C<SKPRICE-20||C>SKPRICE+30||CLOSEMINUTE<=3;
P2,BP;
PLAYSOUND(B1,'B');
AUTOFILTER;