- UID
- 2
- 积分
- 2869668
- 威望
- 1384862 布
- 龙e币
- 1484806 刀
- 在线时间
- 13082 小时
- 注册时间
- 2009-12-3
- 最后登录
- 2024-11-15
|
MACD红绿柱面积公式:
- DIF : 10*(EMA(CLOSE,short) - EMA(CLOSE,long));
- DEA : EMA(DIF,mid);
- MACD : 2*(DIF-DEA), COLORSTICK;
- {面积计算}//注:SUM(MACD在N周期内的总和 BARLAST上一次条件成立(macd>0)到当前的周期数;
- 绿面积:IF (MACD<0,SUM(MACD,BARSLAST(MACD>0)) * 100,0),linethick0,colorgreen;
- 红面积:IF (MACD>0,SUM(MACD,BARSLAST(MACD<0)) * 100,0),linethick0,colorred;
- DRAWTEXT( ref(MACD,1)>0 and MACD<=0 ,HHV(MACD,4), NUMTOSTRN(REF(红面积, 1), 3)), colorred,valign2;
- DRAWTEXT( ref(MACD,1)<0 and MACD>=0 ,LLV(MACD,4), NUMTOSTRN(REF(绿面积, 1), 3)), colorgreen;
- {当前面积}
- DRAWTEXT(BARSTATUS=2 and macd>0, -macd*0.03, NUMTOSTRN(红面积, 1),3), coloryellow,valign0, align2;
- DRAWTEXT(BARSTATUS=2 and macd<=0, -macd*0.03, NUMTOSTRN(绿面积, 1),3), coloryellow,valign2,align2;
- {多空线: 0, colorwhite, dotline;}
- stickline(MACD<0 and MACD>=REF(MACD, 1), 0, macd, 0, 0), linethick2,colorwhite;
- stickline(MACD<0 and MACD
- stickline(MACD>=0 and MACD>REF(MACD, 1), 0, macd, 0, 0), linethick2,colorred;
- stickline(MACD>=0 and MACD<=REF(MACD, 1), 0, macd, 0, 0),linethick2, colorwhite;
- {根据条件变色绘制dif线,当dif向上时画红线,dif向下时画绿线}
- partline(dif,dif>=ref(dif,1),rgb(255,0,0),dif﹤ref(dif,1),rgb(0,255,0)),linethick2;
复制代码 |
论坛官方微信、群(期货热点、量化探讨、开户与绑定实盘)
|