|
樓主 |
發表於 10-1-17 18:07
|
顯示全部樓層
本帖最後由 thirtycm 於 10-1-17 06:09 PM 編輯
- _SECTION_BEGIN("Bull vs Bear Volume");
- SetChartBkColor(16);
- C1 = Ref(C, -1);
- uc = C > C1; dc = C <= C1;
- ud = C > O; dd = C <= O;
- green = 1; blue = 2; yellow = 3; red = 4; white = 5;
- VType = IIf(ud,
- IIf(uc, green, yellow),
- IIf(dd,
- IIf(dc, red, blue), white));
- gv = IIf(VType == green, V, 0);
- yv = IIf(VType == yellow, V, 0);
- rv = IIf(VType == red, V, 0);
- bv = IIf(VType == blue, V, 0);
- uv = gv + bv; uv1 = Ref(uv, -1);
- dv = rv + yv; dv1 = Ref(dv, -1);
- VolPer = Param("Adjust Vol. MA per.", 34, 1, 255, 1);
- ConvPer = Param("Adjust Conv. MA per.", 9, 1, 255, 1);
- MAuv = TEMA(uv, VolPer ); mauv1 = Ref(mauv, -1);
- MAdv = TEMA(dv, VolPer ); madv1 = Ref(madv, -1);
- MAtv = TEMA(V, VolPer );
- OscillatorOnly = Param("Show Oscillator Only", 0, 0, 1, 1);
- CompareBullVolume = Param("Show Bull Level", 1, 0, 1, 1);
- if(CompareBullvolume AND !OscillatorOnly){
- Plot(SelectedValue(MAuv), "", colorRed, styleLine);
- }
- CompareBearVolume = Param("Show Bear Level", 1, 0, 1, 1);
- if(CompareBearVolume AND !OscillatorOnly){
- Plot(SelectedValue(MAdv), "", colorGreen, styleLine);
- }
- bullvolume = Param("Show Bull Volume", 1, 0, 1, 1);
- bearvolume = Param("Show Bear Volume", 1, 0, 1, 1);
- totalvolume = Param("Show Total Volume", 1, 0, 1, 1);
- bearToFront = Param("Show Bear Vol in Front", 0, 0, 1, 1);
- if(bearToFront AND !OscillatorOnly){
- Plot(MAdv, "", colorGreen, styleHistogram|styleNoLabel);
- }
- if(bullvolume AND !OscillatorOnly){
- Plot(MAuv, "Average Bull Volume", colorRed, styleHistogram|styleNoLabel);
- }
- if(bearvolume AND !OscillatorOnly){
- Plot(MAdv, "Average Bear Volume", colorGreen, styleHistogram|styleNoLabel);
- }
- if(totalVolume AND !OscillatorOnly){
- Plot(MAtv, "Total Volume", colorWhite, styleHistogram|styleNoLabel);
- Plot(MAtv, "", colorWhite, styleLine);
- }
- if(bullvolume AND !OscillatorOnly){
- Plot(MAuv, "", colorGreen, styleLine);
- }
- if(bearvolume AND !OscillatorOnly){
- Plot(MAdv, "", colorRed, styleLine);
- }
- Plot(0, "", colorBlue, 1);
- Converge = (TEMA(MAuv - MAdv, ConvPer));
- Converge1 = Ref(Converge, -1);
- ConvergeUp = Converge > Converge1;
- ConvergeOver = Converge > 0;
- rising = ConvergeUp AND ConvergeOver;
- falling = !ConvergeUp AND ConvergeOver;
- convergenceOscillator = Param("Show Oscillator", 0, 0, 1, 1);
- if(convergenceOscillator OR OscillatorOnly){
- Plot(Converge, "Bull/Bear Volume Convergence/Divergence", colorViolet,
- 1|styleLeftAxisScale|styleNoLabel|styleThick);
- Plot(0,"", colorYellow, 1|styleLeftAxisScale|styleNoLabel);
- }
- riseFallColor = IIf(rising, 14,15);
- riseFallShadows = Param("Show RiseFallShadows", 0, 0, 1, 1);
- if(riseFallShadows){
- Plot(IIf(rising OR falling, 1, 0), "", riseFallColor,
- styleHistogram|styleArea|styleOwnScale|styleNoLabel);
- }
- GraphXSpace = 0.5;
- _SECTION_END();
複製代碼 另一種成交量!白色是總量,紅色的買進的量,綠色是賣出的量! |
|