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.
I wish I had seen this first!
It would have saved me hundreds of hours.
EA Builder.
This does the work for you

Replete with a money-back guarantee. So absolutely no risk. If it does not work for simply request a refund. Or stay with it and make money.
This is a fabulous bit of software.
You can create your own trading robot without knowing anything about programming and without hiring a programmer?
And you can do it with just a few short clicks!
Using a straightforward intuitive interface, even professional programmers can appreciate the benefits of creating complex trading rules with minimum effort.
Forex, stocks or commodities… trade whatever’s on offer in your MetaTrader 4, MetaTrader 5 or TradeStation platform.
Sign up for free and start creating indicators on any of the above platforms