I dont Found SomeThing In this Indicator ? Important

 

Hello

i Found This Indicator Created By Serhii Ivanenko

//+------------------------------------------------------------------+
//|                                               RenkoLineBreak.mq5 |
//|                                            Copyright 2013, Rone. |
//|                                            rone.sergey@gmail.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2013, Rone."
#property link      "rone.sergey@gmail.com"
#property version   "1.00"
#property description "It is a hybrid of Renko and Three Line Break indicators. Built on the "
#property description "close prices of current Time Frame, the box size must be equal or larger than the specified."
//--- indicator settings
#property indicator_chart_window
#property indicator_buffers 3
#property indicator_plots   3
//--- plot Upper
#property indicator_label1  "Upper"
#property indicator_type1   DRAW_LINE
#property indicator_color1  clrRoyalBlue
#property indicator_style1  STYLE_SOLID
#property indicator_width1  2
//--- plot Lower
#property indicator_label2  "Lower"
#property indicator_type2   DRAW_LINE
#property indicator_color2  clrCrimson
#property indicator_style2  STYLE_SOLID
#property indicator_width2  2
//--- plot Boxes
#property indicator_label3  "Boxes"
#property indicator_type3   DRAW_NONE
#property indicator_color3  clrNONE
#property indicator_style3  STYLE_SOLID
#property indicator_width3  1
//--- input parameters
input int      InpMinBoxSize = 300;    // Min Box Size
//--- indicator buffers
double         UpperBuffer[];
double         LowerBuffer[];
double         BoxesBuffer[];
//---
double         box_size;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit() {
//---
   if ( InpMinBoxSize < 0 ) {
      box_size = 300;
      printf("Incorrected input value InpMinBoxSize = %d. Indicator will use value %d", 
         InpMinBoxSize, (int)box_size);
   } else {
      box_size = InpMinBoxSize;
   }
//--- indicator buffers mapping
   SetIndexBuffer(0,UpperBuffer,INDICATOR_DATA);
   SetIndexBuffer(1,LowerBuffer,INDICATOR_DATA);
   SetIndexBuffer(2,BoxesBuffer,INDICATOR_DATA);
//---
   for ( int plot = 0; plot < 3; plot++ ) {
      PlotIndexSetInteger(plot, PLOT_DRAW_BEGIN, 1);
      PlotIndexSetInteger(plot, PLOT_SHIFT, 0);
      PlotIndexSetDouble(plot, PLOT_EMPTY_VALUE, 0.0);
   }
//---
   IndicatorSetInteger(INDICATOR_DIGITS, _Digits);
   IndicatorSetString(INDICATOR_SHORTNAME, "Renko Line Break ("
      +DoubleToString(box_size, 0)+")");
   box_size *= _Point;
//---
   return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const int begin,
                const double &price[])
{
//---
   int start_bar;
   bool up;
   static bool _up;
//---
   if ( prev_calculated > rates_total || prev_calculated <= 0 ) {
      for ( start_bar = 0; MathAbs(price[0]-price[start_bar]) < box_size; start_bar++ ) {}
      if ( price[start_bar] > price[0] ) {
         UpperBuffer[start_bar] = price[start_bar];
         LowerBuffer[start_bar] = price[0];
         BoxesBuffer[start_bar] = 1.0;
         _up = true;
      } else {
         UpperBuffer[start_bar] = price[0];
         LowerBuffer[start_bar] = price[start_bar];
         BoxesBuffer[start_bar] = -1.0;
         _up = false;
      }
      start_bar += 1;
      for ( int plot = 0; plot < 3; plot++ ) {
         PlotIndexSetInteger(0, PLOT_DRAW_BEGIN, start_bar);
      }
   } else {
      start_bar = prev_calculated - 1;
   }
//---
   up = _up;
//---
   for ( int bar = start_bar; bar < rates_total; bar++ ) {
      double prev_up = UpperBuffer[bar-1];
      double prev_dn = LowerBuffer[bar-1];
      double prev_boxes = BoxesBuffer[bar-1];
      
      if ( price[bar] >= prev_up + box_size ) {
         UpperBuffer[bar] = price[bar];
         LowerBuffer[bar] = prev_up;
         if ( up ) {
            BoxesBuffer[bar] = prev_boxes + 1;   
         } else {
            up = true;
            BoxesBuffer[bar] = 1.0;
         }
      } else if ( price[bar] <= prev_dn - box_size ) {
         UpperBuffer[bar] = prev_dn;
         LowerBuffer[bar] = price[bar];
         if ( up ) {
            up = false;
            BoxesBuffer[bar] = -1;
         } else {
            BoxesBuffer[bar] = prev_boxes - 1;
         }
      } else {
         UpperBuffer[bar] = prev_up;
         LowerBuffer[bar] = prev_dn;
         BoxesBuffer[bar] = prev_boxes;
      }
      
      if ( bar < rates_total - 1 ) {
         _up = up;
      }
   }
//--- return value of prev_calculated for next call
   return(rates_total);
}
//+------------------------------------------------------------------+

when i use it i found this option in setting

when i search in this code i cant found where this option if i want change it direct by code not by change setting

So , how i can found it in this option to can change it direct like i want open or else not close

how i do that ?

thank you

Files:
 
Click "New" on the meta editor's toolbar to start to create the indicator.

On the third panel, select "OnCalculate (...., prices)".



 

I dont understand

and why i create new projects

the code its you see it above

what in this code change it until take what i want ?

thank you

 

It only changes the header part of the function.

int OnCalculate(const int rates_total,
                const int prev_calculated,
                const int begin,
                const double &price[])

Don't double post. Delete another one.

 
Naguisa Unada:

It only changes the header part of the function.

Don't double post. Delete another one.

Ok what i change here if i want show me direct open not Close ??

And i delete anther post :)

 
Ahmed Ahmed Elnagdy:

Ok what i change here if i want show me direct open not Close ??

What? I do not understand well the meaning of your question.

The setting panel always opens. I think that you can not enter the program without opening it.

 
Naguisa Unada:

What? I do not understand well the meaning of your question.

The setting panel always opens. I think that you can not enter the program without opening it.

look above in my image you will see if i enter on this option show me list to choose what i want ?

if i dont enter on this option will be choose ( Close ) this default setting

So , I want this Default Not be ( Close ) I want To be ( open )

what i change in this Code until be that ?

 
 
Mladen Rakic:
#property indicator_applied_price PRICE_OPEN
Ok Thank you I found How Use It :)
 
Mladen Rakic:
#property indicator_applied_price PRICE_OPEN

ITS dont work

when i write this code and when connect this indicator with my projects EA , ea work and show me indicator close not open this mean must change that from code not add new code

 
Ahmed Ahmed Elnagdy:

ITS dont work

when i write this code and when connect this indicator with my projects EA , ea work and show me indicator close not open this mean must change that from code not add new code

What Mladen wrote is correct.

Did you insert it in the correct position?

For example, it should be put in the next line of "# property indicator_plots 3" in the above program.