The library is dedicated for automated calculation of a lot size depending on profit and loss factors of a position.
Tests show that when you use this library an EA profitability increases twice on the average, and drawdown become a third or twice less.
Importing library functions
#import “\\Market\\Smart MM.ex4”
double GetSizeLotSmartMM(int risk=10, int sl=10, int persprofit=50, int persloss=50, int kprofit=4, int kloss=6, int mn=0);
#import
- risk — risk percentage relative to the balance in case of maximum amount of losing deals
- sl — stop loss value for 4‑digit quotes in points (this value should exceed 0)
- persprofit — approximate percent of profitable deals.
- persloss — approximate percent of losing deals.
- kprofit — maximum amount of profitable deals in a row.
- kloss — maximum amount of losing deals in a row.
- mn — magic number.
In order to use library function you need to insert the following code in the EA’s code:
double lot = GetSizeLotSmartMM(10, 10, 50, 50, 4, 6, 0);
The screenshot 1 shows results of testing using a fixed lot.
The screenshot 2 shows results of testing using Smart MM with parameters of the first EA.