Questions from Beginners MQL5 MT5 MetaTrader 5 - page 696

 

I need to copy trades of an EA from a demo account to a real account.

I want it to be exactly as on the demo, open an order and then just close it on a position and I can connect 2 terminals or accounts

 
Treder9:

I need to copy trades of an EA from a demo account to a real account.

I want it to be exactly as on the demo, open an order and then just close it on a position and I can connect 2 terminals or accounts

You can do it, but the slave terminal will suffer from delays. The delays may not matter but they will occur.
 
Treder9:

I need to copy trades of an EA from a demo account to a real account.

I want it to be just like on the demo, open an order and then close it again right away on a position and i also have the option to connect 2 terminals or accounts

As Artem said above, there will be delays in any case and it depends not on the copier you use but on the server side of your broker.

It won't workexactly, no matter how hard you try, and no matter what mega-brains of programmers you connect to the programming of such a copier.

 
Dmitry Melnichenko:

Here's a question:

How to handle an event (if any), when the "Auto-trade" button is disabled in mt5.

For example, I need the EA to close positions when Auto-Trade is disabled!

Unfortunately, now auto-trading not only disables the event of TIKA arrival for an EA, but it also prohibits it to trade.
 
Vladislav Andruschenko:
Unfortunately, now auto-trading not only disables the TIKA event for EAs, but also prohibits them from trading.
Nope, not everything is disabled - only trade orders. How does the programmer not know that? And you are not the first to write like this on the forum.
 
Vitalie Postolache:
Nope, doesn't disable everything - only trade orders. How does a programmer not know that? And you are not the first to write such a thing on the forum.

It's strange, but I thought that even with start the ticks stopped going? I checked now, even with auto-trading switched off - the ticks are still there.

HMM.

 
Vladislav Andruschenko:

It's strange, but I thought that even with start the ticks stopped going? I checked now, even with auto-trading switched off - the ticks are still there.

HMM.

You can, of course, continue to write start() in your codes, but the compiler will anyway replace it with the correct variant (OnTick() for EA) when compiling ;)
 
Vitalie Postolache:
You can, of course, continue to write start() in your codes, but the compiler will still replace it with the correct version (OnTick() for EA) when compiling ;)
I don't write start() in my codes, although I didn't change the old codes, they work fine as it is.
 

Good day everyone! Can you please advise how to set an order deletion in an EA?

The situation is as follows:

We place 2 pending orders in different directions, as soon as one of them triggers, the other is removed and is no longer exhibited.

I would be very grateful for any help.

I would be very thankful for it.

 
yaaarik777:

Good day everyone! Can you please advise how to set an order deletion in an EA?

The situation is as follows:

We place 2 pending orders in different directions, as soon as one of them triggers, the other is removed and is no longer exhibited.

I would be very grateful for any help.

I would be very thankful for it.

https://docs.mql4.com/ru/trading/orderclose
OrderClose - Торговые функции - Справочник MQL4
OrderClose - Торговые функции - Справочник MQL4
  • docs.mql4.com
OrderClose - Торговые функции - Справочник MQL4
Reason: