This is a hedging code so I called it ‘Ligustrum’, a sort of a parody – check it on the internet.
Principally, what happens is that a trade is opened via a quite basic MA cross – for example two moving averages, one fast and one slow, that when crossing opens either a long or short trade. If the market continues in the ‘correct’ direction then at a certain point of profit the trade is closed and the cycle starts again.
If, however, the market moves against the position another trade is opened in an opposite direction, the lot size weighted with a fairly complex algorithm so as to take into account the two obverse positions in order that at a pre-set point, if the market continues in the same direction, both trades are closed at breakeven or a small profit.
If the market again reverses then a third trade is opened in the direction the market is heading. If, yet again, the market changes direction then yet another trade is opened…and so on until the lot sizes become too great and it either crashes or doubles, so until further developed this code is not for sale.
However, while conducting extensive research and tests with my own code I came across this brilliant piece of software that is ready to go straight from the box, click the banner below.