Trend lines trading
The Expert Advisor finds the trend lines on the chart based on fractals. Later, it uses the found lines to open deals once the price bounces from the lines. The EA is able to calculate numerous lines simultaneously and it can trade based on the areas where such lines consolidate, forming a strong support or resistance for the price. Many of the parameters can be configured. In addition, it uses some of the standard indicators (RSI and ADX) to provide a higher quality of market entries.
- Lots - lot size (if Lots=0, then the lot will be calculated based on the percentage of account free margin);
- Percentage of free money - the percentage of free margin to open each new trade (applicable when Lots=0);
- MaxSpread - the maximum allowable spread to open trades (for floating-spread symbols, to avoid opening with a large spread);
- Magic - unique identifier (use different magic numbers if multiple Expert Advisors run in your terminal);
- StopLoss - Stop Loss order value;
- TakeProfit - order closing price at a certain profit target;
- Stop to breakeven after - move stop loss to breakeven after a certain number of points;
- Profit by stop-loss - profit based on the specified breakeven;
- EnableAutoClose - automatic closure of orders in case of a reverse signal;
- HistorySearch - the number of bars in history to search for the trend lines and channels (recommended range - from 30 to 200);
- Shift - shift to the left from the current bar (recommended range - from 1 to 10);
- MinFractalsDistance - the minimum distance between the nearest fractals for plotting lines (recommended vales are from 1 to 20);
- MaxCountLines - the maximum number of trend lines (recommended range - even numbers from 2 to 30);
- Number of lines relating to prices - the minimum number of lines, that touch the price bar for opening a deal (recommended values are from 1 to 5);
- FindLinesDelay - delay between new searches for lines (in minutes);
- FindChannels - the option switches between channels and lines (LinesOnly - common trend lines, Channels - draws channels, OppositeLine - draws opposite lines);
- PeriodRSI - period of the Relative strength Index indicator (recommended range - from 0 to 50, if set to 0, the indicator will not be used in trading);
- LowLevelRSI - Relative Strength Index lower level (recommended range - from 10 to 50);
- HighLevelRSI - Relative Strength Index upper level (recommended range - from 50 to 90);
- Period ADX - period of the ADX indicator;
- Max Level ADX - the maximum level of the ADX indicator;
- RSI and ADX relation - dependence of the RSI indicator from the ADX values (recommended range - from 0 to 1.5);
- Trading start hour - trading start hour;
- Trading end hour - trading end hour;
- ShowLines - enable/disable display of the trend lines or channels on the chart.
The EA can trade on any currency pair and timeframe. It does not use risky trading methods, always places stop loss to protect the position. Recommended timeframes - M5 to H4. The additional tests and settings for different currency pairs and timeframes can be found in the Comments section. Optimize the parameters before trading and after a certain time period.
New parameter FastMethod influences the speed of testing and trading. If set to true, the EA will find lines and channels faster, though with lower quality.