smurf43 Posted June 8, 2012 Report Share Posted June 8, 2012 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 Quote Link to comment Share on other sites More sharing options...
⭐ luxinterior Posted June 8, 2012 Report Share Posted June 8, 2012 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 smurf43 1 Quote Link to comment Share on other sites More sharing options...
Neptun Posted June 17, 2012 Report Share Posted June 17, 2012 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. Quote Link to comment Share on other sites More sharing options...
klod Posted June 19, 2012 Report Share Posted June 19, 2012 (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 June 20, 2012 by klod smurf43 1 Quote Link to comment Share on other sites More sharing options...
klod Posted June 20, 2012 Report Share Posted June 20, 2012 the new version: https://www.asuswebstorage.com/navigate/share/GY4N5U7GGL Quote Link to comment Share on other sites More sharing options...
klod Posted June 20, 2012 Report Share Posted June 20, 2012 the new version: https://www.asuswebstorage.com/navigate/share/GY4N5U7GGL this version hedge only one time (but the hedge is closed in loss of stoplevel pips.) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.