Advertisement
saisri

second 04112012

Nov 4th, 2012
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.97 KB | None | 0 0
  1. _SECTION_BEGIN("Background_Setting");
  2. SetChartBkGradientFill( ParamColor("BgTop", colorBlack),
  3. ParamColor("BgBottom", colorBlack),ParamColor("titleblock",colorBlack ));
  4. _SECTION_END();
  5.  
  6. _SECTION_BEGIN("BullBear Volume");
  7.  
  8. C1 = Ref(C, -1);
  9. uc = C > C1; dc = C <= C1;
  10. ud = C > O; dd = C <= O;
  11.  
  12. green = 1; blue = 2; yellow = 3; red = 4; white = 5;
  13. VType = IIf(ud,
  14. IIf(uc, green, yellow),
  15. IIf(dd,
  16. IIf(dc, red, blue), white));
  17.  
  18.  
  19. gv = IIf(VType == green, V, 0);
  20. yv = IIf(VType == yellow, V, 0);
  21. rv = IIf(VType == red, V, 0);
  22. bv = IIf(VType == blue, V, 0);
  23.  
  24. uv = gv + bv; uv1 = Ref(uv, -1); /* up volume */
  25. dv = rv + yv; dv1 = Ref(dv, -1); /* down volume */
  26.  
  27. /* create moving average period parameters */
  28. VolPer = Param("Adjust Vol. MA per.", 34, 1, 255, 1);
  29. ConvPer = Param("Adjust Conv. MA per.", 9, 1, 255, 1);
  30.  
  31. /* create triple exponential moving avearges of separate up and down volume moving averages */
  32. MAuv = TEMA(uv, VolPer ); mauv1 = Ref(mauv, -1);
  33. MAdv = TEMA(dv, VolPer ); madv1 = Ref(madv, -1);
  34. MAtv = TEMA(V, VolPer );//total volume
  35.  
  36. /* Switch for Horizontal lines indicating current level of positive and negative volume for ease in comparing to past highs/lows - toggle via parmameter window */
  37. OscillatorOnly = Param("Show Oscillator Only", 0, 0, 1, 1);
  38. CompareBullVolume = Param("Show Bull Level", 1, 0, 1, 1);
  39. if(CompareBullvolume AND !OscillatorOnly){
  40. }
  41.  
  42. CompareBearVolume = Param("Show Bear Level", 1, 0, 1, 1);
  43. if(CompareBearVolume AND !OscillatorOnly){
  44. }
  45.  
  46. /* Volume Segment Switches - toggle via parameter window */
  47. bullvolume = Param("Show Bull Volume", 1, 0, 1, 1);
  48. bearvolume = Param("Show Bear Volume", 1, 0, 1, 1);
  49. totalvolume = Param("Show Total Volume", 1, 0, 1, 1);
  50.  
  51. /* plot volume lines and histograms if toggled on: */
  52. bearToFront = Param("Show Bear Vol in Front", 0, 0, 1, 1);
  53. if(bearToFront AND !OscillatorOnly){
  54. }
  55. if(bullvolume AND !OscillatorOnly){
  56. Plot(MAuv, "AVERAGE BULL VOLUME", colorBrightGreen, styleNoLine);
  57. }
  58. if(bearvolume AND !OscillatorOnly){
  59. Plot(MAdv, "AVERAGE BEAR VOLUME", colorRed, styleNoLine);
  60.  
  61.  
  62. }
  63.  
  64. Plot(100,"",7,styleLine);
  65. Plot(70,"", colorPink, styleLine, styleLine);
  66. Plot(-100,"",1,styleLine);
  67. Plot (30, "", colorPink, styleLine, styleNoLabel);
  68. Plot(0,"",7,styleLine);
  69.  
  70. _SECTION_BEGIN("Stoch K sell");
  71. SetChartOptions(0,0,ChartGrid30 | ChartGrid70 );
  72. r = StochK(15);
  73. Plot( r, "StochK (may be above 40 Buy,, below 20 Sell) )", colorBrightGreen);
  74. PlotOHLC( r,r,50,r, "", IIf( r > 50, colorBlue, colorRed ), styleCloud | styleClipMinMax, 30, 70 );
  75. _SECTION_END();
  76.  
  77. Plot( Volume, "Volume", colorLightBlue, styleHistogram | styleOwnScale );
  78.  
  79. _SECTION_BEGIN("trend");
  80. uptrend=PDI(20)>MDI(10)AND Signal(26)<MACD(13);
  81. downtrend=MDI(10)>PDI(20)AND Signal(26)>MACD(13);
  82.  
  83.  
  84. Plot( 2, /* defines the height of the ribbon in percent of pane width */"ribbon",
  85. IIf( uptrend, colorGreen, IIf( downtrend, colorRed, 0 )), /* choose color */
  86. styleOwnScale|styleArea|styleNoLabel, -0.5, 100 );
  87.  
  88. _SECTION_END();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement