Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1216

 
Pineapple88:

What is the reason for opening a position immediately after the EA has been started?

The conditions for opening a position are not fulfilled, but the position is opened

In such cases, the best way to do this is to use the Print. This will show whether the conditions are met or not.

...
if(PositionsTotal()==0)
 {
  Print(" MovingAverage1[0]: ",MovingAverage1[0]," MovingAverage2[0]: ",MovingAverage2[0]);
  trade.Sell(0.1);
 }
...
 
Vladimir Karputov:

When should we check 'MinDist(30 pips)' and 'OpenDev(10 pips)' - on every tick or only at the moment of new bar birth?

It should be checked on every Tick!

but for testing is it possible to make two variants, and a switch for the tester in the parameters? maybe there is a ready example in CODEBASE

 
Milhail Novgorodcev:

It is necessary to test in each Tick!

but for testing is it possible to make two variants, and a switch for tester in parameters? maybe there is a ready example in CODEBASE

If you want to check on every tick, then you should specify HOW and WHERE to check the 'MinDist(30 pips)' parameter.

For example, do you want to check it on the current bar? Or at any number of bars or just look for the last moment when'MinDist(30 pips)' was?

 

Hello Comrades!

In the visual strategy tester, when running the EA, the MACD indicator used in the EA is either displayed or not, and the same is true for the EA in the standard examples. Is this an invisible bug in the Visual Tester or what?

 
Who will prompt. sent by mail a folder with an EA on mql5.but install it in the terminal can not.how to do it? where to find information to do this?
 
kokines:
I've been sent a folder with an Expert Advisor on mql5 by mail, but I can't install it in the terminal. How can I do it? Where can I find the information on how to do it?

Maybe they sent you the folder with the source code, then you need to compile it with MetaEditor.

 
Vladimir Karputov:

If you check on every tick, then you need to specify HOW and WHERE to check the 'MinDist(30 pips)' parameter.

For example, do you want to check on the current bar? Or at any bar or just search for the last moment when'MinDist(30 pips)' was?

we need the last MinDist(30) - this event will give a signal to open an order, which will be opened once the value of OpenDev(10) is reached in the current moment and the order will be BAY - if the price value of MinDist(30) was above the average (or Sell if below average)

And after the order is opened the MinDist value is reset, and you have to wait again!!! for the MinDist value (30), and so on...

 
Milhail Novgorodcev:

you need the last moment when there was a MinDist(30) - this event gives a signal to open an order, which will open when the value of OpenDev(10) is reached in the current moment and the order will BAY - if the price value of MinDist (30) was above the average ( or Sell if below the average)

and after the order is opened the MinDist value is reset, and you have to wait again!!! for the MinDist value (30), and so on...

The first time you run, find the first date for the 'MinDist(30)' event and remember it. Subsequently scan the space from this date to thecurrent time. As soon as you find a new 'MinDist(30)' event, overwrite the saved date.

 
What is the error send error 10054 in the tester?

 

Good afternoon!

I'm trying to understand arrays and have the following question.

MqlRates rates[]; 
   ArraySetAsSeries(rates,true); 
   int copied=CopyRates(Symbol(),0,0,100,rates);

Why useArraySetAsSeries in this example and set flag true, if inCopyRates counting is made from present to the past?

I understand, that theArraySetAsSeries function is necessary to search the array from the present to the past.

I want to understand the purpose of this function in this example.