To use the RSI Kernel Optimized indicator (ver.1.15) for EA, you can see the instructions below:
a. The buffers in the indicator and their indexes:
b. Required input parameters:
MT4 Version 1.15:
double getValueRSIKernelOptimized(string fSymbol, //Symbol (fill _Symbol to use symbol current) ENUM_TIMEFRAMES Timeframe, //Timeframe (fill PERIOD_CURRENT to use current timeframe) int Index, //index buffer (see section a) int Shift //Shift (usually = 1 to get the previous bar value) ) { string indicatorCustomName = "Market\\RSI Kernel Optimized MT4 with Scanner";//Path indicator return iCustom(fSymbol, Timeframe, indicatorCustomName, iMaxBarsBack, "", rsiLengthInput, rsiSourceInput, highPivotLen, lowPivotLen, "", activationThresholdStr, KDEKernel, KDEBandwidth, KDEStep, false, false, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", false, false, false, false, false, false, "", "", false, "", 0, 0, "", false, 0, 0, false, 0, 0, "", 0, clrNONE, clrNONE, clrNONE, clrNONE, clrNONE, clrNONE, clrNONE, "", false, 0, 0, false, 0, 0, 0, Index, Shift); }
MT5 Version 1.15 :
double getValueRSIKernelOptimized(string fSymbol, ENUM_TIMEFRAMES Timeframe, int Index, int Shift ) { string indicatorCustomName = "Market\\RSI Kernel Optimized with Scanner for MT5"; int handle = iCustom(fSymbol, Timeframe, indicatorCustomName, iMaxBarsBack, "", rsiLengthInput, rsiSourceInput, "", highPivotLen, lowPivotLen, "", activationThresholdStr, KDEKernel, KDEBandwidth, KDEStep, false, false, 0, 0, 0, clrNONE, 0, clrNONE, 0, clrNONE, 0, clrNONE, "", false, false, false, false, false, false, "", "", false, "", 0, 0, "", false, 0, 0, false, 0, 0, "", 0, clrNONE, clrNONE, clrNONE, clrNONE, clrNONE, clrNONE, clrNONE, "", 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 getValueRSIKernelOptimized function for EA
You use the getValueRSIKernelOptimized 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 = getValueRSIKernelOptimized(_Symbol, PERIOD_CURRENT, 0, 1) != EMPTY_VALUE;
1 – Sell Signal (arrow)
bool sellSignal = getValueRSIKernelOptimized(_Symbol, PERIOD_CURRENT, 1, 1) != EMPTY_VALUE;
2 – Bullish Dots
bool bullishDots = getValueRSIKernelOptimized(_Symbol, PERIOD_CURRENT, 2, 1) != EMPTY_VALUE;
3 – Bearish Dots
bool bearishDots = getValueRSIKernelOptimized(_Symbol, PERIOD_CURRENT, 3, 1) != EMPTY_VALUE;
5 – Rsi Value
double rsiValue = getValueRSIKernelOptimized(_Symbol, PERIOD_CURRENT, 5, 1);
12 – Bullish KDE
double bullishKDE = getValueRSIKernelOptimized(_Symbol, PERIOD_CURRENT, 12, 1);
14 – Bearish KDE
double bearishKDE = getValueRSIKernelOptimized(_Symbol, PERIOD_CURRENT, 14, 1);
Hopefully this article can help you more easily automate signals from the RSI Kernel Optimized indicator into EA.
You can download the indicator at: