Cross_Line_Trader - MetaTrader 5 Expert - MT4/MT5 Resources


It is a semi-automatic Expert Advisor. It opens a position at the intersection of the lines drawn on the symbol chart.
Once the price crosses the line and an appropriate position is opened, the line becomes inactive (its type changes). The type of invalid line is set in the settings to avoid reopening after the price crosses the line.
One type of crossover is achieved: at the opening of a new bar, that is, if the opening price of the previous bar and the opening price of the current bar are on opposite sides of the crossover line.
Check the "Ray to the Right" parameter of the trendline:
If the open price of the past bar and the open price of the current bar cross this line, a position corresponding to the setting will be opened and the line will become invalid.
As soon as the current bar opens behind the bar on which the line was set, the position corresponding to the setting will be opened and the line will become inactive.
The opening volume of the Expert Advisor is configured in the settings. You can also set stop loss and profit points. If invalid StopLoss and TakeProfit values are specified, the EA will adjust these values to the minimum allowed symbol of the StopLoss level .
If the specified value is incorrect, the Expert Advisor will adjust the lot size. If the lot size is too large, the EA will adjust it to be able to open a position. If there is not even the minimum lot size to open a position, the position will not be opened.
This EA has 13 input parameters:

Attachment download
📎 cross_line_trader.mq5 (51.43 KB)
📎 objects.mqh (22.31 KB)
Source: MQL5 #20178
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •