10评论

0收藏

通道 DJ_Lines

avatar 梦丫头 | 1879 人阅读 | 10 人评论 | 2018-03-26

EURGBPM15.png

  1. //+------------------------------------------------------------------+
  2. //|                                                     DJ_Lines.mq4 |
  3. //|                       Copyright @2005, MetaQuotes Software Corp. |
  4. //+------------------------------------------------------------------+
  5. #property copyright "下载更多外汇EA,外汇指标,交易系统,就到【外汇EA之家】"
  6. #property link      "http://www.eazhijia.com"

  7. #property indicator_chart_window
  8. #property indicator_buffers 7
  9. #property indicator_color1 White
  10. #property indicator_color2 Red
  11. #property indicator_color3 Red
  12. #property indicator_color4 Yellow
  13. #property indicator_color5 Yellow
  14. #property indicator_color6 LimeGreen
  15. #property indicator_color7 LimeGreen

  16. extern int show_comment=1;
  17. extern int how_long=1000;

  18. double E2[];
  19. double ff[];
  20. double E4[];
  21. double E5[];
  22. double E6[];
  23. double E7[];
  24. double E8[];
  25. //+------------------------------------------------------------------+
  26. //| Custom indicator initialization function |
  27. //+------------------------------------------------------------------+
  28. int OnInit(void)
  29. {
  30. SetIndexBuffer(0, E2);
  31. SetIndexBuffer(1, ff);
  32. SetIndexBuffer(2, E4);
  33. SetIndexBuffer(3, E5);
  34. SetIndexBuffer(4, E6);
  35. SetIndexBuffer(5, E7);
  36. SetIndexBuffer(6, E8);

  37. SetIndexStyle(0, DRAW_LINE,1,2);
  38. SetIndexStyle(1, DRAW_LINE);
  39. SetIndexStyle(2, DRAW_LINE);
  40. SetIndexStyle(3, DRAW_LINE);
  41. SetIndexStyle(4, DRAW_LINE);
  42. SetIndexStyle(5, DRAW_LINE);
  43. SetIndexStyle(6, DRAW_LINE);
  44. Comment("www.eazhijia.com");
  45. return(INIT_SUCCEEDED);
  46. }

  47. //+------------------------------------------------------------------+
  48. //| Custom indicator iteration function                              |
  49. //+------------------------------------------------------------------+
  50. int OnCalculate(const int rates_total,
  51.                 const int prev_calculated,
  52.                 const datetime &time[],
  53.                 const double &open[],
  54.                 const double &high[],
  55.                 const double &low[],
  56.                 const double &close[],
  57.                 const long &tick_volume[],
  58.                 const long &volume[],
  59.                 const int &spread[])
  60. {
  61. int cnt=0;
  62. int begin_bar=0;
  63. int prev_day, cur_day;
  64. double day_high=0;
  65. double day_low=0;
  66. double yesterday_high=0;
  67. double yesterday_low=0;
  68. double yesterday_close=0;
  69. double P, S, R, P1, P2, P3, C1, C2, C3;

  70. if (Period() >= PERIOD_D1) {
  71. Comment("WARNING: Invalid timeframe! Valid value < D1.");
  72. return(0);
  73. }

  74. if (how_long == -1) {
  75. begin_bar = Bars;
  76. } else {
  77. begin_bar = how_long;
  78. }

  79. for (cnt = begin_bar; cnt >= 0; cnt--) {
  80. cur_day = TimeDay(Time[cnt]);
  81. if (prev_day != cur_day) {
  82. yesterday_close = Close[cnt+1];
  83. yesterday_high = day_high;
  84. yesterday_low = day_low;
  85. P = (yesterday_high + yesterday_low + yesterday_close) / 3;
  86. R = yesterday_high;
  87. S = yesterday_low;
  88. P1 = 2 * P - S;
  89. C1 = 2 * P - R;
  90. P2 = P + (P1 - C1);
  91. C2 = P - (P1 - C1);
  92. P3 = R + (2 * (P - S));
  93. C3 = S - (2 * (R - P));

  94. day_high = High[cnt];
  95. day_low = Low[cnt];

  96. prev_day = cur_day;
  97. }

  98. day_high = MathMax(day_high, High[cnt]);
  99. day_low = MathMin(day_low, Low[cnt]);

  100. E2[cnt] = P;
  101. ff[cnt] = P1;
  102. E4[cnt] = C1;
  103. E5[cnt] = P2;
  104. E6[cnt] = C2;
  105. E7[cnt] = P3;
  106. E8[cnt] = C3;
  107. }

  108. if (show_comment == 1) {
  109. P = (yesterday_high + yesterday_low + yesterday_close) / 3;
  110. R = yesterday_high;
  111. S = yesterday_low;
  112. P1 = 2 * P - S;
  113. C1 = 2 * P - R;
  114. P2 = P + (P1 - C1);
  115. C2 = P - (P1 - C1);
  116. P3 = R + (2 * (P - S));
  117. C3 = S - (2 * (R - P));
  118. Comment("Current H=", R, ", L=", S, ", HL?3=", P, " C2=", C2, ", H-L=", (R-S)/Point );
  119. }
  120. return(rates_total);
  121. }
  122. //+-----------------------------------------------------------------
复制代码


DJ_Lines.mq4
""
还没有人打赏,支持一下

评论|共 10 个

心心

发表于 2020-6-22 14:10:48 | 显示全部楼层

支持一下:lol

改变

发表于 2020-6-29 18:10:07 | 显示全部楼层

前排支持下分享

暧昧

发表于 2020-8-12 11:28:29 | 显示全部楼层

学习了,不错

owilq

发表于 2020-8-28 16:06:43 | 显示全部楼层

学习了,不错

孟宪娇

发表于 2021-7-3 20:42:31 | 显示全部楼层

跟单系统出售

发表于 2021-7-4 17:31:56 | 显示全部楼层

顶下

wang_guoji

发表于 2021-7-16 21:36:20 | 显示全部楼层

顶下

巅峰八零

发表于 2021-7-19 10:00:11 | 显示全部楼层

hghgv

发表于 2021-7-20 10:52:10 | 显示全部楼层

12下一页
您需要登录后才可以回帖 登录 | 注册 微信登录

EA之家评论守则