aroonzackie: Hi, I am trying to get a confirmation filter for the correlated pairs with the Array. It is not taking the array . can you help debugging it? Example shows that I am looping through the correlated pairs and get a confirmation on their respective charts.
You are confusing arrays and strings.
string AUDCAD_SP[] = {"AUDSGD","AUDUSD","NZDUSD"}; // This is an array of 3 strings string ArraySymbol = Symbol()+ "_SP"; // This is a single string (not an array)
Example, current symbol is "EURUSD", then the following
string ArraySymbol = Symbol()+ "_SP"; // Result: ArraySymbol = "EURUSD_SP"
This is because "ArraySymbol" is declared as a single string and not as an array.
Hi,
I got this. Thanks. Is there an any other way to do this and get the same input from array?
I thought about it and couldn't get any leads.
aroonzackie #: I got this. Thanks. Is there an any other way to do this and get the same input from array? I thought about it and couldn't get any leads.
It's not quite clear what you are trying to do so this is just a sample of how to iterate through an array of symbols ...
bool Positive_Correlated() { string sSymbols[] = { "AUDSGD", "AUDUSD", "NZDUSD" }; int nSymbols = ArraySize( sSymbols ), nCount = 0; for( int i = 0; i < nSymbols; i++ ) { double dbMA140 = iMA( sSymbols[ i ], PERIOD_H1, 140, 0, MODE_EMA, PRICE_CLOSE, 1 ), dbMA80 = iMA( sSymbols[ i ], PERIOD_H1, 80, 0, MODE_EMA, PRICE_CLOSE, 1 ); if( dbMA80 < dbMA140 ) nCount++; }; return nCount == nSymbols; };
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi ,
I am trying to get a confirmation filter for the correlated pairs with the Array. It is not taking the array . can you help debugging it?
Example shows that I am looping through the correlated pairs and get a confirmation on their respective charts.