I’m not worth Grahal.
The bot is to be fully autonomous
Sounds like you seek the holy grail … nobody has found it yet!? 🙂
Yes, i work in Santo Grial.
You could try this MM by Vonasi. You can set it to go back to the starting positionsize after a certain % drawdown.
//MONEY MANAGEMENT Vonasi
Capital = 10000
MinSize = 1 //The minimum position size allowed for the instrument.
MM1stType = 0 //Starting type of moneymanagement. Set to 0 for level stakes. Set to 1 for increasing stake size as profits increase and decreasing stake size as profits decrease. Set to 2 for increasing stake size as profits increase with stake size never being decreased.
MM2ndType = 1 //Type of money management to switch to after TradesQtyForSwitch number of trades and ProfitNeededForSwitch profit has occurred
TradesQtyForSwitch = 10 //Quantity of trades required before switching to second money management choice.
ProfitNeededForSwitch = 3 //% profit needed before allowing a money management type change to MM2ndType.
DrawdownNeededToSwitch = 5 //% draw down from max equity needed before money management type is changed back to MM1stType.
DrawdownNeededToQuit = 35 //% draw down from max equity needed to stop strategy
Once MoneyManagement = MM1stType
Equity = Capital + StrategyProfit
maxequity = max(equity,maxequity)
if equity < maxequity * (1 - (DrawdownNeededToSwitch/100)) then
enoughtrades = 0
tradecount = 0
moneymanagement = MM1stType
endif
if equity < maxequity * (1 - (DrawdownNeededToQuit/100)) then
quit
endif
if not EnoughTrades then
if abs(countofposition) > abs(countofposition[1]) then
tradecount = tradecount + 1
endif
if tradecount > TradesQtyForSwitch and maxequity >= Capital * (1 + (ProfitNeededForSwitch/100)) then
EnoughTrades = 1
MoneyManagement = MM2ndType
endif
endif
IF MoneyManagement = 1 THEN
PositionSize = Max(MinSize, Equity * (MinSize/Capital))
ENDIF
IF MoneyManagement = 2 THEN
PositionSize = Max(LastSize, Equity * (MinSize/Capital))
LastSize = PositionSize
ENDIF
IF MoneyManagement <> 1 and MoneyManagement <> 2 THEN
PositionSize = MinSize
ENDIF
PositionSize = Round(PositionSize*100)
PositionSize = PositionSize/100
// Size of POSITIONS
PositionSizeLong = 1 * positionsize
PositionSizeShort = 1 * positionsize
Solution???
Start off at $1 then it will go to $0.5 after a loss … not hard is it?
You will be testing in Demo anyway so starting at $1 is not a problem?
It’s like trying to spare on car wheels, you buy 3 instead of 4, but it’s impossible to make it move…. buy 4 or use a bike!
Ok, new problem.
I thought that was the problem, but no, the system stops the same.
Joking apart, you can use this snippet, modified to make the number of contracts not to drop below the minimum od 0.5:
Once MaxProfit = 0
Once InitialSize = 1
MaxProfit = max(MaxProfit,StrategyProfit)
LotSize = InitialSize
If MaxProfit > StrategyProfit Then
LotSize = max(0.5,InitialSize / 2)
Endif
You can try using ROUND(), but this will remove decimals.
To be able to tell exactly you should post your code.