ICustom Questions MQL5

 

I have a few questions regarding when using using multiple custom indicators in the same EA.

1. When having called the two indicators on the OnInit(), will the buffers either be A or B?

/////OPTION A
CopyBuffer(indicator_1_handle,0,1,1,array_1);
CopyBuffer(indicator_2_handle,0,1,1,array_2);


/////OPTION B
CopyBuffer(indicator_1_handle,0,1,1,array_1);
CopyBuffer(indicator_2_handle,1,1,1,array_2);

2. Can the icustom function only work when placed OnInit() or can you use it in functions?

 

Well the answer is already on your pc. :)

Just place the text cursor on iCustom, press F1 and study the example. Here it is as well.

Documentation on MQL5: Technical Indicators / iCustom
Documentation on MQL5: Technical Indicators / iCustom
  • www.mql5.com
iCustom - Technical Indicators - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Carl Schreiber #:

Well the answer is already on your pc. :)

Just place the text cursor on iCustom, press F1 and study the example. Here it is as well.

Thank you for the reply but the documentation doesn;t answer my questions

 
Derrick Mutange:

I have a few questions regarding when using using multiple custom indicators in the same EA.

1. When having called the two indicators on the OnInit(), will the buffers either be A or B?

2. Can the icustom function only work when placed OnInit() or can you use it in functions?

You can place in functions, I use it and it works.

But its meant to be loaded on Oninit() only once, because its not good idea to load indicator on OnCalculate or OnTimer until its necessary

 
Arpit T #:

You can place in functions, I use it and it works.

But its meant to be loaded on Oninit() only once, because its not good idea to load indicator on OnCalculate or OnTimer until its necessary

Thank you what about my first question?

 
Derrick Mutange #:

Thank you for the reply but the documentation doesn;t answer my questions

Sure it does. Firstly you can see where to place iCustom and CopyBuffer!. Secondly, if you then place the cursor on CopyBuffer and press F1 you land in the doc. of CopyBuffer and there you can study the meaning of the parameter with which you call CopyBuffer, one is for the buffer number of the indicator.

As I said everything you need is already on your pc.

Documentation on MQL5: Timeseries and Indicators Access / CopyBuffer
Documentation on MQL5: Timeseries and Indicators Access / CopyBuffer
  • www.mql5.com
CopyBuffer - Timeseries and Indicators Access - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
Reason: