Jump to content

⤴️-Paid Ad- Check advertising disclaimer here. Add your banner here.🔥

Recommended Posts

Posted

Hello MQL4 Programming Experts

 

Could you please let me know the MQL4 Code for calculating Total Number of Orders (Buy + Sell) initiated by each Hedge EA with different Magic Number (e.g. 1234 and 9876).

 

I am running two Hedge EAs with different Magic Numbers on same currency pair in Demo Account. And I want to modify the EA to include "OrdersTotal" initiated by each EA

 

Thank you!

Sam

Posted

You just need to loop through all open orders and check their magic numbers. Then just keep incrementing the count variable for each magic number.

 

If you don't know how to loop through orders just take a look at the source code of virtually any EA and you'll find examples.

 

Regards

 

Lux

  • 2 weeks later...
Posted
You just need to loop through all open orders and check their magic numbers. Then just keep incrementing the count variable for each magic number.

 

If you don't know how to loop through orders just take a look at the source code of virtually any EA and you'll find examples.

 

Regards

 

Lux

When such a thing never worked, it is difficult to understand himself. If it is not difficult, please let us know MQL4 code.

Posted (edited)

I don't know what do you want exactly. I send you a little ea as tools for protection of accounts:

 

1/ it close the orders if equity > coeff % of balance

 

2/ it send Stoploss et Takeprofit or modify them for order of magicnumber magic1 and magic2

 

3/ it hedge if equity < HDG % of beginning equity

 

 

https://www.asuswebstorage.com/navigate/share/GY4N5U7GGL

Edited by klod

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


⤴️-Paid Ad- Check advertising disclaimer here. Add your banner here.🔥

×
×
  • Create New...