To use the Machine Learning Adaptive Supertrend Scanner indicator (ver.2.00 – download link at the end of the article) for EA, you can see the instructions below:
a. The buffers in the indicator and their indexes:
b. Required input parameters:
MT4 Version 2.00:
double getValueMLAdaptiveSuperTrend(string fSymbol, ENUM_TIMEFRAMES Timeframe, int Index, int Shift ) { string indicatorCustomName = "Market\ML Adaptive SuperTrend MT4"; return iCustom(fSymbol, Timeframe, indicatorCustomName, iMaxBarsBack, "", atr_len, fact, "", training_data_period, highvol, midvol, lowvol, 0, 0, 0, 0, false, 0, "", false, false, false, false, false, false, "", "", false, "", 0, 0, "", false, 0, 0, 0, false, 0, 0, 0, 0, 0, 0, 0, 0, "", 0, "", false, 0, 0, false, 0, 0, 0, Index, Shift); }
MT5 Version 2.00:
double getValueMLAdaptiveSuperTrend(string fSymbol, ENUM_TIMEFRAMES Timeframe, int Index, int Shift ) { string indicatorCustomName = "Market\ML Adaptive SuperTrend MT5"; int handle = iCustom(fSymbol,Timeframe,indicatorCustomName,iMaxBarsBack,"",atr_len,fact,"",training_data_period,highvol,midvol,lowvol,0,0,0,0,false,false,1,"",false,false,false,false,false,false,"","",false,"",0,0,"",false,0,0,0,false,0,0,0,0,0,0,0,0,"",0,"",false,0,0,false,0,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 getValueMLAdaptiveSuperTrend function for EA
You use the getValueMLAdaptiveSuperTrend 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:
Hopefully this article can help you more easily automate signals from the Machine Learning Adaptive Supertrend Scanner indicator into EA.