Download MetaTrader 5

iCustom Issue

To add comments, please log in or register
Hany Taha
25
Hany Taha  

Hi folks,

i'm working on an EA based on an indicator using 7 different internal indicators each one named FL1,FL2, ...  so i use ICustom fxn 

The issue is that one indicator (FL2) using 8 different lines (as indicated in attachment) all of them have the same name and value and when i use ICustom it refers me to the first line in FL2 while i need to use The last (thick) line

can anyone help ?

  double FL2_Upper = iCustom(Symbol(),PERIOD_CURRENT,"FL2",1,1);
  double FL2_Lower = iCustom(Symbol(),PERIOD_CURRENT,"FL2",2,1);


 

honest_knave
Moderator
2326
honest_knave  

It looks to me that you have multiple instances of the same indicator added to the chart, all with different settings.

So, you need to look at the settings for each of those instances and then make multiple iCustom calls with those settings.

whroeder1
15925
whroeder1  
  1. double FL2_Upper = iCustom(Symbol(),PERIOD_CURRENT,"FL2",1,1);
    This calls the indicator with default inputs. If you want to look at the others you must pass their inputs.
  2. You should write a self documenting function instead of calling iCustom directly, see Detailed explanation of iCustom - MQL4 forum
Hany Taha
25
Hany Taha  

Thnx honest_knave & whroeder1.

Both of you are right

I modified the code and it worked :D

  double FL2_Upper = iCustom(Symbol(),PERIOD_CURRENT,"FL2","All tf",63,0,5,1,1);
  double FL2_Lower = iCustom(Symbol(),PERIOD_CURRENT,"FL2","All tf",63,0,5,2,1);
To add comments, please log in or register