A generic trade manager has to play nice with any other EAs running in MT4 and therefore may not automatically pickup any other open tickets not being managed by instances of itself. If it is using it's own window functionality, it can supply a list of unmanaged tickets so the user can easily load ticket(s) of his/her choice. No windowing means using magic numbers via the EA properties box.
Keeping track of orphaned tickets (previously handled by said EA) and letting the EA reload the ticket data is not anymore difficult than saving the ticket data in some form (globalvariables/file/registry/etc).
Handling access to shared data in a secure way will probably be required on occasion since each EA runs in its own thread. If one has written ones own dll(s) for the EA then there are probably language native constructs to make it easier. Otherwise the windows API provides functions for that and they can be called from the within the EA. Examples:
- Delphi/Lazarus: TCriticalSection.
- Win32 API: CreateMutex(), WaitForSingleObject(), ReleaseMutex(ghMutex) etc.
Keeping track of orphaned tickets (previously handled by said EA) and letting the EA reload the ticket data is not anymore difficult than saving the ticket data in some form (globalvariables/file/registry/etc).
Handling access to shared data in a secure way will probably be required on occasion since each EA runs in its own thread. If one has written ones own dll(s) for the EA then there are probably language native constructs to make it easier. Otherwise the windows API provides functions for that and they can be called from the within the EA. Examples:
- Delphi/Lazarus: TCriticalSection.
- Win32 API: CreateMutex(), WaitForSingleObject(), ReleaseMutex(ghMutex) etc.