Questions from Beginners MQL5 MT5 MetaTrader 5 - page 936

 

Hello! Is this situation possible for an EA :

1. The Expert Advisor receives a signal to open a position on bar N

2. The Expert Advisor sends a request to the server and a delay (slippage) occurs, and the deal is opened on bar N+1

3. The conclusion is that in the chart we see the signal on bar N, while the position is opened on bar N+1.

Is this possible?

 
Tango_X:

Hello! Is this situation possible for an EA :

1. The Expert Advisor receives a signal to open a position on bar N

2. The Expert Advisor sends a request to the server and a delay (slippage) occurs, and the deal is opened on bar N+1

3. The conclusion is that in the chart we see the signal on bar N, while the position is opened on bar N+1.

Is this possible?

The delay may be up to a second. Can it happen that a new bar appears within this time frame?

 
Vitaly Muzichenko:

The delay can be up to a second. Can it happen that a new bar will appear within this time frame?

If the delay is up to a second or less, then the trade cannot be outside this bar

 
Tango_X:

If the delay is up to a second or less, then the trade cannot be outside this bar

It cannot. Show a screenshot of what you have wrong

 
Vitaly Muzichenko:

It can't. Show me what's wrong with your serine

Why can't it?

If it trades on the minutes - on the first tick it sends a request, the next tick comes a minute later. And the price is not yet out of date and is within the slippage. Or is it?

 
Artyom Trishkin:

Why can't it?

If it trades on the minutes - on the first tick it sends a request, the next tick comes a minute later. And the price is not yet out of date and is within slippage limits. Or is it?

Plus, if the instrument is illiquid, the first tick of the minute may not be on the first second.

 
Artyom Trishkin:

Why can't it?

If trades on minutes - on the first one sent a request, the next tick came after a minute. And the price is not yet out of date and is within slippage limits. Or is it not?

By the way, for the minutes I dropped, I haven't opened a single trade there in 10 years)

 

Hello.

Maybe there is already a ready-made function - in which bar is the time?

For example if the time is 11.47 then :
М1==11.47
М5==11.45
М15==11.45
М30==11.30

 
Nauris Zukas:

Hello.

Maybe there's already a ready-made function - in which bar is the time?

For example if the time is 11.47 then :
М1==11.47
М5==11.45
М15==11.45
М30==11.30

WouldiBarShift work?

 
Vladimir Karputov:

WilliBarShift work?

Yes, exactly, thank you!