[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 519

 
Again the question is unclear. Destroy from graph or don't count in EA? Disconnect by condition or ? Disconnect from where and with what?
A specific question will have a specific answer and quickly.
 
zhuki >>:
Опять вопрос непонятный. Уничтожить с графика или не считать в эксперте? Отключить по условию или ?. Отключить откуда и чем?
На конкретный вопрос будет конкретный ответ и быстро.

Once the pending orders have been placed, the indicator must be disabled. Do not count in the Expert Advisor.

 
You mean don't count in the expert So?
Make a beacon . Once the orders have been placed do not refer to the indicator.
 
How can I not? The indicator constantly sends data to an external file, the Expert Advisor reads this data, then places orders and reads the data again, it should not.
 
vlandex >>:
А как не обращаться? Данные индикатор выкидывает в внешний файл постоянно, эксперт считывает эти данные, потом выставляет ордера и опять считывает данные, а не должен.

use

OrdersTotal( )
 
Read more...
 
Now you know what to do.
Use a global variable. If there is one, the indicator does not count or write. And vice versa.
 
vlandex >>:
Подробнее...

Read your indicator when the condition is met

if(OrdersTotal()==0){read your indicator}

 
but please note that
int OrdersTotal( )
Returns the total number of open and pending orders.
 

Good evening all...

I tried to change OsMAindicator to get lines with Sift number of bar average (Sum of all positive and negative values of indicator for Sift bar divided by Sift)

But for some reason the readings of the lines do not want to dependon Siftvalue ...

//+------------------------------------------------------------------+
//|                                                         OsMA.mq4 |
//|                      Copyright © 2004, MetaQuotes Software Corp. |
//|                                       http://www.metaquotes.net/ |
//+------------------------------------------------------------------+
#property  copyright "Copyright © 2004, MetaQuotes Software Corp."
#property  link      "http://www.metaquotes.net/"
//---- indicator settings
#property  indicator_separate_window
#property  indicator_buffers 3
#property  indicator_color1  Silver
#property  indicator_color2  Red
#property  indicator_color3  ForestGreen
//---- indicator parameters
extern int FastEMA=12;
extern int SlowEMA=26;
extern int SignalSMA=9;
extern int Sift=20;
extern int Sift1=100;
//---- indicator buffers
double     ind_buffer1[];
double     ind_buffer2[];
double     ind_buffer3[];
double     ind_buffer4[];
double     ind_buffer5[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- 2 additional buffers are used for counting.
   IndicatorBuffers(3);
//---- drawing settings
   SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,3);
   SetIndexDrawBegin(0,SignalSMA);
   IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS)+2);
//---- 3 indicator buffers mapping
   if(!SetIndexBuffer(0,ind_buffer1) &&
      !SetIndexBuffer(1,ind_buffer2) &&
      !SetIndexBuffer(2,ind_buffer3))
      Print("cannot set indicator buffers!");
//---- name for DataWindow and indicator subwindow label
   IndicatorShortName("OsMA("+FastEMA+","+SlowEMA+","+SignalSMA+")");
//---- initialization done
   return(0);
  }
//+------------------------------------------------------------------+
//| Moving Average of Oscillator                                     |
//+------------------------------------------------------------------+
int start()
  {
   int limit;
   int counted_bars=IndicatorCounted();
//---- check for possible errors
   if(counted_bars<0) return(-1);
//---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;
//---- macd counted in the 1-st additional buffer
   for(int i=0; i<limit; i++)
      ind_buffer2[i]=iMA(NULL,0,FastEMA,0,MODE_EMA,PRICE_CLOSE,i)-iMA(NULL,0,SlowEMA,0,MODE_EMA,PRICE_CLOSE,i);
//---- signal line counted in the 2-nd additional buffer
   for(i=0; i<limit; i++)
      ind_buffer3[i]=iMAOnArray(ind_buffer2,Bars,SignalSMA,0,MODE_SMA,i);
//---- main loop
   for(i=0; i<limit; i++)
      ind_buffer1[i]=ind_buffer2[i]-ind_buffer3[i];
//---- done
   for(i=0; i<limit; i++)
      ind_buffer4[i]=(ind_buffer2[i]+ind_buffer3[i])/Sift;
//---------      
   for(i=0; i<limit; i++)
      ind_buffer5[i]=(ind_buffer2[i]+ind_buffer3[i])/Sift1;
//---------      
   return(0);
  }
//+------------------------------------------------------------------+