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.
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.
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
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 Expert Advisor for increasing (or opening) market positions. Allows specifying the desired risk, target and searching for the best open price and trade volume. It is included in the ActivePanel product.