Is there any other way of reading buffers? - page 2

Marco vd Heijden
Moderator
13429
Marco vd Heijden  
Tonny Obare:

So as long as you include 10 inputs in iCustom it will work okay?

If your default parameters are okay then you should be able to make the call without passing any but i can imagine that if you want to override the 150th parameter it could get a bit of a problem.

Drazen Penic
3225
Drazen Penic  
Tonny Obare:

So as long as you include 10 inputs in iCustom it will work okay?

You can include as many as you want, but they will be copied in order they are declared in the indicator.

If you add 10, 20, or 50 parameters to the iCustom call, they will be copied to the first 10, 20 or 50 input values of the indicator.

BTW, I don't know if there is any limit to the number of arguments in the MQL4 function call. 

William Roeder
24287
William Roeder  
  1. Tonny Obare: The indicator has 300 user input variables which will have to be included …
    As Drazen (#8) already explained, you can pass zero and default all, or pass 10 and default the rest, etc. You do not have to pass all of them.

  2. Drazen Penic: You can include as many as you want, 
    The maximum arguments in iCustom is 63. Maximum inputs in the tester is 1024.
              Does anyone know if there is a limit on number of inputs allowed in EA? - MQL5 programming forum 2020.05.06
Tonny Obare
129824
Tonny Obare  
Marco vd Heijden:

If your default parameters are okay then you should be able to make the call without passing any but i can imagine that if you want to override the 150th parameter it could get a bit of a problem.

Yes

Tonny Obare
129824
Tonny Obare  
William Roeder:
  1. As Drazen (#8) already explained, you can pass zero and default all, or pass 10 and default the rest, etc. You do not have to pass all of them.

  2. The maximum arguments in iCustom is 63. Maximum inputs in the tester is 1024.
              Does anyone know if there is a limit on number of inputs allowed in EA? - MQL5 programming forum 2020.05.06

Thanks for this info. Seems the best way is to just have the calculations in the  EA.

Alain Verleyen
41040
Alain Verleyen  
Tonny Obare:

Thanks for this info. Seems the best way is to just have the calculations in the  EA.

That's rarely a good idea. It's a false assumption that including the code in the EA will improve performance.

About parameters, you need to sort your indicators parameters to put the relevant ones at the top. Then as explained by Drazen, set the values of the ones that matters and let the other one with default values.

Marco vd Heijden
Moderator
13429
Marco vd Heijden  

It's perfectly fine to incorporate the calculation directly into an EA.

Especially when you do not need the visual representation on the chart but only the result of the formula over the last n bars.

You can do that without using any indicator at all and it's completely unnecessary to use iCustom calls. 

Documentation on MQL5: Technical Indicators / iCustom
Documentation on MQL5: Technical Indicators / iCustom
  • www.mql5.com
[in]  The name of the custom indicator, with path relative to the root directory of indicators (MQL5/Indicators/). If an indicator is located in a subdirectory, for example, in MQL5/Indicators/ [in] input-parameters of a custom indicator, separated by commas. Type and order of parameters must match. If there is no parameters specified, then...
Alain Verleyen
41040
Alain Verleyen  
Marco vd Heijden:

It's perfectly fine to incorporate the calculation directly into an EA.

Especially when you do not need the visual representation on the chart but only the result of the formula over the last X bars.

You can do that without using any indicator at all and it's completely unnecessary to use iCustom calls. 

It's a waste of time and made things more complicated for 0 benefit. (In most cases, there can also have exceptions).
Marco vd Heijden
Moderator
13429
Marco vd Heijden  
Alain Verleyen:
It's a waste of time and made things more complicated for 0 benefit.

That would depend on the application.

There are always drawbacks and benefits and sometimes it's not possible to call for an indicator because it isn't available on the target system.

And i disagree that it is a waste of time because by working with complex matters you gain understanding and knowledge is power.

nicholish en
2744
nicholish en  
Alain Verleyen:
It's a waste of time and made things more complicated for 0 benefit. (In most cases, there can also have exceptions).

I think when you include the code with the EA the IND is calculated using the same thread as the EA. I make that assumption because the EA is way slower when you bake in indicator code.