RenkoScalp

楼主  收藏   举报   帖子创建时间:  2019-05-05 05:06 回复:0 关注量:429
GBPUSDH1.png


  1. #property copyright "RenkoScalp_System"
  2. #property link      "wrt0306@gmail.com"

  3. #property indicator_chart_window
  4. #property indicator_buffers 4
  5. #property indicator_color1 DodgerBlue
  6. #property indicator_color2 OrangeRed
  7. #property indicator_color3 Lime
  8. #property indicator_color4 White

  9. extern int MA_Period = 3;
  10. extern int MA_Method = 2;
  11. extern int UseSignal = 1;
  12. extern int alertMode = 1;
  13. extern int WarningMode = 1;
  14. extern int UpArrowCode = 250;
  15. extern int DownArrowCode = 250;
  16. double G_ibuf_104[];
  17. double G_ibuf_108[];
  18. double G_ibuf_112[];
  19. double G_ibuf_116[];
  20. double G_ibuf_120[];
  21. double G_ibuf_124[];
  22. double G_ibuf_128[];
  23. int Gi_132 = 0;
  24. bool Gi_136 = FALSE;
  25. bool Gi_140 = FALSE;

  26. // E37F0136AA3FFAF149B351F6A4C948E9
  27. int init() {
  28.    string Ls_unused_0;
  29.    IndicatorBuffers(7);
  30.    SetIndexStyle(0, DRAW_LINE);
  31.    SetIndexStyle(1, DRAW_LINE);
  32.    SetIndexStyle(2, DRAW_ARROW);
  33.    SetIndexArrow(2, UpArrowCode);
  34.    SetIndexStyle(3, DRAW_ARROW);
  35.    SetIndexArrow(3, DownArrowCode);
  36.    IndicatorDigits(MarketInfo(Symbol(), MODE_DIGITS));
  37.    if (MA_Period < 2) MA_Period = 10;
  38.    int Li_8 = MA_Period - 1;
  39.    IndicatorShortName("RenkoScalp_Signal (" + MA_Period + ")");
  40.    SetIndexLabel(0, "UpTrendEnv");
  41.    SetIndexLabel(1, "DnTrendEnv");
  42.    SetIndexLabel(2, "UpSignal");
  43.    SetIndexLabel(3, "DnSignal");
  44.    SetIndexDrawBegin(0, Li_8);
  45.    SetIndexDrawBegin(1, Li_8);
  46.    SetIndexDrawBegin(2, Li_8);
  47.    SetIndexDrawBegin(3, Li_8);
  48.    SetIndexBuffer(0, G_ibuf_104);
  49.    SetIndexBuffer(1, G_ibuf_108);
  50.    SetIndexBuffer(2, G_ibuf_112);
  51.    SetIndexBuffer(3, G_ibuf_116);
  52.    SetIndexBuffer(4, G_ibuf_120);
  53.    SetIndexBuffer(5, G_ibuf_124);
  54.    SetIndexBuffer(6, G_ibuf_128);
  55.    return (0);
  56. }

  57. // EA2B2676C28C0DB26D39331A336C6B92
  58. int start() {
  59.    string Ls_0;
  60.    if (Bars <= MA_Period) return (0);
  61.    Gi_132 = IndicatorCounted();
  62.    if (Gi_132 < 0) return (-1);
  63.    if (Gi_132 > 0) Gi_132--;
  64.    int Li_8 = Bars - Gi_132;
  65.    for (int Li_12 = Li_8; Li_12 >= 0; Li_12--) {
  66.       G_ibuf_120[Li_12] = iMA(NULL, 0, MA_Period, 0, MA_Method, PRICE_HIGH, Li_12);
  67.       G_ibuf_124[Li_12] = iMA(NULL, 0, MA_Period, 0, MA_Method, PRICE_LOW, Li_12);
  68.       G_ibuf_128[Li_12] = G_ibuf_128[Li_12 + 1];
  69.       if (Close[Li_12] > G_ibuf_120[Li_12 + 1]) G_ibuf_128[Li_12] = 1;
  70.       if (Close[Li_12] < G_ibuf_124[Li_12 + 1]) G_ibuf_128[Li_12] = -1;
  71.       if (G_ibuf_128[Li_12] > 0.0) {
  72.          if (G_ibuf_124[Li_12] < G_ibuf_124[Li_12 + 1]) G_ibuf_124[Li_12] = G_ibuf_124[Li_12 + 1];
  73.          G_ibuf_104[Li_12] = G_ibuf_124[Li_12];
  74.          if (UseSignal > 0) {
  75.             if (G_ibuf_128[Li_12 + 1] < 0.0) {
  76.                G_ibuf_112[Li_12] = G_ibuf_124[Li_12];
  77.                if (WarningMode > 0 && Li_12 == 0) PlaySound("alert2.wav");
  78.             } else G_ibuf_112[Li_12] = EMPTY_VALUE;
  79.          }
  80.          G_ibuf_108[Li_12] = EMPTY_VALUE;
  81.          G_ibuf_116[Li_12] = EMPTY_VALUE;
  82.       } else {
  83.          if (G_ibuf_120[Li_12] > G_ibuf_120[Li_12 + 1]) G_ibuf_120[Li_12] = G_ibuf_120[Li_12 + 1];
  84.          G_ibuf_108[Li_12] = G_ibuf_120[Li_12];
  85.          if (UseSignal > 0) {
  86.             if (G_ibuf_128[Li_12 + 1] > 0.0) {
  87.                G_ibuf_116[Li_12] = G_ibuf_120[Li_12];
  88.                if (WarningMode > 0 && Li_12 == 0) PlaySound("alert2.wav");
  89.             } else G_ibuf_116[Li_12] = EMPTY_VALUE;
  90.          }
  91.          G_ibuf_104[Li_12] = EMPTY_VALUE;
  92.          G_ibuf_112[Li_12] = EMPTY_VALUE;
  93.       }
  94.    }
  95.    if (G_ibuf_128[2] < 0.0 && G_ibuf_128[1] > 0.0 && Volume[0] > 1.0 && (!Gi_136)) {
  96.       Ls_0 = " " + Symbol() + " M" + Period() + ":  -  Signal  /confirm/iED!!    -  BUY  - ";
  97.       if (alertMode > 0) alert(Ls_0);
  98.       Gi_136 = TRUE;
  99.       Gi_140 = FALSE;
  100.    }
  101.    if (G_ibuf_128[2] > 0.0 && G_ibuf_128[1] < 0.0 && Volume[0] > 1.0 && (!Gi_140)) {
  102.       Ls_0 = " " + Symbol() + " M" + Period() + ":  -  Signal  /confirm/iED!!    -  SELL  - ";
  103.       if (alertMode > 0) alert(Ls_0);
  104.       Gi_140 = TRUE;
  105.       Gi_136 = FALSE;
  106.    }
  107.    return (0);
  108. }
打赏