Magic Number

 

I have an issue with my ea. If I attach 2 Eas on one chart it gets confused and does its own thing. I want a way that the ea detects that it has been attached on a particular chart and increases the magic number because I dont want to do it manually

example:


if "boom 1000 Index" has a magic 7897 then if I attach the ea on Boom 1000 index again, the magic number should be 7898.

 
Sphelele Sphesihle Lubanyana: If I attach 2 Eas on one chart it gets confused and does its own thing.

If you read the documentation, you know you can only have one EA per chart.

Stop wanting to be lazy..

 
Use a Global Terminal Variable as your source for the magic number, increase the counter according.
EDIT:
Alrernative would be to use the windows handle as your magic number. - Well, good luck with picking up your positions after terminal restart.

The point of magic numbers is to have a "UID" to identify your positions to your EA after restart...

Take that into account.
Reason: