Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 709

 
Artyom Trishkin:

So, in order not to bother him, you have to gather all the items prepared for removal into a list in the right order (in whatever order you want), and remove them "by name" by looking at the list. That way, the correct order of deletion is sure to be respected.

can you tell me how?

 
Rustam Bikbulatov:

Can you tell me how?

Exactly the same way - go through all the open trades, select the right tickets in an array - here's your list.

 

A long-standing indicator. What prevents it from updating in real time?

ExtMapBuffer4, ExtMapBuffer3 are arrows, only appear on first start or after calling up settings.

int start()
  {
   int limit;
   int counted_bars=IndicatorCounted();
   double rsi_sig=0;
   bool entry=false;
   double entry_point=0;
   
   //---- 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;

   //---- main loop
   for(int i=0; i<limit; i++)
   {
     //---- ma_shift set to 0 because SetIndexShift called abowe
     ExtMapBuffer1[i]=iMA(NULL,0,FastEMA,0,MODE_EMA,PRICE_CLOSE,i);
     ExtMapBuffer2[i]=iMA(NULL,0,SlowEMA,0,MODE_EMA,PRICE_CLOSE,i);
     rsi_sig = iRSI(NULL, 0, RSIPeriod, PRICE_CLOSE, i);
     
     pipdiffCurrent=(ExtMapBuffer1[i]-ExtMapBuffer2[i]);

     Comment("pipdiffCurrent = "+pipdiffCurrent+" ");
     if (pipdiffCurrent>0 && rsi_sig>50) 
     {
       sigCurrent = 1;  //Up
     }
     else if (pipdiffCurrent<0 && rsi_sig<50)
     {
       sigCurrent = 2;  //Down
     }

     if (sigCurrent==1 && sigPrevious==2)
     {
        ExtMapBuffer4[i-1] = High[i-1]-5*Point;
  
        entry=true;
        entry_point=Ask;
     } 
     else if (sigCurrent==2 && sigPrevious==1)
     {
        ExtMapBuffer3[i-1] = Low[i-1]-5*Point;
       
        entry=true;
        entry_point=Bid;
     }
     sigPrevious=sigCurrent;
     pipdiffPrevious=pipdiffCurrent;
   }
RefreshRates();
//----
   return(0);
  }
 
Equity closures anyone?
 

Question - how do I remove the display of auxiliary buffers from the indicator window, as well as their drawing styles from the menu?

 
Виктор:

Question - how do I remove the display of auxiliary buffers from the indicator window, as well as their drawing styles from the menu?

It is possible to

0

02

 
Alekseu Fedotov:

You can do that.

I can do that too. :)

I delete buffer lines #property indicator_color, SetIndexStyle. But the menu displays the line colour as black.

If I removeSetIndexBuffer lines with unnecessary buffers, the variables dependent on the deleted ones are no longer displayed.

 
Виктор:

Question - how do I remove the display of auxiliary buffers from the indicator window, as well as their drawing styles from the menu?

Should their values be visible in the data window?

 
No. These are just auxiliary variables to calculate the main ones.
 
Виктор:
No. These are just auxiliary variables to calculate the main ones.
I have recently posted a template of cross-platform indicator here. Check it out.
IndicatorBuffers().
Reason: