questions about Custom Indicator

 

about Indicator

  • shall I draw two indicator lines by one Custom Indicator and make one indicator line is shown on chart window and the other line is shown on separate window.
  • when I have define an buffer array x[5]; and I want to use its values in EA by iCustom() to get all of these 5 values: x[0],x[1],x[2],x[3],x[4]. I know I can get these 5 values by 5 times calling iCustom(), but I think this style is not good because it will make computer do too much computing working. so shall we get the the 5 values by one time calling iCustom() ?
  • shall we see the codes of functions defined by MQL4 official, such as "iMAOnArray()"?
 
vx0532:

about Indicator

  • shall I draw two indicator lines by one Custom Indicator and make one indicator line is shown on chart window and the other line is shown on separate window.

If you want to use this Indicator visually you have to write 2 Indicators, an Indicator can output to the Chart Window OR the Separate window, not both. If you simply want to use thisIndicator with iCustom then both lines can be plotted to the Chart Window and you can get the correct values with iCustom()

vx0532:


  • when I have define an buffer array x[5]; and I want to use its values in EA by iCustom() to get all of these 5 values: x[0],x[1],x[2],x[3],x[4]. I know I can get these 5 values by 5 times calling iCustom(), but I think this style is not good because it will make computer do too much computing working. so shall we get the the 5 values by one time calling iCustom() ?

Create equivalent code in your EA and do not use the Indicator . . . or use 5 x iCustom() calls.

vx0532:
  • shall we see the codes of functions defined by MQL4 official, such as "iMAOnArray()"?

You can see the code for some iFuntions() already, look here: TA - Indicators
 
RaptorUK:

If you want to use this Indicator visually you have to write 2 Indicators, an Indicator can output to the Chart Window OR the Separate window, not both. If you simply want to use thisIndicator with iCustom then both lines can be plotted to the Chart Window and you can get the correct values with iCustom()

Create equivalent code in your EA and do not use the Indicator . . . or use 5 x iCustom() calls.

You can see the code for some iFuntions() already, look here: TA - Indicators


Thank you very much
Reason: