Please see code below. I have written code that searches in real-time ALL available markets in MetaTrader and returns their lowest price from the last 10 bars (1 hour period) as an Alert. It is working however the “Alert” results are shown individually for each market. I need ALL the results in ONE Alert. How do I approach this? The number of markets is very large and their number can change. As such, flexible code code is required. I suspect some kind of variable Array or Enum may be a solution (correct me if I am wrong) but I am unsure how to approach this. Could you kindly point me in the right direction? Thanks in advance for the help and feedback.
extern string Input_Period = PERIOD_H1;
extern int User_Specified_Bars = 10; // Enter a total number of bars.
int start()
{
string SymbolLow;
for (int i = SymbolsTotal(false); i > 0; i--)
{
SymbolLow = StringConcatenate(
SymbolName(i,false),
" LOW: ",iLow(SymbolName(i,false),Input_Period,iLowest(SymbolName(i,false),Input_Period,MODE_LOW,User_Specified_Bars,0))
);
Alert (SymbolLow);
}
return (0);
}