Advertisement
saisri

final 2

Nov 7th, 2012
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.36 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 )", colorBrightGreen);
  74. PlotOHLC( r,r,50,r, "", IIf( r > 50, colorBlue, colorRed ), styleCloud | styleClipMinMax, 30, 70 );
  75. _SECTION_END();
  76.  
  77. Plot( Volume, "V", 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. _SECTION_END();
  85.  
  86. _SECTION_BEGIN("Magfied Market Price");
  87.  
  88. //Magfied Market Price
  89. FS=Param("Font Size",15,11,100,1);
  90. GfxSelectFont("Times New Roman", FS, 700, True );
  91. GfxSetBkMode( colorWhite );
  92. GfxSetTextColor( ParamColor("Color",colorBlue) );
  93. Hor=Param("Horizontal Position",850,1,1200,1);
  94. Ver=Param("Vertical Position",110,1,830,1);
  95. GfxTextOut(""+C, Hor , Ver );
  96. YC=TimeFrameGetPrice("C",inDaily,-1);
  97. DD=Prec(C-YC,2);
  98. xx=Prec((DD/YC)*100,2);
  99. GfxSelectFont("Times New Roman", 8, 600, True );
  100. GfxSetBkMode( colorBlack );
  101. GfxSetTextColor(ParamColor("Color",colorYellow) );
  102. GfxTextOut(""+DD+" ("+xx+"%)", Hor , Ver+22 );
  103.  
  104.  
  105.  
  106. _SECTION_END();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement