老师,请帮忙改个选股指标 [文华财经]
-
咨询内容:
老师好!请帮忙把这个双MACD指标,改写为选股指标。 条件是:MACD1的DIF1和DEA1从下往上穿越MACD2的DIF2和DEA2。选股!参数老师不用管,我自己设置。代码如下:
DIFF1 : EMA(CLOSE,SHORT1) - EMA(CLOSE,LONG1);DEA1 : EMA(DIFF1,M1),LINETHICK1;2*(DIFF1-DEA1),COLORSTICK;MACD1:2*(DIFF1-DEA1),COLORSTICK;
STICKLINE(MACD1>0 AND MACD1>=REF(MACD1,1),0,MACD1,10,0),RGB(210,0,0);STICKLINE(MACD1<0 AND MACD1<REF(MACD1,1),0,MACD1,10,0),RGB(0,255,255);
DRAWCOLORLINE(DIFF1>REF(DIFF1,1),DIFF1,COLORRED,COLORGREEN);DRAWCOLORLINE(DEA1>REF(DEA1,1),DEA1,COLORRED,COLORGREEN);
DRAWICON(CROSSDOWN(DIFF1 ,DEA1 )&&MACD1<0,DIFF1 ,'CO148';CROSSDOWN(DIFF1,DEA1 )&&MACD1<0,SOUND('';DRAWICON(CROSS(DIFF1,DEA1 )&&MACD1>0,DIFF1 ,'CO149';CROSS(DIFF1,DEA1 )&&MACD1<0,SOUND('';
DIFF2 : EMA(CLOSE,SHORT2) - EMA(CLOSE,LONG2);DEA2 : EMA(DIFF2,M2),LINETHICK1;2*(DIFF2-DEA2),COLORSTICK;MACD2:2*(DIFF2-DEA2),COLORSTICK;
STICKLINE(MACD2>0 AND MACD2>=REF(MACD2,1),0,MACD2,10,0),RGB(210,0,0);STICKLINE(MACD2<0 AND MACD2<REF(MACD2,1),0,MACD2,10,0),RGB(0,255,255);
DRAWCOLORLINE(DIFF2>REF(DIFF2,1),DIFF2,COLORRED,COLORGREEN);DRAWCOLORLINE(DEA2>REF(DEA2,2),DEA2,COLORRED,COLORGREEN);
DRAWICON(CROSSDOWN(DIFF2 ,DEA2 )&&MACD2<0,DIFF2 ,'CO148';CROSSDOWN(DIFF2,DEA2 )&&MACD2<0,SOUND('';DRAWICON(CROSS(DIFF2,DEA2 )&&MACD2>0,DIFF2 ,'CO149';CROSS(DIFF2,DEA2 )&&MACD2<0,SOUND('';来源:程序化99
-
文华技术人员:
参考:
DIFF1 : EMA(CLOSE,SHORT1) - EMA(CLOSE,LONG1); DEA1 : EMA(DIFF1,M1),LINETHICK1; 2*(DIFF1-DEA1),COLORSTICK; MACD1:2*(DIFF1-DEA1),COLORSTICK;
STICKLINE(MACD1>0 AND MACD1>=REF(MACD1,1),0,MACD1,10,0),RGB(210,0,0); STICKLINE(MACD1<0 AND MACD1<REF(MACD1,1),0,MACD1,10,0),RGB(0,255,255);
DRAWCOLORLINE(DIFF1>REF(DIFF1,1),DIFF1,COLORRED,COLORGREEN); DRAWCOLORLINE(DEA1>REF(DEA1,1),DEA1,COLORRED,COLORGREEN);
DRAWICON(CROSSDOWN(DIFF1 ,DEA1 )&&MACD1<0,DIFF1 ,'ICO148'); CROSSDOWN(DIFF1,DEA1 )&&MACD1<0,SOUND('A'); DRAWICON(CROSS(DIFF1,DEA1 )&&MACD1>0,DIFF1 ,'ICO149'); CROSS(DIFF1,DEA1 )&&MACD1<0,SOUND('B');
DIFF2 : EMA(CLOSE,SHORT2) - EMA(CLOSE,LONG2); DEA2 : EMA(DIFF2,M2),LINETHICK1; 2*(DIFF2-DEA2),COLORSTICK; MACD2:2*(DIFF2-DEA2),COLORSTICK;
STICKLINE(MACD2>0 AND MACD2>=REF(MACD2,1),0,MACD2,10,0),RGB(210,0,0); STICKLINE(MACD2<0 AND MACD2<REF(MACD2,1),0,MACD2,10,0),RGB(0,255,255);
DRAWCOLORLINE(DIFF2>REF(DIFF2,1),DIFF2,COLORRED,COLORGREEN),LINETHICK2; DRAWCOLORLINE(DEA2>REF(DEA2,2),DEA2,COLORRED,COLORGREEN),LINETHICK2;
DRAWICON(CROSSDOWN(DIFF2 ,DEA2 )&&MACD2<0,DIFF2 ,'ICO148'); CROSSDOWN(DIFF2,DEA2 )&&MACD2<0,SOUND('A'); DRAWICON(CROSS(DIFF2,DEA2 )&&MACD2>0,DIFF2 ,'ICO149'); CROSS(DIFF2,DEA2 )&&MACD2<0,SOUND('B'); AAX:=EXIST(MAX(DIFF1,DEA1)<MIN(DIFF2,DEA2),SUMBARS(MIN(DIFF1,DEA1)>MAX(DIFF2,DEA2),2)); CROSS(MIN(DIFF1,DEA1),MAX(DIFF2,DEA2))&&AAX,SELECT; DRAWICON(CROSS(MIN(DIFF1,DEA1),MAX(DIFF2,DEA2))&&AAX,MACD1,1);
有思路,想编写各种指标公式,交易模型,选股公式,还原公式的朋友
可联系技术人员 QQ: 262069696 或微信号:cxh99cxh99 进行 有偿收费 编写!
(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)
相关文章
-
没有相关内容