Coding help - page 671

 
mntiwana:
so what next,when to stop/close.
Whenever a certain amount of pips are reached.
 
i found this indicator on this site and i found it useful pls can you help me make an EA of it and make it trade immdiately when the arrow appear and close it the close of the next candle meaning it will trade just two candle and it should close if opposite arrow appear. pls
Files:
 

dotmund:
i found this indicator on this site and i found it useful pls can you help me make an EA of it and make it trade immdiately when the arrow appear and close it the close of the next candle meaning it will trade just two candle and it should close if opposite arrow appear

i will be happy also if u can also help me make a binary EA OF THAT INDICATOR 

 
dotmund:

BO is not something I am doing so someone else will have to help you regarding that

As far as the rest is concerned : it is already doing those things

 
mladen:

BO is not something I am doing so someone else will have to help you regarding that

As far as the rest is concerned : it is already doing those things

IF U CAN HELP WITH THE BO CAN YOU JUST HELP WITH THE FOREX EA ON THAT INDICATOR
 
dotmund:
IF U CAN HELP WITH THE BO CAN YOU JUST HELP WITH THE FOREX EA ON THAT INDICATOR
As I told : it does what was requested (including closing on a next bar)
 

Hello,

 

This post would probably put me in bad light looking somehow like a noob, but either way Im experimenting and trading allot with bollinger bands and came across the BB_STOP indicator.

 

The indicator paints the lower band if the price is moving up and braking the upper bands, it paints the upper band when price has broken the lower band.

 

Im trying to use icustom in an ea experiment, and i do simply want to know if the last break was to the upside or to the downside but I cannot figure out what buffer to use or what i should set it equal to.

 

For instance i have done same with some MA indicators from TDS where the itrend buffer is equal to 1 for up and -1 for down.

 

hope im clear enough, thank you very much

 

#property copyright "Copyright © 2006, TrendLaboratory Ltd."
#property link      "http://finance.groups.yahoo.com/group/TrendLaboratory"

#property indicator_chart_window
#property indicator_buffers 6
#property indicator_color1 CLR_NONE
#property indicator_color2 CLR_NONE
#property indicator_color3 Yellow
#property indicator_color4 Yellow
#property indicator_color5 CLR_NONE
#property indicator_color6 CLR_NONE

extern int Length = 14;
extern int Deviation = 2;
extern double MoneyRisk = 1.0;
extern int Signal = 2;
extern int Line = 1;
extern int Nbars = 500;
double g_ibuf_104[];
double g_ibuf_108[];
double g_ibuf_112[];
double g_ibuf_116[];
double g_ibuf_120[];
double g_ibuf_124[];
extern bool SoundON = FALSE;
bool gi_132 = FALSE;
bool gi_136 = FALSE;

int init() {
   SetIndexBuffer(0, g_ibuf_104);
   SetIndexBuffer(1, g_ibuf_108);
   SetIndexBuffer(2, g_ibuf_112);
   SetIndexBuffer(3, g_ibuf_116);
   SetIndexBuffer(4, g_ibuf_120);
   SetIndexBuffer(5, g_ibuf_124);
   SetIndexStyle(0, DRAW_ARROW, STYLE_SOLID, 1);
   SetIndexStyle(1, DRAW_ARROW, STYLE_SOLID, 1);
   SetIndexStyle(2, DRAW_ARROW, STYLE_SOLID, 0);
   SetIndexStyle(3, DRAW_ARROW, STYLE_SOLID, 0);
   SetIndexStyle(4, DRAW_LINE);
   SetIndexStyle(5, DRAW_LINE);
   SetIndexArrow(0, 159);
   SetIndexArrow(1, 159);
   SetIndexArrow(2, 233);
   SetIndexArrow(3, 234);
   IndicatorDigits(MarketInfo(Symbol(), MODE_DIGITS));
   string ls_0 = "BBands Stop(" + Length + "," + Deviation + ")";
   IndicatorShortName(ls_0);
   SetIndexLabel(0, "UpTrend Stop");
   SetIndexLabel(1, "DownTrend Stop");
   SetIndexLabel(2, "UpTrend Signal");
   SetIndexLabel(3, "DownTrend Signal");
   SetIndexLabel(4, "UpTrend Line");
   SetIndexLabel(5, "DownTrend Line");
   SetIndexDrawBegin(0, Length);
   SetIndexDrawBegin(1, Length);
   SetIndexDrawBegin(2, Length);
   SetIndexDrawBegin(3, Length);
   SetIndexDrawBegin(4, Length);
   SetIndexDrawBegin(5, Length);
   return (0);
}

int start() {
   int li_8;
   double lda_12[25000];
   double lda_16[25000];
   double lda_20[25000];
   double lda_24[25000];
   for (int l_shift_4 = Nbars; l_shift_4 >= 0; l_shift_4--) {
      g_ibuf_104[l_shift_4] = 0;
      g_ibuf_108[l_shift_4] = 0;
      g_ibuf_112[l_shift_4] = 0;
      g_ibuf_116[l_shift_4] = 0;
      g_ibuf_120[l_shift_4] = EMPTY_VALUE;
      g_ibuf_124[l_shift_4] = EMPTY_VALUE;
   }
   for (l_shift_4 = Nbars - Length - 1; l_shift_4 >= 0; l_shift_4--) {
      lda_12[l_shift_4] = iBands(NULL, 0, Length, Deviation, 0, PRICE_CLOSE, MODE_UPPER, l_shift_4);
      lda_16[l_shift_4] = iBands(NULL, 0, Length, Deviation, 0, PRICE_CLOSE, MODE_LOWER, l_shift_4);
      if (Close[l_shift_4] > lda_12[l_shift_4 + 1]) li_8 = 1;
      if (Close[l_shift_4] < lda_16[l_shift_4 + 1]) li_8 = -1;
      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];
      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];
      lda_20[l_shift_4] = lda_12[l_shift_4] + (MoneyRisk - 1.0) / 2.0 * (lda_12[l_shift_4] - lda_16[l_shift_4]);
      lda_24[l_shift_4] = lda_16[l_shift_4] - (MoneyRisk - 1.0) / 2.0 * (lda_12[l_shift_4] - lda_16[l_shift_4]);
      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];
      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];
      if (li_8 > 0) {
         if (Signal > 0 && g_ibuf_104[l_shift_4 + 1] == -1.0) {
            g_ibuf_112[l_shift_4] = lda_24[l_shift_4];
            g_ibuf_104[l_shift_4] = lda_24[l_shift_4];
            if (Line > 0) g_ibuf_120[l_shift_4] = lda_24[l_shift_4];
            if (SoundON == TRUE && l_shift_4 == 0 && !gi_132) {
               Alert("BBands going Up on ", Symbol(), "-", Period());
               gi_132 = TRUE;
               gi_136 = FALSE;
            }
         } else {
            g_ibuf_104[l_shift_4] = lda_24[l_shift_4];
            if (Line > 0) g_ibuf_120[l_shift_4] = lda_24[l_shift_4];
            g_ibuf_112[l_shift_4] = -1;
         }
         if (Signal == 2) g_ibuf_104[l_shift_4] = 0;
         g_ibuf_116[l_shift_4] = -1;
         g_ibuf_108[l_shift_4] = -1.0;
         g_ibuf_124[l_shift_4] = EMPTY_VALUE;
      }
      if (li_8 < 0) {
         if (Signal > 0 && g_ibuf_108[l_shift_4 + 1] == -1.0) {
            g_ibuf_116[l_shift_4] = lda_20[l_shift_4];
            g_ibuf_108[l_shift_4] = lda_20[l_shift_4];
            if (Line > 0) g_ibuf_124[l_shift_4] = lda_20[l_shift_4];
            if (SoundON == TRUE && l_shift_4 == 0 && !gi_136) {
               Alert("BBands going Down on ", Symbol(), "-", Period());
               gi_136 = TRUE;
               gi_132 = FALSE;
            }
         } else {
            g_ibuf_108[l_shift_4] = lda_20[l_shift_4];
            if (Line > 0) g_ibuf_124[l_shift_4] = lda_20[l_shift_4];
            g_ibuf_116[l_shift_4] = -1;
         }
         if (Signal == 2) g_ibuf_108[l_shift_4] = 0;
         g_ibuf_112[l_shift_4] = -1;
         g_ibuf_104[l_shift_4] = -1.0;
         g_ibuf_120[l_shift_4] = EMPTY_VALUE;
      }
   }
   return (0);
}
 

Mr Mladen , i want to double confirm with you .

In this this code

if(OrderMagicNumber()!=_MagicNumber) continue;

It that mean " ! " is not equals and the program can "continue "?

Example : only find the magic number match up ?

 
stevenpun:

Mr Mladen , i want to double confirm with you .

In this this code

It that mean " ! " is not equals and the program can "continue "?

Example : only find the magic number match up ?

Yes and yes :)
 
NWFstudent:

Hello,

 

This post would probably put me in bad light looking somehow like a noob, but either way Im experimenting and trading allot with bollinger bands and came across the BB_STOP indicator.

 

The indicator paints the lower band if the price is moving up and braking the upper bands, it paints the upper band when price has broken the lower band.

 

Im trying to use icustom in an ea experiment, and i do simply want to know if the last break was to the upside or to the downside but I cannot figure out what buffer to use or what i should set it equal to.

 

For instance i have done same with some MA indicators from TDS where the itrend buffer is equal to 1 for up and -1 for down.

 

hope im clear enough, thank you very much

 

NWFstudent

Why don't you use original source code for start (bb stop indicator was always for free, no need to use decompiled version, and it is much easier to work with original code)

Reason: