There is a cBot, which is publically available. It is a sample Martingale Algo and can be found on the following link :-( [url removed, login to view] If you sort by name, It is called Martingale Robot and written by alexk on 17/02/12. )
I am wanting to have some simple amendments made to the Algo, so as to reduce the risk that is inherrent in a Martingale Algo, as follows:-
The current operation of the Algo is stated on the Algo as follows:-
...."The "Sample Martingale cBot" creates a random Sell or Buy order. If the Stop loss is hit, a new
// order of the same type (Buy / Sell) is created with double the Initial Volume amount. The cBot will
// continue to double the volume amount for all orders created until one of them hits the take Profit.
// After a Take Profit is hit, a new random Buy or Sell order is created with the Initial Volume amount..."
I am wanting the following amendments to be made to the Algo :-
1 - To take out the random order wherever it is used. I require the initial trade to be taken in the direction of an exponential moving average. Price above ema = long trade. Price below ema = short trade. And such ema parameter to be variable for optimisation purposes.
2 - Initial trade quantity to be determined as a percentage of account balance, or equity. Such quantity parameter to be variable as well.
3 - If the initial trade hits the stop loss, the next new trade is doubled per the existing cBot. Ok to keep this command. However, the direction of the new doubled trade is currently always in the same direction of the initial trade. I require the second trade (and any subsequent trade after a loss or win) to be taken in the direction of the ema. So, all trades,(either initial or after a win or after a loss) are to be taken in the direction of the ema. This can result in the algo changing direction of new trades, if the price crosses to the other side of the ema.
4 - If a trade hits the profit stop, it then takes a new trade, back to the initial quantity. That is fine, except that new initial trade should not be random but rather as per direction of ema, as previously outlined. Also, the qantity of trade is a % of account balance or equity, as previously outlined.
5 - I would like a maximum number of trades limitation put into the cBot. Such parameter to be variable. This will hopefully stop the cBot from totally wiping out a trading account.
Hope the above makes sense.