how do i constraint an EA making only one trade based on magic number (instead of symbol)

 

Dear all, 

how do i constraint an EA making only one trade based on magic number (instead of symbol), (objective is to run similar EA with different magic number on the same symbol - so that i can test out which VPN is the best)

Thank you

Files:
 
illusi0nxz:

Dear all, 

how do i constraint an EA making only one trade based on magic number (instead of symbol), (objective is to run similar EA with different magic number on the same symbol - so that i can test out which VPN is the best)

Thank you

I just posted some position managment source code, including an unused magic number variable, at:

Scripts: Reverse Trades For All Symbols Script - Articles, Library comments - MQL5 programming forum


You should be able to see how the conditions interact with the position type variable, and then insert the magic number variable in a similar way.

Scripts: Reverse Trades For All Symbols Script
Scripts: Reverse Trades For All Symbols Script
  • 2024.04.09
  • Automated-Trading
  • www.mql5.com
Articles, Library comments: Scripts: Reverse Trades For All Symbols Script
 
Ryan L Johnson #:

I just posted some position managment source code, including an unused magic number variable, at:

Scripts: Reverse Trades For All Symbols Script - Articles, Library comments - MQL5 programming forum


You should be able to see how the conditions interact with the position type variable, and then insert the magic number variable in a similar way.

couldn't get it to work :( thank you for your time
 
illusi0nxz #:
couldn't get it to work :( thank you for your time

This one is compiled but not tested.

Files:
 
Ryan L Johnson #:

This one is compiled but not tested.

Thank you very much, it work. I'll explore your product when im back from holiday
 
Ryan L Johnson #:

This one is compiled but not tested.

Will you help me out again?

I currently have a manual trade open (and it can open more when other limit orders are hit).

How do i in concurrent trigger this EA (only one position open at any one time based on the magic number for this EA)?

Thank you very much

Files:
 
illusi0nxz #:

Will you help me out again?

I currently have a manual trade open (and it can open more when other limit orders are hit).

How do i in concurrent trigger this EA (only one position open at any one time based on the magic number for this EA)?

Thank you very much

I got it. Thank you :)