//+------------------------------------------------------------------+ //| loop through all symbols | //+------------------------------------------------------------------+ for(int i=0;i<SymbolsTotal(1);i++) { Print("SYMBOL: ",SymbolName(i,1)," Found At: ",i); // Do Something... } //+------------------------------------------------------------------+
social_junkie:
Hello,
I would like to run my EA on all Forex Majors and Forex Minors, I've got my code all done, but I want it to automatically run on all symbols in my market watch.
Short answer:
Replace NULL with intended symbol, then repeat for the next symbol
example double RSI = iRSI("EURUSD",15,7,PRICE_CLOSE,0);
it is enough to be an indicator
why you creating it as an EA?
Combine Marco and Mohamad above
//+------------------------------------------------------------------+ //| loop through all symbols | //+------------------------------------------------------------------+ for(int i=0;i<SymbolsTotal(1);i++) { Print("SYMBOL: ",SymbolName(i,1)," Found At: ",i); // Do Something... example double RSI = iRSI(SymbolName(i,1),15,7,PRICE_CLOSE,0); } //+------------------------------------------------------------------+
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
Hello,
I would like to run my EA on all Forex Majors and Forex Minors, I've got my code all done, but I want it to automatically run on all symbols in my market watch.
Here is my code, its very simple, can someone please help in showing me how I can make this run automatically on all Symbols or Symbols in my market watch
double RSI = iRSI(NULL,15,7,PRICE_CLOSE,0);
double Stoc = iStochastic(NULL,15,5,3,3,MODE_SMA,STO_LOWHIGH,0,0);
double BoliUpper = iBands(NULL,15,20,2,0,PRICE_MEDIAN,1,1);
double BoliLower = iBands(NULL,15,20,2,0,PRICE_MEDIAN,2,1);
double CandlePrevHigh = iOpen(NULL,15,1);
double CandlePrevLow = iClose(NULL,15,1);
if ((RSI > 75) && (Stoc > 80)&& (BoliUpper < CandlePrevHigh) )
{
Alert(Symbol()+" is over bought");
}
else if ((RSI < 25) && (Stoc < 20)&&(BoliLower>CandlePrevLow))
{
Alert(Symbol()+" is over sold");
}
=====================================================================================================================================================================================
Please help