Download MetaTrader 5

CArrayDouble usage with iMAOnArray command

To add comments, please log in or register
Read the Forum and improve your rating!
imamushroom
157
imamushroom 2016.04.06 17:41 

Hi,

I'm using an CArrayDouble object to store some "double" values and I what to be able to use iMAOnArray on them but the compiler is complaining about a "parameter conversion not allowed" error.

Could someone tell me how I get the values from the CArrayDouble object ready for use with the iMAOnArray command please?

 Maybe I need to use a template but I've never used them or perhaps ArrayCopy or, in my view, a nasty for next loop into a dynamic array (yuk).

 Thanks in advance for you help! 

Alain Verleyen
Moderator
30707
Alain Verleyen 2016.04.06 19:03  
imamushroom:

Hi,

I'm using an CArrayDouble object to store some "double" values and I what to be able to use iMAOnArray on them but the compiler is complaining about a "parameter conversion not allowed" error.

Could someone tell me how I get the values from the CArrayDouble object ready for use with the iMAOnArray command please?

 Maybe I need to use a template but I've never used them or perhaps ArrayCopy or, in my view, a nasty for next loop into a dynamic array (yuk).

 Thanks in advance for you help! 

You can't do that easily unless you know OOP. iMAOnArray() needs an array of double type as parameter, but CArrayDouble object don't provide a way to access the internal data array.

So you will need to build your own class inheriting from CArrayDouble and add a method to access the data array.

imamushroom
157
imamushroom 2016.04.06 21:51  
Alain Verleyen:

You can't do that easily unless you know OOP. iMAOnArray() needs an array of double type as parameter, but CArrayDouble object don't provide a way to access the internal data array.

So you will need to build your own class inheriting from CArrayDouble and add a method to access the data array.

Thanks.

 

That's what I was worried about and had just started to write such an inhertitance. Could take me a while as I need to understand the CArray internals. heyho!!

 Thanks again for your response. 

To add comments, please log in or register