
Create EA (iCustom) with SMART MONEY BREAKOUT CHANNELS Scanner Indicator

a. The buffers in the indicator and their indexes:
MT5 buffer indexes:
MT4 buffer indexes:
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 = 5000;//Max Distance To Last Bar (0=All) input bool overlap = false; //Nested Channels input bool strong = true;//Strong Closes Only input double body_ratio = -100;//Body Ratio (%) (-100=OFF) - Only breakout if body >=? % bar input int length_ = 100;//Normalization Length input int length14 = 14;//Box Detection Length input int stdev_length = 14;//Stdev length input int ivol_type = 0;//Volume source /* Volume source: 0 - Tick Volume 1 - Real Volume */ input int smoothedvol_length = 20;//Smoothed volume length input int duration_length_min = 10;//Min duration length input ENUM_TIMEFRAMES tf = PERIOD_M1;//Volume Delta Timeframe Source input int iID_sc = 99;//ID (should use a different number than the one you used for the indicator already on the chart (if any))
c. iCustom:
MT4 Version 1.20:
double getValueBuffer(string fSymbol, //Symbol (fill _Symbol to use symbol current) ENUM_TIMEFRAMES fTimeframe, //Timeframe (fill PERIOD_CURRENT to use current timeframe) int fIndex, //index buffer (see section a) int fShift //Shift (usually = 1 to get the previous bar value) ) { string indicatorCustomName = "Market\\Smart Breakout Channels MT4";//Path indicator return iCustom(fSymbol, fTimeframe, indicatorCustomName, iMaxBarsBack, "", overlap, strong, body_ratio, length_, length14, stdev_length, "", false, 0, ivol_type, smoothedvol_length, duration_length_min, 1, tf, 0.5, false, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", false, false, false, false, false, false, "", "", false, "", 0, 0, "", false, 0, 0, 0, false, 0, 0, 0, 0, 0, 0, 0, 0, "", 0, iID_sc, fIndex, fShift); }
MT5 Version 1.20:
double getValueBuffer(string fSymbol, //Symbol (fill _Symbol to use symbol current) ENUM_TIMEFRAMES fTimeframe, //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\\Smart Breakout Channels MT5 Scanner";//Path indicator int handle = iCustom(fSymbol, fTimeframe, indicatorCustomName, iMaxBarsBack, "", overlap, strong, body_ratio, length_, length14, stdev_length, "", false, 0, ivol_type, smoothedvol_length, duration_length_min, 1, tf, 0.5, "", false, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", false, false, false, false, false, false, "", "", false, "", 0, 0, "", false, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", 0, iID_sc); 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 getValueBuffer function for EA
You use the getValueBuffer 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:
//--- int shift = 1; bool buySignal = getValueBuffer(_Symbol, PERIOD_CURRENT, 0, shift) != EMPTY_VALUE; bool sellSignal = getValueBuffer(_Symbol, PERIOD_CURRENT, 1, shift) != EMPTY_VALUE; //---Channel Info: //---when the signal appears, the channel is at a position away from the current position = shift (signal) + 1 int shift_channel = shift + 1; //MT5: double upperLevelMT5 = getValueBuffer(_Symbol, PERIOD_CURRENT, 8, shift_channel); double middleLevelMT5 = getValueBuffer(_Symbol, PERIOD_CURRENT, 9, shift_channel); double lowerLevelMT5 = getValueBuffer(_Symbol, PERIOD_CURRENT, 10, shift_channel); double upVolumeMT5 = getValueBuffer(_Symbol, PERIOD_CURRENT, 11, shift_channel); double dnVolumeMT5 = getValueBuffer(_Symbol, PERIOD_CURRENT, 12, shift_channel); double deltaVolumeMT5 = getValueBuffer(_Symbol, PERIOD_CURRENT, 13, shift_channel); //MT4: double upperLevelMT4 = getValueBuffer(_Symbol, PERIOD_CURRENT, 14, shift_channel); double middleLevelMT4 = getValueBuffer(_Symbol, PERIOD_CURRENT, 15, shift_channel); double lowerLevelMT4 = getValueBuffer(_Symbol, PERIOD_CURRENT, 16, shift_channel); double upVolumeMT4 = getValueBuffer(_Symbol, PERIOD_CURRENT, 17, shift_channel); double dnVolumeMT4 = getValueBuffer(_Symbol, PERIOD_CURRENT, 18, shift_channel); double deltaVolumeMT4 = getValueBuffer(_Symbol, PERIOD_CURRENT, 19, shift_channel);
Hopefully this article can help you more easily automate signals from the Smart Money Breakout Channels Scanner indicator into EA.
You can download the indicator at:
See more MT5 version at: Smart Breakout Channels MT5 Scanner
See more MT4 version at: Smart Breakout Channels MT4 Scanner