Advertisement
saisri

stockxray

Apr 13th, 2013
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.26 KB | None | 0 0
  1.  
  2. _SECTION_BEGIN("MA Diff");
  3. T=26;
  4. KMA=((C-MA(C,T))/MA(C,T))*100;
  5. Graph0=KMA;
  6. Graph0Style=2+4;
  7. Graph0BarColor=IIf(KMA>0,5,4);
  8. GraphXSpace=5;
  9.  
  10. _SECTION_END();
  11.  
  12.  
  13. SetChartBkColor(colorGrey40);
  14. cx=Param("cxposn",1000,0,1000,1);
  15. cy=Param("cyposn",6,0,1000,1);
  16.  
  17. GfxSetBkColor(ColorRGB(200,50,300));
  18. GfxSelectFont( "Bodoni MT",18,98, False);
  19. GfxSetTextColor( colorWhite);
  20. GfxTextOut(" "+C+" ", cx, cy );
  21. _SECTION_BEGIN("Name");
  22. GfxSetOverlayMode(1);
  23. GfxSelectFont("Tahoma", Status("pxheight")/20);
  24. GfxSetTextAlign( 6 );// center alignment
  25. GfxSetTextColor( ColorHSB( 10, 300, 20 ) );
  26. GfxSetBkMode(0); // transparent
  27. GfxTextOut( Name(), Status("pxwidth")/2, Status("pxheight")/20 );
  28.  
  29. GfxSelectFont("Tahoma", Status("pxheight")/22);
  30. GfxTextOut( "SUBHAS801", Status("pxwidth")/8, Status("pxheight")/8 );
  31.  
  32.  
  33. //GfxSelectFont("Tahoma", Status("pxheight")/10 );
  34. //GfxSelectFont("Tahoma", Status("pxheight")/26 );
  35. _SECTION_END();
  36. e30 = EMA(Close,240);
  37. f30 = EMA(Close,20);
  38. Plot(EMA(Close,20),"fine2",colorBrightGreen,styleDots);
  39. Plot(EMA(Close,240),"fine3",colorWhite,styleDots);
  40.  
  41.  
  42.  
  43. _SECTION_BEGIN("trend candle");
  44. ////////////////////////////////////
  45. // Heikin_Ashi For Amibroker
  46. ////////////////////////////////////
  47.  
  48. HaClose =EMA((O+H+L+C)/4,3);
  49. HaOpen = AMA( Ref( HaClose, -1 ), 0.5 );
  50. HaHigh = Max( H, Max( HaClose, HaOpen ) );
  51. HaLow = Min( L, Min( HaClose, HaOpen ) );
  52. PlotOHLC( Open, High, Low, Close, "Modified " + Name(), colorBrown, styleCandle | styleNoLabel );
  53. //SetChartBkGradientFill( ParamColor("BgTop", colorBrightGreen),ParamColor("BgBottom", colorSeaGreen));
  54. Title="";
  55. _SECTION_END();
  56.  
  57. Buy = Cross(f30, e30);
  58. Sell = Cross(e30, f30 );
  59. AlertIf( Cross( f30,e30), "SOUND C:\\Windows\\Media\\Ringin.wav", "BUY-STRONG SIGNAL stockxray", 2 );
  60. AlertIf( Cross( e30, f30 ), "SOUND C:\\Windows\\Media\\Ringin.wav","SELL-STRONG SIGNAL stockxray", 2 );
  61.  
  62. _SECTION_BEGIN("MABIUTS");
  63. SetChartOptions(0,chartShowArrows|chartShowDates);
  64. _N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) ));
  65.  
  66. Buy=EMA(C,13)>EMA(EMA(C,13),9) AND Cross (C,Peak(C,5,1));
  67. Sell=Cross (EMA(EMA(C,13),9),EMA(C,13));
  68. MYcolor = IIf( EMA(C,13)>EMA(EMA(C,13),9) AND C>Peak(C,2,1), colorGreen, IIf(EMA(C,13)>EMA(EMA(C,13),9) AND C<Peak(C,2,1),colorBlue, colorBrown ));
  69.  
  70. //PlotOHLC( Open, High, Low, Close, "", Mycolor, styleBar );
  71.  
  72. shape = Buy * shapeHollowStar + Sell * shapeHollowStar;
  73. PlotShapes( shape, IIf( Buy, colorGreen, colorRed ),0, IIf( Buy, Low, High ) );
  74.  
  75. GraphXSpace = 5;
  76. dist = 1.5*ATR(10);
  77.  
  78. for( i = 0; i < BarCount; i++ )
  79.  
  80. if( Buy[i] )
  81. //PlotText( "Buy\n@" + C[ i ], i, L[ i ]-dist[i], colorGreen );
  82. if( Sell[i] )
  83. //PlotText( "Sell\n@" + C[ i ], i, H[ i ]+dist[i], colorRed);
  84.  
  85.  
  86.  
  87. _SECTION_END();
  88.  
  89. //P = ParamField("Price field",-1);
  90. //Periods = Param("Periods", 89, 2, 300, 1, 10 );
  91. //Plot( WMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
  92. //m = 0;
  93.  
  94. _SECTION_BEGIN("WMA89");
  95. P = ParamField("Field");
  96. Type = ParamList("Type", "Weighted,Simple,Exponential,Double Exponential,Tripple Exponential,Wilders");
  97.  
  98. Periods89 = Param("Periods89", 89, 2, 300 );
  99. Displacement2 = Param("Displacement2", 2, -50, 50 );
  100. //Plot( WMA( P, Periods89 ), _DEFAULT_NAME(), colorBlue, styleStaircase+styleLine, 0, 0, Displacement2 );
  101.  
  102. _SECTION_END();
  103.  
  104. //P = ParamField("Price field",-1);
  105. //Periods = Param("Periods", 89, 2, 300, 1, 10 );
  106. //Plot( WMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
  107. //m = 0;
  108.  
  109. _SECTION_BEGIN("Volume At Price");
  110. //PlotVAPOverlay( Param("Lines", 300, 100, 1000, 1 ), Param("Width", 5, 1, 100, 1 ), ParamColor("Color", colorCycle ), ParamToggle("Side", "Left|Right" ) | 4*ParamToggle("Z-order", "On top|Behind", 1 ) );
  111.  
  112. _SECTION_END();
  113.  
  114.  
  115. //Displacement = Param("Displacement", 1, -50, 50 );
  116.  
  117. //m = 0;
  118.  
  119.  
  120. _SECTION_END();
  121. Pivot = ParamToggle("Pivot_day", "No|Yes", 1);
  122.  
  123. if(Pivot)
  124. {
  125. H1= TimeFrameGetPrice("H", inDaily, -1); // yesterdays high
  126. L1 = TimeFrameGetPrice("L", inDaily, -1); // low
  127. C1= TimeFrameGetPrice("C", inDaily, -1); // close
  128. Op = TimeFrameGetPrice("O", inDaily)-1; // current day open
  129.  
  130. }
  131. else
  132. {
  133. H1 = TimeFrameGetPrice("H", inDaily); // yesterdays high
  134. L1 = TimeFrameGetPrice("L", inDaily); // low
  135. C1= TimeFrameGetPrice("C", inDaily);
  136. Op = TimeFrameGetPrice("O", inDaily); // current day open
  137.  
  138. }
  139.  
  140.  
  141. // PIVOT Calculation
  142. PP = (H1+ L1 +L1 + C1 )/4;
  143. PPA = (H1+ H1 +L1 + C1 )/4;
  144. Plot(PP, "best up",colorBlack,4+8+2048 );
  145. Plot(PPA, "best down",colorBlack,4+8+2048 );
  146. //Plot( (H1),"HH",colorBrown,4+8+2048);
  147. //Plot( (L1),"LL",colorAqua,4+8+2048);
  148.  
  149. _SECTION_END();
  150. //---- pivot points
  151. DayH = TimeFrameGetPrice("H", inDaily, -1);// yesterdays high
  152. DayL = TimeFrameGetPrice("L", inDaily, -1);//low
  153. DayC = TimeFrameGetPrice("C", inDaily, -1);//close
  154. DayO = TimeFrameGetPrice("O", inDaily);// current day open
  155. HiDay = TimeFrameGetPrice("H", inDaily);
  156. LoDay = TimeFrameGetPrice("L", inDaily);
  157.  
  158. R2 = Prec(DayC+(DayH-DayL)*0.382,4);
  159. R3 = Prec(DayC+(DayH-DayL)*0.618,4);
  160. R4 = Prec(DayC+(DayH-DayL),4);
  161. S2 = Prec(DayC-(DayH-DayL)*0.382,4);
  162. S3 = Prec(DayC-(DayH-DayL)*0.618,4);
  163. S4 = Prec(DayC-(DayH-DayL),4);
  164. rcolor = colorLightBlue;
  165. scolor = colorLightBlue;
  166.  
  167. style = styleLine | styleThick + styleNoRescale;
  168.  
  169. Plot(R2, "UP Trg 1",rcolor,style);
  170. Plot(R3, "UP Trg 2",rcolor,style);
  171. Plot(R4, "UP Trg 3",rcolor,style);
  172.  
  173.  
  174. Plot(S2, "DWN Trg1",scolor,style);
  175. Plot(S3, "DWN Trg2", scolor, style);
  176. Plot(S4, "DWN Trg3", scolor, style);
  177.  
  178.  
  179.  
  180.  
  181. DDayO = TimeFrameGetPrice("O", inDaily);// current day open
  182. DHiDay = TimeFrameGetPrice("H", inDaily);
  183. DLoDay = TimeFrameGetPrice("L", inDaily);
  184.  
  185. Title = "" + Name() + ", " + Interval(2) + ", " + Date() +
  186. EncodeColor(colorPink) + "\nO " + EncodeColor(colorYellow) + O +
  187. EncodeColor(colorPink) + ", H : " + EncodeColor(colorBrightGreen) + H +
  188. EncodeColor(colorPink) + ", L : " + EncodeColor(colorWhite) + L +
  189. EncodeColor(colorPink) + ", C : " + EncodeColor(colorWhite) + C +
  190. "\n DLY-OPEN : " +DDayO + " Day-High : " +DHiDay + " Day-LOW : " + DLoDay +
  191. "\n"+ " Stoploss: " +e30 ;
  192. //PlotOHLC( Open, High, Low, Close, "", barcolor1, styleLine+styleNoLabel|styleThick+styleCandle );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement