In this example, a strategy for working with order grids is implemented. The peculiarity of the algorithm is that the adviser closes the network of orders partially. Thus, the adviser seeks to bring the total take profit as close as possible to the current price. This approach allows you to quickly and efficiently eliminate the accumulated volume of orders against the current trend. The VR Smart Grid Lite MT5 Expert Advisor will be useful for both novices in trading and programming and professionals.
The VR Smart Grid Lite MT5 Expert Advisor, a lightweight version of the VR Smart Grid Expert Advisor published in the market, demonstrates a small part of the source code and a small part of one of the principles for reducing the position of orders against the trend.
Work logic
If the last candle was bullish, then the adviser will enter the market with a buy deal. If the last candle is bearish, then there will be a deal to sell. In this case, the signal acts not only on the first order in the network, but also on all subsequent ones. This approach eliminates the opening of the network only after a specified distance. It turns out that the adviser takes into account not only the distance set by the trader, but also the signal from the candles. In the case of a sharp movement without a signal from the candles will not be a deal. It is important to note that if there is a strong movement on the instrument (all candles are bearish), then the transaction will be made on a bullish candle.
Attached Image (click to enlarge)
Recommendations
- Be sure to watch the full video posted on this page;
- Do not use on real without a clear understanding of the risks and consequences;
- Integrate your strategy into the code;
- When used in real conditions, test on demo accounts for at least 4 working weeks.
Benefits
- Works on any timeframe;
- Works with any tools (Forex, Metalls, Stock, Crypto currencies, etc);
- Simple open source;
- The ability to integrate any trading strategy;
- A detailed description of the code in the video material;
- Works in a strategy tester, on a demo and in real life (observe and consider risks);
- Automatically picks up its orders upon restart.
Settings
- Take Profit (in pips) – take profit in points;
- Start lot – стартовый лот;
- Point order step (in pips) – step between orders;
- Minimal profit for close grid (in pips) – minimum profit when closing a series of orders;
- Magic Number (in number) – the serial number of orders, according to which the adviser distinguishes its orders;
- Slippage (in pips) – slip.
Attached Image (click to enlarge)
Attached Image (click to enlarge)