ONCENeverDecrease=1//1=do not decrease lot size when losing,
// 0=decrease lot size according to strategyprofit
ONCEMinLots=1//1 Min lots allowed
ONCEMaxLots=99//99 Max lots allowed
ONCEMyDrawDown=200//200 DrawDown as from backtest
ONCEMyMargin=70//70 Margin required
ONCEDD=3//3 DrawDown multiplier
Capital=(MyMargin+(MyDrawDown*DD))*nLots
Equity=Capital+StrategyProfit
IFLotManagement=1ANDBarIndex>0THEN
nLots=max(MinLots,min(MaxLots,Equity/Capital))
IFNeverDecrease=1THEN
nLots=max(nLots,nLots[1])
ENDIF
ENDIF
Line 1: Number of lots (default)
Line 2: 1=lot management enabled, 0=disabled
Line 3: 1=do not decrease after a loss, 0=decrease the number of lots after a loss
line 5: Minimum lots allowed (can be < 1, if allowed by your broker)
line 6: Maximum lots allowed
line 7: DrawDown show by backtest
line 8: Margin required by the broker
line 9: DrawDown Multiplier (3 is the value I use by default)
You should start with line 2 se to 0 (lot management disabled), until you have finished optimizing, then write the correct value at lines 7 and 8 and backtest it again to save it and see the results.
You should backtest using a CAPITAL that is exactly (rounded) the one calculated at line 10 (nLots used here is the initial lot size set at line 1).
nLots is the number of lots you want to BUY/SELLAHORT.
To help us continually offer you the best experience on ProRealCode, we use cookies. By clicking on "Continue" you are agreeing to our use of them. You can also check our "privacy policy" page for more information.Continue