[求助]求老师改写一个公式 [文华财经]
-
咨询内容:
RSV:=(CLOSE-LLV(LOW,19))/(HHV(HIGH,19)-LLV(LOW,19))*100;
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
J:=3*K-2*D;
RSV24:=(CLOSE-LLV(LOW,55))/(HHV(HIGH,55)-LLV(LOW,55))*100;
K24:=SMA(RSV24,3,1);
D24:=SMA(K24,3,1);
J24:=3*K24-2*D24;
A1:=BARSLAST(REF(CROSS("MACD.DIF","MACD.DEA"),1));
DRAWTEXT(REF(C,A1+1)>C AND REF("MACD.DIF",A1+1)<"MACD.DIF" AND CROSS("MACD.DIF","MACD.DEA")>0,L-0.02,'M',COLOR00FFFF;{MACD底背离}
A2:=BARSLAST(REF(CROSS("KDJ.K","KDJ.D"),1));
DRAWTEXT(REF(C,A2+1)>C AND REF("KDJ.K",A2+1)<"KDJ.K" AND CROSS("KDJ.K","KDJ.D"),L-0.10,'K',COLORFF00FF;{KDJ底背离}
A3:=BARSLAST(REF(CROSS("RSI.RSI1","RSI.RSI2"),1));
DRAWTEXT(REF(C,A3+1)>C AND REF("RSI.RSI1",A3+1)<"RSI.RSI1" AND CROSS("RSI.RSI1","RSI.RSI2")>0,L-0.18,'R',COLOR0000FF;{RSI底背离};
C1:=BARSLAST(REF(CROSS("MACD.DEA","MACD.DIF"),1));
DRAWTEXT(REF(C,C1+1)<C AND REF("MACD.DIF",C1+1)>"MACD.DIF" AND CROSS("MACD.DEA","MACD.DIF")>0,H+0.16,'M',COLOR00FF00;{MACD顶背离};
C2:=BARSLAST(REF(CROSS("KDJ.D","KDJ.K"),1));
DRAWTEXT(REF(C,C2+1)<C AND REF("KDJ.K",C2+1)>"KDJ.K" AND CROSS("KDJ.D","KDJ.K")>0,H+0.08,'K',COLORFFFFCC;{KDJ顶背离}
C3:=BARSLAST(REF(CROSS("RSI.RSI2","RSI.RSI1"),1));
DRAWTEXT(REF(C,C3+1)<C AND REF("RSI.RSI1",C3+1)>"RSI.RSI1" AND CROSS("RSI.RSI2","RSI.RSI1")>0,H+0.04,'R',COLORFF9900;{RSI顶背离};
重心:=(C+0.618*REF(C,1)+0.382*REF(C,1)+0.236*REF(C,3)+0.146*REF(C,4))/2.382;
【操盘线】:EMA(((SLOPE(C,22)*20)+C),55),COLORYELLOW,LINETHICK4;
【黄金线】:IF(重心>=【操盘线】,【操盘线】,DRAWNULL),COLORRED,LINETHICK2;
【空仓线】:IF(重心<【操盘线】,【操盘线】,DRAWNULL),COLORCYAN,LINETHICK2;来源:程序化99
-
文华技术人员:
参考;
/* RSV:=(CLOSE-LLV(LOW,19))/(HHV(HIGH,19)-LLV(LOW,19))*100; K:=SMA(RSV,3,1); D:=SMA(K,3,1); J:=3*K-2*D; RSV24:=(CLOSE-LLV(LOW,55))/(HHV(HIGH,55)-LLV(LOW,55))*100; K24:=SMA(RSV24,3,1); D24:=SMA(K24,3,1); J24:=3*K24-2*D24; */ DIFF := EMA(CLOSE,12) - EMA(CLOSE,26);//短周期与长周期的收盘价的指数平滑移动平均值做差。 DEA := EMA(DIFF,9);//DIFF的M个周期指数平滑移动平均 MACD:=2*(DIFF-DEA),COLORSTICK;//DIFF减DEA的2倍画柱状线 RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;//收盘价与N周期最低值做差,N周期最高值与N周期最低值做差,两差之间做比值。 K:=SMA(RSV,3,1);//RSV的移动平均值 D:=SMA(K,3,1);//K的移动平均值 J:=3*K-2*D; LC := REF(CLOSE,1);//前一周期收盘价 RSI1:=SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)*100;//当根K线Q收盘价与前一周期收盘价做差,在该差值与0之间取最大值,做N1周期移动平均。收盘价与前一周期收盘价做差值,取该差值的N1周期移动平均值,两平均值之间做比值。 RSI2:=SMA(MAX(CLOSE-LC,0),12,1)/SMA(ABS(CLOSE-LC),12,1)*100;//当根K线收盘价与前一周期收盘价做差,在该差值与0之间取最大值,做N2周期移动平均。收盘价与前一周期收盘价做差值,取该差值的N2周期移动平均值,两平均值之间做比值。
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1)); DRAWTEXT(REF(C,A1+1)>C AND REF(DIFF,A1+1)<DIFF AND CROSS(DIFF,DEA)>0,L-0.02,'M',COLOR00FFFF;
A2:=BARSLAST(REF(CROSS(K,D),1)); DRAWTEXT(REF(C,A2+1)>C AND REF(K,A2+1)<K AND CROSS(K,D),L-0.10,'K',COLORFF00FF;
A3:=BARSLAST(REF(CROSS(RSI1,RSI2),1)); DRAWTEXT(REF(C,A3+1)>C AND REF(RSI1,A3+1)<RSI1 AND CROSS(RSI1,RSI2)>0,L-0.18,'R',COLOR0000FF;
C1:=BARSLAST(REF(CROSS(DEA,DIFF),1)); DRAWTEXT(REF(C,C1+1)<C AND REF(DIFF,C1+1)>DIFF AND CROSS(DEA,DIFF)>0,H+0.16,'M',COLOR00FF00;
C2:=BARSLAST(REF(CROSS(D,K),1)); DRAWTEXT(REF(C,C2+1)<C AND REF(K,C2+1)>K AND CROSS(D,K)>0,H+0.08,'K',COLORFFFFCC;
C3:=BARSLAST(REF(CROSS(RSI2,RSI1),1)); DRAWTEXT(REF(C,C3+1)<C AND REF(RSI1,C3+1)>RSI1 AND CROSS(RSI2,RSI1)>0,H+0.04,'R',COLORFF9900;
重心:=(C+0.618*REF(C,1)+0.382*REF(C,1)+0.236*REF(C,3)+0.146*REF(C,4))/2.382; 【操盘线】:EMA(((SLOPE(C,22)*20)+C),55),COLORYELLOW,LINETHICK4; 【黄金线】:IF(重心>=【操盘线】,【操盘线】,NULL),COLORRED,LINETHICK2; 【空仓线】:IF(重心<【操盘线】,【操盘线】,NULL),COLORCYAN,LINETHICK2;
有思路,想编写各种指标公式,交易模型,选股公式,还原公式的朋友
可联系技术人员 QQ: 262069696 或微信号:cxh99cxh99 进行 有偿收费 编写!
(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)
相关文章
-
没有相关内容