The "tilting doll" Expert Advisor that increases the volume after closing an unprofitable position. It can work with deals performed manually or with initial stop orders (if StartStopOrders = true). The Expert Advisor sleeps until there are no open positions. If StartStopOrders is set to True, it places two stop orders. Once one of them triggers, the other one is deleted.
If the Expert Advisor detects an open position, it sets a take profit. If the price goes in profitable direction, it turns on trailing stop working on a distance specified in points in TrailingStop. On a specified distance (StopLoss) from the open position, the Expert Advisor places a stop order. Its volume is chosen so that it will close the current position and open a new one with the volume equal to the previous position volume multiplied by the K_Lot rate. LotStop = Lot*K_Lot+Lot.
And so on until it is closed by the trailing stop or take profit. After closing, it waits for a new position.
- StopLoss - distance for opening an opposite position with increased volume (200 on default);
- TakeProfit - profit in points (500 on default);
- TrailingStop - trailing stop distance (100 on default);
- TrailingStart - profit value to start setting stop losses (10 default). Negative values allow trailing while having a loss;
- Lot - initial lot used if the Expert Advisor starts its operation from placing stop orders (0.1 on default);
- K_Lot - lot multiplier for opposite positions (2 on default);
- StartStopOrders - mode of work start. If you select 'false', the Expert Advisor will wait for a manually opened position, or a position opened by another EA with the magic number = MAGIC ('true' on default);
- MAGIC - the Expert Advisor works only with the trade operations that have the specified magic number (0 on default).