Download MetaTrader 5

Multiple trading criteria for open and close in one EA

To add comments, please log in or register
how2
7
how2  

Hi,

I know it is possible to set more than one opening rule to open a trade with the use of multiple "if's", but how to assign a closing rule to each opening one?

Please, treat me like an amateur. I mean, some simple template would be welcome.

Thanks. 

Keith Watford
Moderator
9994
Keith Watford  
how2:

Hi,

I know it is possible to set more than one opening rule to open a trade with the use of multiple "if's", but how to assign a closing rule to each opening one?

Please, treat me like an amateur. I mean, some simple template would be welcome.

Thanks. 

The one is referring to rule?

If you use different conditions ( as opposed to a combination of conditions) to open trades, you could use a different magic number for each condition

Then you can check the MN and you will know which condition was used to open the trade 

how2
7
how2  
GumRai:

The one is referring to rule?

If you use different conditions ( as opposed to a combination of conditions) to open trades, you could use a different magic number for each condition

Then you can check the MN and you will know which condition was used to open the trade 

Magic Number did the job.

Thanks for your quick response.

To add comments, please log in or register