Download MetaTrader 5

iCustom get buffer mixed (or probably just the first value of another buffer???)

To add comments, please log in or register
Savoiardo
79
Savoiardo  

Hello,

I'm having a serious problem since 2 days in reading a custom indicator buffer with iCustom. Here's a screen:


I'm printing in the comment che values i get from iCustom, reading with 1 bar shift (the bar just closed) and it's giving me strange results. It reads a value from a buffer which has none, and it's also a different value from any other!

here's the snippet:

         shortCheck=iCustom(Symbol(),Period(),Nome_Indicatore+".ex4",....params....,0,1);
         longCheck=iCustom(Symbol(),Period(),Nome_Indicatore+".ex4",....params....,1,1);
         shortSignal=iCustom(Symbol(),Period(),Nome_Indicatore+".ex4",....params....,2,1);
         longSignal=iCustom(Symbol(),Period(),Nome_Indicatore+".ex4",....params....,3,1);                      
         Comment("CheckShort "+shortCheck+"\n"+
                 "CheckLong "+longCheck+"\n"+
                 "FinalShort "+shortSignal+"\n"+
                 "FinalLong "+longSignal);

I've reviewed the code from the indicator like 10 times, and also wrote it in a different manner, but the problem remains the same. Why are the buffer mixing??? Please give me a clue, it's getting me mad <.<

Savoiardo
79
Savoiardo  

My bad, was a parameter matter.


If anybody should come here next, when using iCustom, always check that the parameters you input are in the right number and type. There is no error message if you put the wrong number in, it just get you mad because you won't know if you've done right, until it works.

whroeder1
15900
whroeder1  
  1. Don't paste code
    Play video
    Please edit your post.
    For large amounts of code, attach it

  2. You don't need the +".ex4"
  3. You should write a self documenting function instead of calling iCustom directly, see Detailed explanation of iCustom - MQL4 forum
To add comments, please log in or register