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

 
Alexey Viktorov:

So the suggestion is to take an indicator with a library, connect it to ex4

and after that everything will work?

I mean the logic itself
 
trader781:

So the suggestion is to take an indicator with a library, connect it to ex4

and then everything will work?

Don't be lazy, follow the link to the documentation, read it carefully and you will understand everything.
 
Voznesen:
Hi all, just started learning the language, recently came across a video tutorial on creating a grid EA, wrote, compiled, 0 errors, 0 warnings. But i can't see my robot open trades, i want to ask who's not too lazy)))

Thanks in advance!


extern double Lots      = 0.1;
extern double Profit    = 50;
extern int Step         = 30;
extern int Magic        = 6677;
extern int Slippage     = 5;

extern int maPeriod     =100;
extern int maShift      =1;

double ma, FindLastBuyPrice, price;
//------------------------------------------------------------------
//___ПРОВЕРКА_ЗНАКОВ_ПОСЛЕ_ТОЧКИ___
//------------------------------------------------------------------
int OnInit()
{
   if (Digits == 3 || Digits == 5)
   {
      Step     *= 10;
      Slippage *= 10;
   }
   return(INIT_SUCCEEDED);
}
//---------------------------------------------
void OnDeinit(const int reason)
{

}
//------------------------------------------------------------------
//
//------------------------------------------------------------------
void OnTick()
{
  
   ma = iMA(Symbol(),0,maPeriod, maShift, MODE_SMA, PRICE_CLOSE, 0);
  
   if (CountBuy()==0 && CountSell() == 0 && Bid < ma)//
   {
      if (OrderSend(Symbol(), OP_SELL, Lots, Bid, Slippage, 0, 0, "", Magic, 0, Red) < 1)
         Print ("Неудалось открыть ордер на Продажу");
   }
   if (CountBuy()==0 && CountSell() == 0 && Ask < ma)
   {
      if (OrderSend(Symbol(), OP_BUY, Lots, Ask, Slippage, 0, 0, "", Magic, 0, Blue) < 1)
         Print ("Неудалось открыть ордер на Покупку");
      
   }
  }
//+------------------------------------------------------------------+


D highlighted what was missing
 
Sergey Gritsay:
D highlighted what was missing
Thank you, that's my lack of attention!
 
Alexey Viktorov:
Don't be lazy, follow the link to the documentation, read it carefully and you will understand everything.
It doesn't say anything about calculating the indicator in the EA itself, and I've seen this too.
 
trader781:
It doesn't say anything about calculating the indicator in the EA itself, and I've seen that too.
How could it not say? I gave you a quote from the documentation. Maybe, it is not in the EA itself that it is calculated, I don't know deeply how everything happens there, but I don't need to carry the indicator and the library. This is what the question was about. What is the question and what is the answer.
 
people, can you please tell me how to make the graphs in the terminal to save the markup after switching on again?
I saved in csv format, it doesn't work
 
Sergey Parkin:
people, can you please tell me how to make the graphs in the terminal to save the markup after switching on again?
I saved it in csv format, it doesn't work.
Which markup are we talking about?
 
Alexey Kozitsyn:
What kind of markup are we talking about?
The markup on the charts, support/resistance levels for example.
after I turn on the terminal again, it all disappears from the charts.
I must have saved it somehow.
I pressed "File-Save As" and saved it, but it didn't help me.
I spent a lot of time yesterday drawing the markup on the charts, but today I turned on the terminal and it is gone(
 
Sergey Parkin:
about the markings on the charts, support/resistance levels for example.
When I turn on the terminal again, all of this disappears from the charts.
I think I have to save it somehow.
I've tried to save it by pressing "File-Save As" button, but it did not help me.
I spent a lot of time yesterday drawing the markup on charts, and today I turned on the terminal and it's gone(
Are there any indicators/advisors on the charts?
Reason: