The Expert Advisor opens and closes orders when the price crosses a certain trend (or horizontal) line.
For example, you draw a trend line and call it “B1”. When the price crosses the trend line, the EA opens a buy position.
The name of the line “B1” is embedded in the Expert Advisor, you can’t change it.
Panel
- Green button: switch panel
- Purple button: change the line type (trend or horizontal)
- Del: delete lines
- X: close the panel
Embedded names are used to open and close orders. All built-in names are described below:
- B1_Lots: the lot size for the line “B1”.
- B2_Lots: the lot size for the “B2″line.
- B3_Lots: the lot size for the “B3” line.
- B4_Lots: the lot size for the “B4” line.
- B5_Lots: the lot size for the “B5” line.
- S1_Lots: lot size for the “S1″line.
- S2_Lots: lot size for the “S2″line.
- S3_Lots: lot size for the “S3″line.
- S4_Lots: “S4”.
- S5_Lots: lot size for the “S5″line.Note: B1_LOTS, B2_LOTS, etc. are initialized as a null value. They must be installed according to your requirements.
- MagicNumber: a magic number.
- StopLossInPips: stop loss in pips.
- TakeProfitInPips: take profit in pips.
- MaxBuyOrders: limit the number of buy orders. The maximum value of MaxBuyOrders is 5, since there are only 5 lines for opening buy orders. Suppose the MaxBuyOrders parameter is 2, and you draw 3 lines on the graph, for example, B1, B4, and B5. If the price first crossed the lines B4 and B5, 2 orders will be opened. Although the price then crossed the line B1, a new order is not opened.
- MaxSellOrders: similar to MaxBuyOrders.
- TrailStopLevelPipsBuy: the threshold for activating the trailing stop of buy orders.
- TrailStopLevelPipsSell: the threshold for activating the trailing stop of sell orders.
- DeleteLineAfterTrade: if true, the line is deleted immediately after the order is opened.
- EmailOn: in the case of a particular trading action (opening/closing orders), the Expert Advisor sends an email.
- AlertOn: if true, in the case of a particular trading action (opening/closing orders), the Expert Advisor displays a pop-up window. In addition to an email and a pop-up window, the Expert Advisor takes a snapshot of the chart in such cases. The image is saved in the MQL4Files folder.
[spoiler title=”Read More…”]
Note: B1_LOTS, B2_LOTS, etc. are initialized as a null value. They must be installed according to your requirements.
[/spoiler]