winner binary

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


  1. #property copyright "joker Inc.-joker"
  2. #property link      ""

  3. #property indicator_chart_window
  4. #property indicator_buffers 2
  5. #property indicator_color1 Blue
  6. #property indicator_color2 Red

  7. extern int NumBars = 500;
  8. double g_ibuf_80[];
  9. double g_ibuf_84[];
  10. double gd_88;

  11. int init() {
  12.    SetIndexStyle(0, DRAW_ARROW);
  13.    SetIndexBuffer(0, g_ibuf_80);
  14.    SetIndexArrow(0, 233);
  15.    SetIndexStyle(1, DRAW_ARROW);
  16.    SetIndexBuffer(1, g_ibuf_84);
  17.    SetIndexArrow(1, 234);
  18.    gd_88 = MarketInfo(Symbol(), MODE_SPREAD) * Point;
  19.    return (0);
  20. }

  21. int deinit() {
  22.    return (0);
  23. }

  24. int start() {
  25.    double lda_60[100];

  26.    int l_ind_counted_0 = IndicatorCounted();
  27.    int li_4 = 7;
  28.    double ld_8 = 7.0;
  29.    double ld_16 = 0.7;
  30.    int li_24 = 0;
  31.    int li_28 = 0;
  32.    bool li_32 = TRUE;
  33.    double ld_36 = 0;
  34.    double ld_44 = 0;
  35.    double ld_52 = 0;
  36.    int l_index_64 = 0;
  37.    double ld_68 = 0;
  38.    int l_index_76 = 0;
  39.    double ld_80 = 0;
  40.    double ld_unused_88 = 0;
  41.    double ld_96 = 0;
  42.    int li_104 = 0;
  43.    int li_108 = 0;
  44.    double l_iatr_112 = 0;
  45.    double ld_120 = 2;
  46.    double ld_unused_128 = 10;
  47.    double ld_136 = 0;
  48.    double ld_144 = 0;
  49.    double ld_unused_152 = 0;
  50.    double ld_unused_160 = 0;
  51.    double ld_unused_168 = 0;
  52.    double ld_unused_176 = 0;
  53.    double ld_unused_184 = 0;
  54.    double ld_unused_192 = 0;
  55.    double ld_unused_200 = 0;
  56.    double ld_unused_208 = 0;
  57.    double ld_unused_216 = 0;
  58.    double ld_unused_224 = 0;
  59.    double ld_unused_232 = 0;
  60.    double ld_unused_240 = 0;
  61.    double ld_unused_248 = 0;
  62.    double ld_unused_256 = 0;
  63.    double ld_unused_264 = 0;
  64.    double ld_unused_272 = 0;
  65.    double ld_unused_280 = 0;
  66.    double ld_unused_288 = 0;
  67.    double ld_unused_296 = 0;
  68.    double ld_unused_304 = 0;
  69.    double ld_unused_312 = 0;
  70.    double ld_unused_320 = 0;
  71.    double ld_unused_328 = 0;
  72.    if (Bars < NumBars) li_24 = Bars;
  73.    else li_24 = NumBars;
  74.    if (Close[li_24 - 2] > Close[li_24 - 1]) li_32 = TRUE;
  75.    else li_32 = FALSE;
  76.    ld_36 = Close[li_24 - 2];
  77.    for (li_28 = li_24 - 3; li_28 >= 0; li_28--) {
  78.       ld_52 = gd_88 + High[li_28] - Low[li_28];
  79.       if (MathAbs(gd_88 + High[li_28] - (Close[li_28 + 1])) > ld_52) ld_52 = MathAbs(gd_88 + High[li_28] - (Close[li_28 + 1]));
  80.       if (MathAbs(Low[li_28] - (Close[li_28 + 1])) > ld_52) ld_52 = MathAbs(Low[li_28] - (Close[li_28 + 1]));
  81.       if (li_28 == li_24 - 3) for (l_index_76 = 0; li_28 <= li_4 - 1; l_index_76++) lda_60[l_index_76] = ld_52;
  82.       lda_60[l_index_64] = ld_52;
  83.       ld_68 = 0;
  84.       ld_80 = li_4;
  85.       li_108 = l_index_64;
  86.       for (l_index_76 = 0; l_index_76 <= li_4 - 1; l_index_76++) {
  87.          ld_68 += lda_60[li_108] * ld_80;
  88.          ld_80 -= 1.0;
  89.          li_108--;
  90.          if (li_108 == -1) li_108 = li_4 - 1;
  91.       }
  92.       ld_68 = 2.0 * ld_68 / (ld_8 * (ld_8 + 1.0));
  93.       l_index_64++;
  94.       if (l_index_64 == li_4) l_index_64 = 0;
  95.       ld_44 = ld_16 * ld_68;
  96.       if (li_32 && Low[li_28] < ld_36 - ld_44) {
  97.          li_32 = FALSE;
  98.          ld_36 = gd_88 + High[li_28];
  99.       }
  100.       if (!li_32 && gd_88 + High[li_28] > ld_36 + ld_44) {
  101.          li_32 = TRUE;
  102.          ld_36 = Low[li_28];
  103.       }
  104.       if (li_32 && Low[li_28] > ld_36) ld_36 = Low[li_28];
  105.       if (!li_32 && gd_88 + High[li_28] < ld_36) ld_36 = gd_88 + High[li_28];
  106.       l_iatr_112 = iATR(NULL, 0, 10, li_28);
  107.       ld_136 = 0;
  108.       ld_144 = 0;
  109.       if (li_32) {
  110.          if (li_104 != 1) ld_96 = Low[li_28] - l_iatr_112 * ld_120 / 3.0;
  111.          if (li_104 == 1) ld_96 = -1.0;
  112.          if (ld_96 > 0.0) {
  113.             ld_136 = ld_96;
  114.             ld_144 = 0;
  115.          } else {
  116.             ld_136 = 0;
  117.             ld_144 = 0;
  118.          }
  119.          g_ibuf_80[li_28] = ld_136;
  120.          li_104 = 1;
  121.       } else {
  122.          if (li_104 != 2) ld_96 = gd_88 + High[li_28] + l_iatr_112 * ld_120 / 3.0;
  123.          if (li_104 == 2) ld_96 = -1.0;
  124.          if (ld_96 > 0.0) {
  125.             ld_136 = 0;
  126.             ld_144 = ld_96;
  127.          } else {
  128.             ld_136 = 0;
  129.             ld_144 = 0;
  130.          }
  131.          g_ibuf_84[li_28] = ld_144;
  132.          li_104 = 2;
  133.       }
  134.    }
  135.    return (0);
  136. }
打赏