Help with iCustom problem

 

Hi all, I have a custom indicator and I want to use it in my EA. I saw the iCustom documentation but still failed to make it works. Below is my code for the iCustom function, can anyone help me?

        int shift = 0;
        double VWAPindicator = iCustom(Symbol(),PERIOD_M5,"VWAP Bands",20,0,0,0,2.5,0,0,shift);
Files:
VWAP_Bands.mq4  13 kb
 
Luandre Ezra: I saw the iCustom documentation but still failed to make it works. Below is my code for the iCustom function, can anyone help me?
  1. "Doesn't work" is meaningless — just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key, flat tires — meaningless.

    Do you really expect an answer? There are no mind readers here and our crystal balls are cracked.

  2. Help you with what? You haven't stated a problem

  3. Indicator
    iCustom
    
    input int N = 20;
    input int Shift = 0;
    input ENUM_APPLIED_PRICE Price_Type
    input double DeviationBand1 = 1;
    input double DeviationBand2 = 2;
    input double DeviationBand3 = 2.5;


    double VWAPindicator = iCustom(Symbol(),PERIOD_M5,"VWAP Bands",
    20,
    0,
    0,        ««« What Applied Price is that. Don't hard code constants.
    0,        ««« Override band 1 ?
    2.5,      ««« Override band 2 ?
    0,        ««« Override band 3 ?
    0,        ««« VWAP ?
    shift);

    You should encapsulate your iCustom calls to make your code self-documenting.
              Detailed explanation of iCustom - MQL4 programming forum #33 2017.05.23

 

Sorry if I don't give a detail explanation, what I mean by doesn't work the indicator would not return the correct price.

For the number in indicator (after the name of the indicator):
20 is the N
0 would be the shift
0 is the applied price, I had change this one before with PRICE_CLOSE but the indicator still isn't showed.
0 is for the deviation band 1 (I don't want to use it so I put 0 on it)
2.5 for the deviation band 2
0 for the deviation band 3
0 for the mode (I put it because in the iCustom doc there's mode) 

 
I already find the answer. I got the wrong mode number so it won't show the correct price.
Reason: