SHARE
TWEET

fxsoni

a guest Mar 12th, 2019 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. #property indicator_chart_window
  3. #property indicator_buffers 6
  4. #property indicator_color1 Black
  5. #property indicator_color2 Black
  6. #property indicator_color3 White
  7. #property indicator_color4 White
  8. #property indicator_color5 Black
  9. #property indicator_color6 Black
  10. extern int tf=0;
  11. extern int g_period_76 = 3;
  12. extern int dev_long = 2;
  13. extern int dev_short =2;
  14. extern int sc_upper = 0;
  15. extern int sc_lower = 0;
  16. extern int appliedpriceupper = 0;
  17. extern int appliedpricelower = 0;
  18. extern double gd_84 = 1.0;
  19. extern int gi_92 = 1;
  20. extern int gi_96 = 1;
  21. extern int gi_100 = 5000;
  22. double g_ibuf_104[];
  23. double g_ibuf_108[];
  24. double g_ibuf_112[];
  25. double g_ibuf_116[];
  26. double g_ibuf_120[];
  27. double g_ibuf_124[];
  28. extern bool SoundON = true;
  29. bool gi_132 = TRUE;
  30. bool gi_136 = TRUE;
  31.  
  32. int init() {
  33.    SetIndexBuffer(0, g_ibuf_104);
  34.    SetIndexBuffer(1, g_ibuf_108);
  35.    SetIndexBuffer(2, g_ibuf_112);
  36.    SetIndexBuffer(3, g_ibuf_116);
  37.    SetIndexBuffer(4, g_ibuf_120);
  38.    SetIndexBuffer(5, g_ibuf_124);
  39.    SetIndexStyle(0, DRAW_NONE);
  40.    SetIndexStyle(1, DRAW_NONE, STYLE_SOLID, 0);
  41.    SetIndexStyle(2, DRAW_ARROW, STYLE_DASH, 3);
  42.    SetIndexStyle(3, DRAW_ARROW, STYLE_DASH, 3);
  43.    SetIndexStyle(4, DRAW_NONE);
  44.    SetIndexStyle(5, DRAW_NONE);
  45.    SetIndexArrow(0, 32);
  46.    SetIndexArrow(1, 32);
  47.    SetIndexArrow(2, SYMBOL_ARROWUP);
  48.    SetIndexArrow(3, SYMBOL_ARROWDOWN);
  49.    IndicatorDigits(MarketInfo(Symbol(), MODE_DIGITS));
  50.    string ls_0 = "FxSoni Entry";
  51.    IndicatorShortName(ls_0);
  52.    SetIndexLabel(0, "UpTrend Stop");
  53.    SetIndexLabel(1, "DownTrend Stop");
  54.    SetIndexLabel(2, "UpTrend Signal");
  55.    SetIndexLabel(3, "DownTrend Signal");
  56.    SetIndexLabel(4, "UpTrend Line");
  57.    SetIndexLabel(5, "DownTrend Line");
  58.    SetIndexDrawBegin(0, g_period_76);
  59.    SetIndexDrawBegin(1, g_period_76);
  60.    SetIndexDrawBegin(2, g_period_76);
  61.    SetIndexDrawBegin(3, g_period_76);
  62.    SetIndexDrawBegin(4, g_period_76);
  63.    SetIndexDrawBegin(5, g_period_76);
  64.    return (0);
  65. }
  66.  
  67. int start() {
  68.    int li_8;
  69.    double lda_12[25000];
  70.    double lda_16[25000];
  71.    double lda_20[25000];
  72.    double lda_24[25000];
  73.    for (int l_shift_4 = gi_100; l_shift_4 >= 0; l_shift_4--) {
  74.       g_ibuf_104[l_shift_4] = 0;
  75.       g_ibuf_108[l_shift_4] = 0;
  76.       g_ibuf_112[l_shift_4] = 0;
  77.       g_ibuf_116[l_shift_4] = 0;
  78.       g_ibuf_120[l_shift_4] = EMPTY_VALUE;
  79.       g_ibuf_124[l_shift_4] = EMPTY_VALUE;
  80.    }
  81.    for ( l_shift_4 = gi_100 - g_period_76 - 1; l_shift_4 >= 0; l_shift_4--) {
  82.       lda_12[l_shift_4] = iBands(NULL, tf, g_period_76, dev_long, sc_upper, appliedpriceupper, MODE_UPPER, l_shift_4);
  83.       lda_16[l_shift_4] = iBands(NULL, tf, g_period_76, dev_short, sc_lower, appliedpricelower, MODE_LOWER, l_shift_4);
  84.       if (Close[l_shift_4]> lda_12[l_shift_4 + 1]) li_8 = 1;
  85.       if (Close[l_shift_4] < lda_16[l_shift_4 + 1]) li_8 = -1;
  86.       if (li_8 > 0 && lda_16[l_shift_4] < lda_16[l_shift_4 + 1]) lda_16[l_shift_4] = lda_16[l_shift_4 + 1];
  87.       if (li_8 < 0 && lda_12[l_shift_4] > lda_12[l_shift_4 + 1]) lda_12[l_shift_4] = lda_12[l_shift_4 + 1];
  88.       lda_20[l_shift_4] = lda_12[l_shift_4] + (gd_84 - 1.0) / 2.0 * (lda_12[l_shift_4] - lda_16[l_shift_4]);
  89.       lda_24[l_shift_4] = lda_16[l_shift_4] - (gd_84 - 1.0) / 2.0 * (lda_12[l_shift_4] - lda_16[l_shift_4]);
  90.       if (li_8 > 0 && lda_24[l_shift_4] < lda_24[l_shift_4 + 1]) lda_24[l_shift_4] = lda_24[l_shift_4 + 1];
  91.       if (li_8 < 0 && lda_20[l_shift_4] > lda_20[l_shift_4 + 1]) lda_20[l_shift_4] = lda_20[l_shift_4 + 1];
  92.       if (li_8 > 0) {
  93.          if (gi_92 > 0 && g_ibuf_104[l_shift_4 + 1] == -1.0) {
  94.             g_ibuf_112[l_shift_4] = lda_24[l_shift_4];
  95.             g_ibuf_104[l_shift_4] = lda_24[l_shift_4];
  96.             if (gi_96 > 0) g_ibuf_120[l_shift_4] = lda_24[l_shift_4];
  97.             if (SoundON == TRUE && l_shift_4 == 0 && !gi_132) {
  98.                Alert("Buy Alert ", Symbol(), "-", Period());
  99.                gi_132 = TRUE;
  100.                gi_136 = FALSE;
  101.             }
  102.          } else {
  103.             g_ibuf_104[l_shift_4] = lda_24[l_shift_4];
  104.             if (gi_96 > 0) g_ibuf_120[l_shift_4] = lda_24[l_shift_4];
  105.             g_ibuf_112[l_shift_4] = -1;
  106.          }
  107.          if (gi_92 == 2) g_ibuf_104[l_shift_4] = 0;
  108.          g_ibuf_116[l_shift_4] = -1;
  109.          g_ibuf_108[l_shift_4] = -1.0;
  110.          g_ibuf_124[l_shift_4] = EMPTY_VALUE;
  111.       }
  112.       if (li_8 < 0) {
  113.          if (gi_92 > 0 && g_ibuf_108[l_shift_4 + 1] == -1.0) {
  114.             g_ibuf_116[l_shift_4] = lda_20[l_shift_4];
  115.             g_ibuf_108[l_shift_4] = lda_20[l_shift_4];
  116.             if (gi_96 > 0) g_ibuf_124[l_shift_4] = lda_20[l_shift_4];
  117.             if (SoundON == TRUE && l_shift_4 == 0 && !gi_136) {
  118.                Alert("Sell Alert ", Symbol(), "-", Period());
  119.                gi_136 = TRUE;
  120.                gi_132 = FALSE;
  121.             }
  122.          } else {
  123.             g_ibuf_108[l_shift_4] = lda_20[l_shift_4];
  124.             if (gi_96 > 0) g_ibuf_124[l_shift_4] = lda_20[l_shift_4];
  125.             g_ibuf_116[l_shift_4] = -1;
  126.          }
  127.          if (gi_92 == 2) g_ibuf_108[l_shift_4] = 0;
  128.          g_ibuf_112[l_shift_4] = -1;
  129.          g_ibuf_104[l_shift_4] = -1.0;
  130.          g_ibuf_120[l_shift_4] = EMPTY_VALUE;
  131.       }
  132.    }
  133.    
  134.    return (0);
  135. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top