Create EA (iCustom) with VOLUMATIC VIDYA

Create EA (iCustom) with VOLUMATIC VIDYA

18 January 2025, 18:59
Duc Hoan Nguyen
0
346
To use the Volumatic VIDyA 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:
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;//Max bars back (0=all)
input int vidya_length = 10;//VIDyA Length
input int vidya_momentum = 20;//VIDyA Momentum
input double band_distance = 2;//Distance factor for upper/lower bands
input int source = 1;//Source
/*
Source value:
1-Close
2-Open
3-High
4-Low
5-Median (HL/2)
6-Typical (HLC/3)
7-Weighted (HLCC/4)
8-Average (OHLC/4)
*/
input int pivot_type = 1;//Pivot type
/*
Pivot type value:
0-Close/Close
1-High/Low
*/
input int pivot_left_bars  = 3; // Left side pivot bars
input int pivot_right_bars = 3; // Right side pivot bars
input int vidya_value_smooth_period = 15;//VIDyA value smoothing period
c. iCustom:

MT4 Version 2.10:

double getValueVolumaticVIDyA(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\\Volumatic VIDyA MT4";//Path indicator
  return iCustom(fSymbol,Timeframe,indicatorCustomName,iMaxBarsBack,"",vidya_length,vidya_momentum,band_distance,source,pivot_type,pivot_left_bars,pivot_right_bars,vidya_value_smooth_period,"",false,"",false,false,false,clrNONE,clrNONE,clrNONE,50,0,"","",false,false,"",false,false,false,false,false,false,"","",false,"","",0,"",false,0,0,0,false,0,0,0,clrNONE,clrNONE,clrNONE,clrNONE,clrNONE,"",0,0,
                  Index, Shift);
  }

MT5 Version 2.00:

double getValueVolumaticVIDyA(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\\Volumatic VIDyA MT5";//Path indicator
   int handle = iCustom(fSymbol,Timeframe,indicatorCustomName,iMaxBarsBack,"",vidya_length,vidya_momentum,band_distance,source,pivot_type,pivot_left_bars,pivot_right_bars,vidya_value_smooth_period,VOLUME_TICK,"","",false,false,false,clrNONE,clrNONE,clrNONE,50,0,false,"","",false,false,"",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 getValueVolumaticVIDyA function for EA

You use the getValueVolumaticVIDyA 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 current bar buffers (shift = 0) have a value:

0 – Buy Signal (arrow)

bool buySignal = getValueVolumaticVIDyA(_Symbol, PERIOD_CURRENT, 0, 0) != EMPTY_VALUE;

1 – Sell Signal (arrow)

bool sellSignal = getValueVolumaticVIDyA(_Symbol, PERIOD_CURRENT, 1, 0) != EMPTY_VALUE;

Check Is Trend Up (Green)/Is Trend Down (Red):

   bool trendUp = false;
   bool trendDn = false;
   for(int i = 0; i <= iBars(_Symbol, PERIOD_CURRENT); i++)
     {
      if(getValueVolumaticVIDyA(_Symbol, PERIOD_CURRENT, 0, i) != EMPTY_VALUE)
        {
         trendUp = true;
         break;
        }
      if(getValueVolumaticVIDyA(_Symbol, PERIOD_CURRENT, 1, i) != EMPTY_VALUE)
        {
         trendDn = true;
         break;
        }
     }

Hopefully this article can help you more easily automate signals from the Volumatic VIDyA  Scanner indicator into EA.

You can download the indicator at:

MT5 version at: Volumatic VIDyA MT5

MT4 version at:  Volumatic VIDyA MT4