Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 533

 
evillive:

ObjectFind(0, "EXPERT STOPED !!!");

ObjectFind is just what I need, thanks!
 
Can you please tell me how to bring back the old navigator in the metaeditor? In the old one at the bottom there were files-vocabulary-search tabs, I always kept the search and that's how I searched for what I needed (for example I forgot how to use a function, I wrote it there or part of it and everything came up with that function), in the new one there are no such tabs, and it constantly sends me to mql4|mql5.ru, which is extremely inconvenient for me.
 
Skydiver:
Can you please tell me how to get the old navigator back in the metaeditor? In the old one at the bottom there were tabs files-vocabulary-search, I always kept the search and that's how I searched for what I needed (for example forgot how to use a function, I wrote it there or part of it and everything came up with that function), in the new one there are no such tabs, and it constantly returns to mql4|mql5.ru, and this is extremely inconvenient for me.

What do you mean there's no search???

 
evillive:

All this is easily made to order in the department Work. And if you look around the kodobase, you can find something similar and build yourself whatever you need, but it often needs a fine-tuning with a file.

I found something similar, only in indicators, but I haven't found any tracing of intersections of TP and SL yet.
 
AlexeyVik:

What do you mean, there's no search?



How could it not be done directly in the meta-editor before? (sorry, I can't put a picture in) There was a search in the navigator, and then select the desired function or something, and the toolbar would open at the bottom (or where else from the settings), with a help tab in it.
 
Skydiver:

How was it not possible before directly in the meta-editor? (sorry, I can't insert a picture, the Internet is bad) There was a search in the navigator, and after you select the desired function or something else, and it opened below (or where else from the settings) toolbar, in it the tab-help.

It's a good thing the internet is bad. Why do I need this picture? I have a good memory, and I have an old compiler on my computer, I can look it up. I thought you said there was no "search" tab.

Just do as before, step on the name of the function or other reserved word and press the magic F1 key.

 

How do I make the cycle run once when a new position is opened?

   if(OpenOrders>1 )
   for(cnt=0;cnt<OpenOrders;cnt++)   // scan all orders and positions. ..
   {
     OrderSelect(cnt, SELECT_BY_POS);
          if ( (OrderType() == OP_BUY || OrderType() == OP_SELL))
          {     
          if(cnt == OpenOrders-1 )                      
                  FirstOpenTime = OrderOpenTime() ;
                  
                          if(cnt == OpenOrders-2)                       
                  SecondOpenTime = OrderOpenTime() ;
          }

   }
 

I have set the goal to make an indicator. The essence is the following: if a muving grows against the previous value, we get the difference between these values and add to the difference at the subsequent growth and so on. At a certain interval (five days in this case). Suppose we have three days with one, three and four points growth, it means that current indicator value is 8 points. But the bullshit is that everything is cumulative.

How can I reset old values without taking them into account?

#property indicator_separate_window
#property indicator_buffers 1
#property  indicator_color1 Lime
//--- input parameters
extern int       Period_MA_1=21;
//--- buffers
double ExtMapBuffer1[];
extern int p=5;
double val[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_HISTOGRAM);
   SetIndexBuffer(0,ExtMapBuffer1);
   IndicatorDigits(Digits+1);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
    int counted_bars=IndicatorCounted(),                      
    limit;
    double
    MA_1_t;
   if(counted_bars>0)
      counted_bars--;
   limit=Bars-counted_bars;
   ArrayInitialize(val,0);
   ArrayResize(val,p);
   for(int i=0;i<limit;i++)
   {
      for(int k=p;k>=0;k--)
        {
        double indicator_minus,indicator_plus;
        val[k]=iMA(NULL,0,21,0,MODE_EMA,PRICE_CLOSE,i+k) - iMA(NULL,0,21,0,MODE_EMA,PRICE_CLOSE,i+(k+1));
        if (val[k] > 0){indicator_plus=indicator_plus+val[k];}
        }
        ExtMapBuffer1[i]=indicator_plus;
   }
   return(0);
  }
//+------------------------------------------------------------------+
 
Forexman77:

I have set the goal to make an indicator. The essence is the following: if a muving grows against the previous value, we get the difference between these values and add to the difference at the subsequent growth and so on. At a certain interval (five days in this case). Suppose we have three days with one, three and four points growth, it means that current indicator value is 8 points. But the bullshit is that everything is cumulative.

How can I reset old values without taking them into account?


Maybe this would help.
 
AlexeyVik:

Use this https://docs.mql4.com/ru/indicators/imaonarray

Please look at the code, is this correct ?

//+------------------------------------------------------------------+
//|Определяем, можно ли торговать исходя из волатильности            |
//+------------------------------------------------------------------+

bool Volatilnost(int ATRTimeframe, int ATRPeriod, int PerShortMA, int PerLongMA, int ma_method)
   {
   bool  res = false;
   double   atr_curr[101];
   double   iatr_curr;
   
   ArraySetAsSeries(atr_curr,true);
   
   for(int i=100; i>=0; i--)  
   {
   atr_curr[i]=iATR( NULL, ATRTimeframe, ATRPeriod, i) ;
   if(i==1){iatr_curr=atr_curr[i];}
   }
   double   ShortMA=iMAOnArray( atr_curr, 0, PerShortMA, 0, ma_method, 1); 
   double   LongMA =iMAOnArray( atr_curr, 0, PerLongMA, 0, ma_method,  1); 

   if (ShortMA < LongMA)res = false;// Не работаем
         else res = true;
       
   return(res);
   }