Need help testing Account and Broker settings in tester (e.g. AccountStopoutMode, AccountFreeMarginMode...)
I am sure everyone will agree that it is always a good idea to verify EA sanity in the tester...
Is there a way to configure the tester to simulate various broker settings so I can test my EA's in these different environments? In particular the docs for AccountStopoutMode and AccountFreeMarginMode are so "dry" that IMHO it would make sense for every MQL programmer to write some simple test apps for these functions even if simply to confirm that they work as expected.
So basically - configure the behaviour (in the tester) of functions like AccountStopoutMode, AccountFreeMarginMode, AccountLeverage and MarketInfo with e.g. MODE_MARGININIT, MODE_MARGINMAINTENANCE, MODE_MARGINHEDGED, MODE_MARGINREQUIRED, MODE_SWAPTYPE, MODE_STOPLEVEL, MODE_SPREAD.... there maybe other settings or functions that I can't think of at the moment... you get the idea.
You can configure the Strategy Tester in this way
ummm... you mean CAN NOT? I understand what you say in the second part but that's not exactly "configure"...
ummm... you mean CAN NOT? I understand what you say in the second part but that's not exactly "configure"...
Yes, I have been looking at it for the past two days... still trying to figure it out... :)
It is true that you can make do without most of these, but at the very least you will probably need AccountStopoutMode and AccountFreeMarginMode. It would be very useful to be able to configure these in the Tester.
Ok so if all you are using is AccountFreeMarginCheck then that's great... it will certainly make life easier for you I will need to study your code some more (didn't have time today) to understand how you do that. At the moment it is not clear to me, because the only way I can think of is:
Step 1. get the AcctFreeMarg, based on how many lots you want to open
Step 2. use this value to determine how big a move against you this free margin can sustain?
I can see that it is possible to work out the optimum number of Lots and S/L this way (running this in a loop if necessary and increasing or decreasing values until you get the value that you're happy with) but it looks somewhat cumbersome... when I am using those other functions, I can calculate it at once. On the other hand, if one uses smaller lots then the above two steps would not have to be repeated too many times so that fine.
But like I said - I should probably go look at you're code more closely, it is probably all explained in there, I just had a hard time connecting all the dots... it's a lot of code :) And I nee to apply the "patches" from your other thread...
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I am sure everyone will agree that it is always a good idea to verify EA sanity in the tester...
Is there a way to configure the tester to simulate various broker settings so I can test my EA's in these different environments? In particular the docs for AccountStopoutMode and AccountFreeMarginMode are so "dry" that IMHO it would make sense for every MQL programmer to write some simple test apps for these functions even if simply to confirm that they work as expected.
So basically - configure the behaviour (in the tester) of functions like AccountStopoutMode, AccountFreeMarginMode, AccountLeverage and MarketInfo with e.g. MODE_MARGININIT, MODE_MARGINMAINTENANCE, MODE_MARGINHEDGED, MODE_MARGINREQUIRED, MODE_SWAPTYPE, MODE_STOPLEVEL, MODE_SPREAD.... there maybe other settings or functions that I can't think of at the moment... you get the idea.