To use the Follow Line Scanner indicator (ver.2.00 – free download at the end of the article) for EA, you can see the instructions below:
a. The buffers in the indicator and their indexes:
0 – Buy Signal (arrow)
1 – Sell Signal (arrow)
b. Required input parameters:
– To use iCustom, you need to fill in all the parameters, because the indicator uses a scanner, so the parameters need to be entered appropriately to avoid conflicts. Below are the required and mandatory input parameters, you can change their default values as you like:
input int iMaxBarsBack = 10000; input int ATRperiod = 5; input int BBperiod = 21; input double BBdeviation = 1.00; input bool UseATRfilter = true;
c. iCustom:
MT4 Version 2.00:
double getValueFollowLine(string fSymbol, ENUM_TIMEFRAMES Timeframe, int Index, int Shift ) { string indicatorCustomName = "Market\Follow Line MT4 with Scanner"; return iCustom(fSymbol, Timeframe, indicatorCustomName, iMaxBarsBack, ATRperiod, BBperiod, BBdeviation, UseATRfilter, true, "", 1, 1, 233, clrNONE, 234, clrNONE, "", false, false, false, false, false, false, "", "", false, "", 0, 0, "", false, 0, 0, 0, false, 0, 0, 0, clrNONE, clrNONE, clrNONE, clrNONE, clrNONE, "", 0, 0, Index, Shift); }
MT5 Version 2.00:
double getValueFollowLine(string fSymbol, ENUM_TIMEFRAMES Timeframe, int Index, int Shift ) { string indicatorCustomName = "Market\Follow Line MT5 with Scanner"; int handle = iCustom(fSymbol, Timeframe, indicatorCustomName, iMaxBarsBack, ATRperiod, BBperiod, BBdeviation, UseATRfilter, true, "", 233, clrNONE, 234, clrNONE, "", false, false, false, false, false, false, "", "", false, "", 0, 0, "", false, 0, 0, 0, false, 0, 0, 0, clrNONE, clrNONE, clrNONE, clrNONE, clrNONE, "", 0, 0); if(handle < 0) return(EMPTY_VALUE); else { double buf[]; if(CopyBuffer(handle, Index, Shift, 1, buf) > 0) return(buf[0]); } return EMPTY_VALUE; }
d. Use getValueFollowLine function for EA
You use the getValueFollowLine function to get the value needed to use for the EA.
To confirm that the buffer has a value, you need to compare it with EMPTY_VALUE.
Here are some examples to confirm that the previous bar buffers (shift = 1) have a value:
0 – Buy Signal (arrow)
bool buySignal = getValueFollowLine(_Symbol, PERIOD_CURRENT, 0, 1) != EMPTY_VALUE;
1 – Sell Signal (arrow)
bool sellSignal = getValueFollowLine(_Symbol, PERIOD_CURRENT, 1, 1) != EMPTY_VALUE;
Hopefully this article can help you more easily automate signals from the Follow Line Scanner indicator into EA.
You can free download the indicator at: