The modification of the EA to make it
The Problem
The ATC 2011 rules state:
The minimum trading amount is 0.01 lots, and the maximum is 5 lots, with an increase by 0.01 lot on every order.
…
The maximum combined amount of positions and pending orders’ lots, regardless of the direction on one symbol, is 15.
This means that it won’t be possible to trade with positions greater than 15 lots. It’s quite bad if one wanted to use an aggressive position sizing strategy and increase orders volume indefinitely. When the EA reaches 15 standard lots limit, the
The Solution
There are two basic ways to avoid breaking the Trade.mqh
, which supplies quite powerful PositionOpen()
and PositionClose()
functions.
I’ve chosen the second way. A coder from MQL5.com forums had shared his version of the modified Trade
class for ATC and I’ve modified it to work properly with my EA. The initial version had some errors (it didn’t prevent big orders from sending when no position for the pair was open). If you are anxious to see this modified library, you can scroll down to the Downloads part of this post. The modified lines are marked with “//////////////////////////////” comment.
Results
Obviously, such trading volume limitation has a potential to reduce the performance of the profitable EA. After all, even if there’s enough free margin in the account to open a bigger position, the expert advisor will have to limit the position size with 15 standard lots. If the profit of the previous version of my candidate EA (
Downloads
The whole package of files required to run this expert advisor can be downloaded for free. It contains the EA file, the custom indicator it uses and the modified Trade library that follows the rules of ATC 2011 position sizing:
You can also download the backtest report of this EA:
In the next issue of the RTATC2011 series, we’ll talk about getting the EA to work in the ATC 2011 trading conditions, with all its requotes, delays, slippages, etc.
You can read the first entry in the RTATC2011 journal to get some basic idea of what’s going on here.
P.S.: 2 months and 9 days left for registration in ATC 2011. 994 participants registered so far. Only 6 participants left to 1,000! Yay!
If you have any questions regarding my position sizing techniques for the upcoming ATC 2011 contest or if you want to suggest a different way to adhere to the maximum volume rules of the championship, please reply using the form below.