I have a Trading Panel that, besides other stuff, has two buttons; the first sets the current chart to the next symbol in the MarketWatch, whilst the other sets the current chart to the previous symbol.
The code of both functions starts like this:
As you can see here, there's no USDJPY in the MarketWatch. However, when I click any of the buttons, it'll at some point select and set the chart to symbols that are not in the MarketWatch list.
Also, note that I have 7 symbols, but the print statement reveals that SymbolsTotal() function returns more than 7:
I tried deleting the symbols/ticks/history folders inside /bases/broker_server_folder/, but it didn't work.
What am I missing here?
No. As far as I know, the only way to remove a symbol programatically is calling SymbolSelect, right? My EA never calls that anywhere. That function only calls SymbolsTotal, SymbolName and ChartSetSymbolPeriod.
Just to make it a little bit more clear on the function code:
void OnClickPrevBtn() { int total=SymbolsTotal(true); string symbols[]; ArrayResize(symbols, total); for(int i = 0; i < total; ++i) { string name=SymbolName(i, true); for(int n = 0; n < total; ++n) { /*inserts symbols in alphabetical order*/ if(StringLen(symbols[n])==0) { symbols[n]=name; break; } if(name < symbols[n]) { for(int j = total-1; j > n; j--) { symbols[j]=symbols[j-1]; } symbols[n]=name; break; } } } for(int i = total-1; i > 0; --i) { if(_Symbol==symbols[i]) { ChartSetSymbolPeriod(0, symbols[i-1], PERIOD_CURRENT); return; } } ChartSetSymbolPeriod(0, symbols[total-1], PERIOD_CURRENT); }
I have a Trading Panel that, besides other stuff, has two buttons; the first sets the current chart to the next symbol in the MarketWatch, whilst the other sets the current chart to the previous symbol.
The code of both functions starts like this:
As you can see here, there's no USDJPY in the MarketWatch. However, when I click any of the buttons, it'll at some point select and set the chart to symbols that are not in the MarketWatch list.
Also, note that I have 7 symbols, but the print statement reveals that SymbolsTotal() function returns more than 7:
I tried deleting the symbols/ticks/history folders inside /bases/broker_server_folder/, but it didn't work.
What am I missing here?
There can be hidden symbols in the Market, they are automatically selected by the platform mainly for the calculation of positions margin and profit.
You can filter them :
for(int i = 0; i < total; ++i) { string name=SymbolName(i, true); if(!SymbolInfoInteger(name,SYMBOL_VISIBLE)) { printf("%s selected in Market Watch but not visible.",name); continue; } ... }

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I have a Trading Panel that, besides other stuff, has two buttons; the first sets the current chart to the next symbol in the MarketWatch, whilst the other sets the current chart to the previous symbol.
The code of both functions starts like this:
As you can see here, there's no USDJPY in the MarketWatch. However, when I click any of the buttons, it'll at some point select and set the chart to symbols that are not in the MarketWatch list.
Also, note that I have 7 symbols, but the print statement reveals that SymbolsTotal() function returns more than 7:
I tried deleting the symbols/ticks/history folders inside /bases/broker_server_folder/, but it didn't work.
What am I missing here?