Not tested or compiled. Just a suggestion that you may be able to use
externbool Trade_On_All_Market_Currencies=true;
string _Sympols[]; //Now _Sympols is declared as an array
Then in init as there is no need to run this code every tick.
intOnInit()
{
if(Trade_On_All_Market_Currencies)
{
int iCount=SymbolsTotal(false); // false, the function returns the number of all symbols.ArrayResize(_Sympols,iCount);
Print("Symbols Count: ",iCount);
int i;
for(i=0; i<iCount; i++)
{
_Sympols[i]=SymbolName(i,false);// false, the symbol is taken from the list of all symbols.
}
}
else//Just trade on symbols in the market watch window
{
int iCount=SymbolsTotal(true); // true, the function returns the number of symbols selected in MarketWatch.ArrayResize(_Sympols,iCount);
Print("Symbols Count: ",iCount);
int i;
for(i=0; i<iCount; i++)
{
_Sympols[i]=SymbolName(i,true);// true, the symbol is taken from the list of symbols selected in MarketWatch.
}
}
//---return(INIT_SUCCEEDED);
}
Then in the main code
int size=ArraySize(_Sympols);
for(i=0; i<size; i++)
{
string symbol_to_work_with=_Sympols[i];
////Code to work with the symbol//
}
Note that if you are working with symbols that or not in the market watch list, you may have to add them to the list to get price information etc.
This can be done with a function, but I rarely use it so I can't remember it, you will need to look in the documentation and find the function
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.
any help on a code that returns " Symbol" and adds it tho the Ordersend.it is a try to run the ea on many currencies by attaching it to one chart.
Here is my try but I do not know if it will work
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);
}
this code is nt working???..could u plz update it "whts wrong with the code"
tasaoirse: this code is nt working???..could u plz update it "whts wrong with the code"
string symbols[];
:
Sympol = symbols[i];
The array has zero length, so of course you get an array exceeded.
learntocode it, or pay (Freelance) someone.
We're not going to code it FOR you.
We are willing to HELP you when you post your attempt (using SRC)
and the nature of your problem.
Not tested or compiled. Just a suggestion that you may be able to use
Then in init as there is no need to run this code every tick.
Then in the main code
Note that if you are working with symbols that or not in the market watch list, you may have to add them to the list to get price information etc.
This can be done with a function, but I rarely use it so I can't remember it, you will need to look in the documentation and find the function
Thank you
could u plz help me as i m nt able to run the ea on multiple pairs (pairs listed in a broker by default)whn i attach th EA on one single chart..
is ther any easy code ??
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
string symbols[]; : Sympol = symbols[i];We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem.