iCustom Buffer for Fractal

 

Hi Experts,


I am trying to get the values from the buffers from this indicator using iCustom with the following line:

input int               Bars_Before    = 5;              // Fractal Bars Before
input int               Bars_After     = 10;             // Fractal Bars Before

double FractalUP   = iCustom(NULL,Timeframe,"Fractal",Bars_Before,Bars_After,0,1);

However, when I do a print on the values, I am get the value=0 instead. 

      Print("Fractal Up=" + FractalUP);


Can any expert advise what i did wrong?

Files:
Fractal.ex4  11 kb
 
tango1983: Can any expert advise what i did wrong?
  1. Do you actually have a custom indicator named "Fractal", in the <dataFolder>\Indicators, that actually takes two parameters? iFractals doesn't.
              Data Structure in MetaTrader 4 Build 600 and Higher - MQL4 Articles 2014.02.03

  2. We have no idea what Timeframe is (type and value.)

  3. You are assuming that bar one was an up fractal; it wasn't. In fact if your asymmetric indicator actually exists, the latest fractal can only be on bar 11 or earlier (Bars_After=10.)
  4. Try mine.


Files: