The problem is that the ea I am trying to code is looking for a very rare condition.
So I need to run it on as many symbols as possible to get better profit in shorter time.
void Symbols(bool only_main=false) { int iCount=SymbolsTotal(false); Print("Symbols Count: ", iCount); int i; for(i=0; i<iCount; i++) { string sSymbol=SymbolName(i, false); string desc=SymbolInfoString(sSymbol, SYMBOL_DESCRIPTION); } }
You can list the symbols available in MT4 like this above.
You can list the symbols available in MT4 like this above.
where in the code should I add the symbols?
Thank you
In your code you declare an array
string symbols[]
But you don't size it or assign any values to it.
So
Sympol = symbols[i];
this cannot do anything.
Read the documentation for StringSplit() as this will enable you to populate the array. This only needs to be done once and so can be done in init.
Once the array is populated, this
string CheckSympol( string Sympol ) { string symbols[]; string Sympol = "NONE"; for( int i=0; i<11; i++) // 11 is the maximum number to loop the condition and it equals the number of symbols to check. { Sympol = symbols[i]; } return (Sympol); }
will only return the last value in the array.
You can list the symbols available in MT4 like this above.
In your code you declare an array
But you don't size it or assign any values to it.
So
this cannot do anything.
Read the documentation for StringSplit() as this will enable you to populate the array. This only needs to be done once and so can be done in init.
Once the array is populated, this
will only return the last value in the array.
Thanks,
I will read the documentation of StringSplit() .
extern bool Trade_On_All_Market_Currencies=true; string _Sympols; // Function Call if (Trade_On_All_Market_Currencies){ _Sympols=Symbols(); } else _Sympols=Symbol(); //end of function call //Function string Symbols() { int iCount=SymbolsTotal(false); // true, the function returns the number of symbols selected in MarketWatch. If the value is false, it returns the total number of all symbols. Print("Symbols Count: ", iCount); int i; for(i=0; i<iCount; i++) { string sSymbol=SymbolName(i, false);// true, the symbol is taken from the list of symbols selected in MarketWatch. If the value is false, the symbol is taken from the general list. // string desc=SymbolInfoString(sSymbol, SYMBOL_DESCRIPTION); } return(sSymbol); }
and what about this : Modified from szgy74
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Dear all,
I need help to code an ea that checks the same conditions to open and close trades on as many symbols as it can from the symbols that the broker is dealing in, without opening their charts.
Here is my try but I do not know if it will work