Setting up a Custom Two Lines Cross indicator
The Two Lines Cross option allows you to add an external indicator to your algorithm.
You can see examples of Two Lines Cross indicators here: https://nnfxalgotester.com/help/two-lines-cross/
How the Two Lines Cross option works:
As you can see in the image below, the Two Lines Cross option can be used to include indicators as C1, C2, Volume, Exit or Continuation. Each function will use the same indicator differently, so:
- As Main Confirmation (C1) or Continuation Indicator: A BUY signal is created whenever the first element crosses over the second element, and a SELL signal is created whenever the second element crosses over the first element.
- As 2nd Confirmation (C2): A BUY signal is accepted when the indicator's first element is above the second element. And a SELL signal is accepted when the indicator's first element is below the second element.
- As Volume Indicator: A BUY or SELL signal is accepted when the indicator's first element is above the second element (trade zone = volume in the market). The signal is blocked if the indicator's first element is below the second element (no-trade zone = market without volume).
- As Exit Indicator: An Exit SELL signal (ie. to close a short position) is generated when the first element created by the indicator crosses above the second element. And an Exit BUY signal (ie. to close a long position) is generated when the first element created by the indicator crosses below the second element.
Two Lines Cross configuration:
To include a Two Lines Cross indicator, the indicator inputs, the indicator path and name and the two buffers representing the two lines created by the indicator must be placed in the "Indicator Parameters" section.
The buffer indicating the buy line must be placed first followed by the buffer representing the sell line.
You can see in the next image the configuration format for a Two Lines Cross indicator.
The indicator should be placed in MT4's indicators folder (MQL4\Indicators).
Pro tip: To reverse the operation mode, just switch the buffer positions, i.e. put the second buffer first and the first buffer second (for example, change from 1,2 to 2,1).