Tâche terminée
Spécifications
Hi,
I already have a working code which I trade and uses a system of trailing stops.
Now I am using a VPS service and I have encountered a problem: Let's say I migrated one chart with an EA in day 1 (let's call this EA1). In that same day EA opens a position. I left the chart open with the EA in my terminal. In day 2 I find another opportunity so I open a new chart with a new EA (EA2). I migrate again both charts, because if I close chart that contains EA1 the EA1 will be removed from the VPS. In day 3 I monitor both positions and find out that EA1 is not working for trailing the stop of the position that is open, so the profit is increasing, but the stop is fixed and will never be trailed as the EA won't work as te EA is "rebooted" in the last migration.
For more info. please reffer to this link: https://www.mql5.com/en/forum/340676
Having identified the problem I need a code that fixes it. So probably could be a code that once is migrated checks out if there is already an EA working for the open trade, if it is no any EA (there won't be!) then it must analyse the open position and determine if it is needed a trailing stop. If not, well no need to do it, but the EA must keep watching the symbol and chart, so if a trailing stop is needed, just do it! So basically is a catch up code for the trailing stops to continue working every migration to the VPS.
Also I need the code to be cleaned up (even rewriteen) it was initially developed including a reference to an MT4Orders.mqh, that I am sure can be deleted if the code is properly coded. The code must be efficient!
I will need the source code of everything.