Download MetaTrader 5

How can I pass an array to CopyBuffer function from within a class object?

To add comments, please log in or register
Electronaut
41
Electronaut  
I have tried hard but have not found a solution. I am creating a multi-currency advisor and want to have a stand-alone class object for each pair instead of a mess of functions on global scale.
Vladimir Batrudinov
4930
Vladimir Batrudinov  
Electronaut:
I have tried hard but have not found a solution. I am creating a multi-currency advisor and want to have a stand-alone class object for each pair instead of a mess of functions on global scale.
You want to create a separate class for each symbol?

I doubt that this is reasonable.

To get started, try to use existing examples, and standard class libraries for create their trading system.

Electronaut
41
Electronaut  
Interesting:
You want to create a separate class for each symbol?

I doubt that this is reasonable.

To get started, try to use existing examples, and standard class libraries for create their trading system.

It is not seperate class for each symbol it is a separate class object (of the same class) for each symbol. I think it is a good idea and the resulting code remains well organized and elegant even with high number of symbols traded at the same time. The only problem I have encountered so far is described above.  I have tried the following approach (inside class object):

int rsi_handle=iRSI(_Symbol,_Period,14,PRICE_CLOSE);

double rsi_buffer[];

if (!CopyBuffer(rsi_handle,0,0,3,double &rsi_buffer[]) Alert("RSI data could not be obtained!");


...and it does not work, maybe the reason is the dynamic array, but it should be possible to do it somehow.



Rashid Umarov
Admin
11993
Rashid Umarov  
To add comments, please log in or register