Help out anyone who cares!

 

how to insert a simple indictor into expert code ? to take its readings from n4 ( put it in the code and not call it via icustom )...third day I'm struggling...

the indy itself :

#property copyright "Krokus"
#property link      ""
//----
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Red
//----
extern int       N=20; // период канала 
//---- buffers
double ExtMapBuffer1[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,ExtMapBuffer1);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
   int limit;
   double upPrice,downPrice;
//---- 
   if (counted_bars==0) limit=Bars-N;
   if (counted_bars>=0) limit=Bars-counted_bars;
   limit--;
   for(int i=limit;i>=0;i--)
     {
      upPrice=High[iHighest(Symbol(),0,MODE_HIGH,N,i)];//максимум за N баров 
      downPrice=Low[iLowest(Symbol(),0,MODE_LOW,N,i)]; //минимум за N баров 
      ExtMapBuffer1[i]=(upPrice-downPrice)/Point;

     }
//---- 
   return(0);
  }
//+------------------------------------------------------
 
      upPrice=High[iHighest(Symbol(),0,MODE_HIGH,N,0)];//максимум за N баров 
      downPrice=Low[iLowest(Symbol(),0,MODE_LOW,N,0)]; //минимум за N баров 
      значение индикатора=(upPrice-downPrice)/Point;
 
sllawa3 >>:

как вставить простенький индюк в код эксперта ? чтоб снимались показания его с н4 ( вписать в код а не вызвать через icustom )...третий день бьюсь..

сам индюк :

implement the indicator as a function, in the function parameters parameters of this indicator and the number of bar for which you want to calculate the value of the indicator
 
Integer >>:

it doesn't work and it won't work... it's just illiterate to put in these lines alone...
 
sanyooooook >>:
реализуй индикатор как функцию, в параметрах функции параметры этого индикатора и номер бара для которого нужно рассчитать значение индикатора

I'm trying to figure out how to do it... I'm trying to get it to give the value of n4 on any timeframe (or the one I prescribed in the settings)
 
sllawa3 >>:

вот и мучаюсь как это сделать... тем более чтоб на любом тф давал значение н4 ( или же прописанного в настройках )

don't get bogged down with politics (use of indulgences), write everything in EA.

 
Replace High[] with iHigh() and Low[] with iLow() with your desired TF
 
  double Fn(int N,int bar)
  {
     double upPrice,downPrice;
     upPrice=High[iHighest(Symbol(),0,MODE_HIGH,N,bar)];//максимум за N баров 
     downPrice=Low[iLowest(Symbol(),0,MODE_LOW,N,bar)]; //минимум за N баров 
     return((upPrice-downPrice)/Point);
  }
it will be for the current TF
 
No... it's all crap... it doesn't work... none of the proposed options... it only works through icustom, which is exactly what you need to get rid of...
 
sllawa3 >>:
нет.. всё это лажа.. не работает...ни один из предложенных вариантов.. работает ток через icustom, а как раз от него и необходимо избавиться...

I'm telling you - the turkeys are a bummer... If not now, then later. Besides, you won't be able to debug them in the tester. What do you need?

 
Andrei01 >>:

говорю тебе - индюки это облом полный... если не щас то дальше обязательно. к тому же отлаживать их в тестере не сможешь. оно тебе надо?


VERY NECESSARY
Reason: