[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 202

 
silhouette:

I am writing an indicator that calculates the average daily range for a specified period. When attached to the chart, the chart is displayed normally:

But after receiving a new quote, the value changes dramatically.

What is the reason?


The problem is in this cycle

     for(n=i;n<=D1_Period+i;n++)
      {
        L_High=iHigh(NULL,PERIOD_D1,n);
        L_Low =iLow(NULL,PERIOD_D1,n);
        L_Range=(L_High-L_Low)/Point;
        Sum=Sum+L_Range;
        count++;         
      }
 

Hi all !!!

Please tell me if there is an EA which at the opening of the terminal pending order puts automatically the order in the other side with the predetermined parameters - 1. given distance in pips 2. lot size 3. type of order - stop or limit ???

P.S. - searched for it - could not find it.


HOWEVER, I will try to find the right order for you.

 
forget it... you don't have enough money for this system... really :-)
 
winner777:

Hi all !!!

Please tell me if there is an EA which at the opening of the terminal pending order puts automatically the order in the other side with the predetermined parameters - 1. given distance in pips 2. lot size 3. type of order - stop or limit ???

P.S. - searched for it - could not find it.


HOWEVER, I will try to find the right order for you.

Do the math yourself...

You write the specific terms of reference for the expa. You can't find it on your own...

If you don't know the language, go to the bugbear, otherwise dig the code base and edit the closest to your TOR exp exp. That's it.

 
Vinin:


The problem is in this cycle


Could you explain it in more detail?

Thank you.

 
Thank you !!!
 
silhouette:


Could you explain in more detail?

Thank you.


int start()
  {
   int Counted_Bars, i, n, count=0;
   double L_High, L_Low, L_Range, Sum=0, range;
//+------------------------------------------------------------------+
   Counted_Bars=IndicatorCounted();
   i=Bars-Counted_Bars-1;
   if(i>History-1)
      i=History-1;
   while(i>=0)
    {

     count=0;   // переменную надо инициализировать (обнулять)
     int pos=iBarShift(NULL,PERIOD_D1, Time[i]);
     for(n=pos+1;n<=D1_Period+pos;n++) // если текущий таймфрейм не дневки, то дальнейшие расчеты ересь
                                 // необходимо по времени бара с текущего таймфрейма найти нужный бар на дневках
      {
        L_High=iHigh(NULL,PERIOD_D1,n);
        L_Low =iLow(NULL,PERIOD_D1,n);
        L_Range=(L_High-L_Low)/Point;  // деление желательно делать один раз вне цикла (медленная операция)
        Sum=Sum+L_Range;
        count++;         
      }
     range=MathRound(Sum/count);  // необходимо проверить count на равенство нулю, иначе можно получить деление на ноль
     Buf_0[i]=range; 
     i--;
    }   
   return(0);
  }
 

Good afternoon!

Question about custom indicators.

The memory used for buffers is allocated through :

1. special parameter indicator_buffers

2. built-in IndicatorBuffers function

Please let me know how the special parameter with the similar function is IMPLIED?

It is not clear how this parameter complements the function...

 
Stepan2:

Good afternoon!

Question about custom indicators.

The memory used for buffers is allocated through :

1. special parameter indicator_buffers

2. built-in IndicatorBuffers function

Please let me know how the special parameter with the similar function is IMPLIED?

It's not clear how this parameter complements the function.

Indicator_buffers defines the number of buffers that are drawn on the screen.

IndicatorBuffers(***) defines the total number of indicator buffers (no more than 8), i.e. those that are drawn + those that are used for calculation only.

Naturally, indicator_buffers <= IndicatorBuffers(***) <= 8

 
Yeah, something's messed up about that.
Reason: