Advertisement
WKJ

WKJPlat

WKJ
Sep 26th, 2019
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.03 KB | None | 0 0
  1. #property copyright "wall.street.binary@gmail.com"
  2. #property link "secrets.wall.streer@gmail.com"
  3.  
  4. #property indicator_chart_window
  5. #property indicator_buffers 2
  6. #property indicator_color1 Red
  7. #property indicator_color2 Blue
  8.  
  9. extern int Risk = 3;
  10. extern double ArrowsGap = 1.0;
  11. double G_ibuf_88[];
  12. double G_ibuf_92[];
  13. double G_ibuf_96[];
  14. extern string note = "turn on Alert = true; turn off = false";
  15. extern bool alertsOn = true;
  16. input int TriggerCandle =1;
  17. input bool EnableNativeAlerts = true;
  18. input bool EnableEmailAlerts = true;
  19. input bool EnableSoundAlerts = true;
  20. input bool EnablePushAlerts =true;
  21. input string AlertEmailSubject =true;
  22. input string AlertText ="";
  23. input string SoundFileName ="alert.wav";
  24.  
  25. datetime LastAlertTime = D'01.01.1970';
  26. int LastAlertDirection = 0;
  27.  
  28. // E37F0136AA3FFAF149B351F6A4C948E9
  29. int init() {
  30. IndicatorBuffers(3);
  31. SetIndexBuffer(0, G_ibuf_88);
  32. SetIndexStyle(0, DRAW_ARROW);
  33. SetIndexArrow(0, 234);
  34. SetIndexBuffer(1, G_ibuf_92);
  35. SetIndexStyle(1, DRAW_ARROW);
  36. SetIndexArrow(1, 233);
  37. SetIndexBuffer(2, G_ibuf_96);
  38. return (0);
  39. }
  40.  
  41. // EA2B2676C28C0DB26D39331A336C6B92
  42. int start() {
  43. int period_28;
  44. double Ld_32;
  45. bool Li_44;
  46. bool Li_48;
  47. int Li_0 = IndicatorCounted();
  48. if (Li_0 < 0) return (-1);
  49. if (Li_0 > 0) Li_0--;
  50. int Li_4 = MathMin(Bars - Li_0, Bars - 1);
  51. double Ld_8 = Risk + 67.0;
  52. double Ld_16 = 33.0 - Risk;
  53. for (int Li_24 = Li_4; Li_24 >= 0; Li_24--) {
  54. period_28 = Risk * 2 + 3;
  55. Ld_32 = 0;
  56. for (int count_40 = 0; count_40 < 10; count_40++) Ld_32 += High[Li_24 + count_40] - (Low[Li_24 + count_40]);
  57. Ld_32 /= 10.0;
  58. Li_44 = FALSE;
  59. for (count_40 = 0; count_40 < 6 && !Li_44; count_40++) Li_44 = MathAbs(Open[Li_24 + count_40] - (Close[Li_24 + count_40 + 1])) >= 2.0 * Ld_32;
  60. Li_48 = FALSE;
  61. for (count_40 = 0; count_40 < 9 && !Li_48; count_40++) Li_48 = MathAbs(Close[Li_24 + count_40 + 3] - (Close[Li_24 + count_40])) >= 4.6 * Ld_32;
  62. if (Li_44) period_28 = 3;
  63. if (Li_48) period_28 = 4;
  64. G_ibuf_96[Li_24] = iWPR(NULL, 0, period_28, Li_24) + 100.0;
  65. G_ibuf_88[Li_24] = EMPTY_VALUE;
  66. G_ibuf_92[Li_24] = EMPTY_VALUE;
  67. if (G_ibuf_96[Li_24] < Ld_16) {
  68. for (count_40 = 1; Li_24 + count_40 < Bars && G_ibuf_96[Li_24 + count_40] >= Ld_16 && G_ibuf_96[Li_24 + count_40] <= Ld_8; count_40++) {
  69. }
  70. if (G_ibuf_96[Li_24 + count_40] > Ld_8) G_ibuf_88[Li_24] = High[Li_24] + Ld_32 * ArrowsGap;
  71. }
  72. if (G_ibuf_96[Li_24] > Ld_8) {
  73. for (count_40 = 1; Li_24 + count_40 < Bars && G_ibuf_96[Li_24 + count_40] >= Ld_16 && G_ibuf_96[Li_24 + count_40] <= Ld_8; count_40++) {
  74. }
  75. if (G_ibuf_96[Li_24 + count_40] < Ld_16) G_ibuf_92[Li_24] = Low[Li_24] - Ld_32 * ArrowsGap;
  76. }
  77.  
  78. }
  79. if (((TriggerCandle > 0) && (Time[0] > LastAlertTime)) || (TriggerCandle == 0))
  80. {
  81. string Text;
  82. // Up Arrow Alert
  83. if ((G_ibuf_88[TriggerCandle] > 0) && ((TriggerCandle > 0) || ((TriggerCandle == 0) && (LastAlertDirection != 1))))
  84. {
  85. Text = AlertText + "Platinum: " + Symbol() + " - " + EnumToString((ENUM_TIMEFRAMES)Period()) + " - Up.";
  86. if (EnableNativeAlerts) Alert(Text);
  87. if (EnableEmailAlerts) SendMail(AlertEmailSubject + "CCI Arrows Alert", Text);
  88. if (EnableSoundAlerts) PlaySound(SoundFileName);
  89. if (EnablePushAlerts) SendNotification(Text);
  90. LastAlertTime = Time[0];
  91. LastAlertDirection = 1;
  92. }
  93. // Down Arrow Alert
  94. if ((G_ibuf_92[TriggerCandle] > 0) && ((TriggerCandle > 0) || ((TriggerCandle == 0) && (LastAlertDirection != -1))))
  95. {
  96. Text = AlertText + "Platinum: " + Symbol() + " - " + EnumToString((ENUM_TIMEFRAMES)Period()) + " - Down.";
  97. if (EnableNativeAlerts) Alert(Text);
  98. if (EnableEmailAlerts) SendMail(AlertEmailSubject + "CCI Arrows Alert", Text);
  99. if (EnableSoundAlerts) PlaySound(SoundFileName);
  100. if (EnablePushAlerts) SendNotification(Text);
  101. LastAlertTime = Time[0];
  102. LastAlertDirection = -1;
  103. }
  104. }
  105.  
  106. return (0);
  107. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement