Download MetaTrader 5
To add comments, please log in or register
Why to sell products in MetaTrader AppStore? Find that out from the article!
Electronaut
41
Electronaut 2010.09.13 17:28 
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
4917
Vladimir Batrudinov 2010.09.14 08:54  
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 2010.09.14 12:36  
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
11706
Rashid Umarov 2010.09.14 13:16  
/
To add comments, please log in or register