Advertisement
saisri

new one given by saptha

Dec 6th, 2012
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.15 KB | None | 0 0
  1. /* wayneL's Daytrading Template - To be plotted on intraday charts */
  2.  
  3. GraphXSpace = 1;
  4.  
  5. /* This plots the price bars. Select whether you want candlesticks or ordinary bars via th "view" menu */
  6.  
  7. _SECTION_BEGIN("Price");
  8. SetChartOptions(0,chartShowArrows|chartShowDates);
  9. _N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
  10. Plot( C, "Close", ParamColor("Color", colorGreen ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
  11. _SECTION_END();
  12.  
  13. /* The following three codes are the exponential moving average flippers. These can be deleted or modified to suit */
  14.  
  15. _SECTION_BEGIN("10EMA Flipper");
  16. mov = 10;
  17. hi = EMA(H,mov);
  18. lo = EMA(L,mov) ;
  19. x1 = IIf(C>Ref(hi,-1),1,IIf(C<Ref(lo,-1),-1,0));
  20. x2 = ValueWhen(x1!=0,x1,1);
  21. st = IIf(x2==-1,Hi,Lo);
  22. Plot(Ref(st,-1),"",colorYellow,styleNoLine|styleBar|styleNoLabel);
  23. _SECTION_END();
  24.  
  25. _SECTION_BEGIN("20EMA Flipper");
  26. mov = 20;
  27. hi = EMA(H,mov);
  28. lo = EMA(L,mov) ;
  29. x1 = IIf(C>Ref(hi,-1),1,IIf(C<Ref(lo,-1),-1,0));
  30. x2 = ValueWhen(x1!=0,x1,1);
  31. st = IIf(x2==-1,Hi,Lo);
  32. Plot(Ref(st,-1),"",colorWhite,styleNoLine|styleBar|styleNoLabel );
  33. _SECTION_END();
  34.  
  35. _SECTION_BEGIN("34EMA Flipper");
  36. mov = 34;
  37. hi = EMA(H,mov);
  38. lo = EMA(L,mov) ;
  39. x1 = IIf(C>Ref(hi,-1),1,IIf(C<Ref(lo,-1),-1,0));
  40. x2 = ValueWhen(x1!=0,x1,1);
  41. st = IIf(x2==-1,Hi,Lo);
  42. Plot(Ref(st,-1),"",colorRed,styleNoLine|styleBar|styleNoLabel) ;
  43. _SECTION_END();
  44.  
  45. /* The next section calculates and plots the dynamic 3 day pivots */
  46.  
  47. _SECTION_BEGIN("3 Day Pivots");
  48. Hi1 = IIf(Day()!=Ref(Day(),-1),Ref(HighestSince(Day()!=Ref(Day(),-1),H,3),-1),0);
  49. Hi = ValueWhen(Day()!=Ref(Day(),-1),Hi1,1);
  50. Lo1 = IIf(Day()!=Ref(Day(),-1),Ref(LowestSince(Day()!=Ref(Day(),-1),L,3),-1),0);
  51. Lo = ValueWhen(Day()!=Ref(Day(),-1),Lo1,1);
  52. Cl1 = IIf(Day()!=Ref(Day(),-1),Ref(C,-1),0);
  53. Cl = ValueWhen(Day()!=Ref(Day(),-1),Cl1,1);
  54.  
  55. rg = (Hi - Lo);
  56. bp = (Hi + Lo + Cl)/3;
  57. r1 = (bp*2)-Lo;
  58. s1 = (bp*2)-Hi;
  59. r2 = bp + r1 - s1;
  60. s2 = bp - r1 + s1;
  61.  
  62. Plot(s2,"",colorRed,styleBar|styleNoRescale|styleNoLabel);
  63. Plot(r2,"",colorRed,styleBar|styleNoRescale|styleNoLabel);
  64. Plot(s1,"",colorBlue,styleBar|styleNoRescale|styleNoLabel);
  65. Plot(r1,"",colorBlue,styleBar|styleNoRescale|styleNoLabel);
  66. _SECTION_END();
  67.  
  68. /* This next section calculates and plots the daily pivots using fibonacci ranges */
  69.  
  70. _SECTION_BEGIN("Daily Fib Pivots");
  71. Hi1 = IIf(Day()!=Ref(Day(),-1),Ref(HighestSince(Day()!=Ref(Day(),-1),H,1),-1),0);
  72. Hi = ValueWhen(Day()!=Ref(Day(),-1),Hi1,1);
  73. Lo1 = IIf(Day()!=Ref(Day(),-1),Ref(LowestSince(Day()!=Ref(Day(),-1),L,1),-1),0);
  74. Lo = ValueWhen(Day()!=Ref(Day(),-1),Lo1,1);
  75. Cl1 = IIf(Day()!=Ref(Day(),-1),Ref(C,-1),0);
  76. Cl = ValueWhen(Day()!=Ref(Day(),-1),Cl1,1);
  77.  
  78. rg = (Hi - Lo);
  79. bp = (Hi + Lo + Cl)/3;
  80. r1 = (bp*2)-Lo;
  81. s1 = (bp*2)-Hi;
  82. r2 = bp + rg;
  83. s2 = bp - rg;
  84. r2o = bp + (1.272*rg);
  85. s2o = bp - (1.272*rg);
  86. rh = bp + (0.5*rg);
  87. rl = bp - (0.5*rg);
  88. rh6 = bp + (0.618*rg);
  89. rl6 = bp - (0.618*rg);
  90.  
  91. Plot(s2,"",colorCustom12,styleBar|styleNoRescale|styleNoLabel);
  92. Plot(r2,"",colorCustom12,styleBar|styleNoRescale|styleNoLabel);
  93. Plot(rh,"",colorCustom12,styleBar|styleNoRescale|styleNoLabel);
  94. Plot(rl,"",colorCustom12,styleBar|styleNoRescale|styleNoLabel);
  95. Plot(bp,"",colorYellow,styleThick|styleNoRescale|styleNoLabel);
  96. Plot(rh6,"",colorWhite,styleBar|styleNoRescale|styleNoLabel);
  97. Plot(rl6,"",colorWhite,styleBar|styleNoRescale|styleNoLabel);
  98. Plot(r2o,"",colorWhite,styleBar|styleNoRescale|styleNoLabel);
  99. Plot(s2o,"",colorWhite,styleBar|styleNoRescale|styleNoLabel);
  100. Plot(s2o,"",colorBlack,styleArea|styleNoRescale|styleNoLabel);
  101. Plot(s2,"",colorPlum,styleArea|styleNoRescale|styleNoLabel);
  102. Plot(rl6,"",colorBlack,styleArea|styleNoRescale|styleNoLabel);
  103. Plot(rl,"",colorDarkOliveGreen,styleArea|styleNoRescale|styleNoLabel);
  104. Plot(rh,"",colorBlack,styleArea|styleNoRescale|styleNoLabel);
  105. Plot(rh6,"",colorDarkOliveGreen,styleArea|styleNoRescale|styleNoLabel);
  106. Plot(r2,"",colorBlack,styleArea|styleNoRescale|styleNoLabel);
  107. Plot(r2o,"",colorPlum,styleArea|styleNoRescale|styleNoLabel);
  108. _SECTION_END();
  109.  
  110. //--end----------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement