Download MetaTrader 5

SymbolSelect()

To add comments, please log in or register
Mahmoud Farajpour
316
Mahmoud Farajpour  
How do i exactly use symbolselect function?
I used it this way it doesn't work

String pair="EURUSD";
SymbolSelect(Pair,true);
Alert (symbol());

 i use alert to see if the symbol is selected but i see it always alerts usdchf by default,
Please me with,  write the exactly code which select EURUSD symbol
Alain Verleyen
Moderator
29870
Alain Verleyen  
Please don't double or triple post.
Sergei Vladimirov
5020
Sergei Vladimirov  
mahmood0:
How do i exactly use symbolselect function?
I used it this way it doesn't work

String pair="EURUSD";
SymbolSelect(Pair,true);
Alert (symbol());

 i use alert to see if the symbol is selected but i see it always alerts usdchf by default,
Please me with,  write the exactly code which select EURUSD symbol
string pair = "EURUSD";

if(SymbolSelect(pair, true) == true)
   Alert ("EURUSD is selected successfully");
else
   Alert("EURUSD is not selected");
Mahmoud Farajpour
316
Mahmoud Farajpour  
Sergei Vladimirov:
The code you wrote returns true(either mine),
But if really eurusd is selected why does alert() still show eurusd?
I mean if you use Alert (Symbol());  instead of what you wrote, ot shows USDCHF
Mahmoud Farajpour
316
Mahmoud Farajpour  
Alain Verleyen:
Please don't double or triple post.
Ok sorry
Marco vd Heijden
Moderator
6138
Marco vd Heijden  
mahmood0:
The code you wrote returns true(either mine),
But if really eurusd is selected why does alert() still show eurusd?
I mean if you use Alert (Symbol());  instead of what you wrote, ot shows USDCHF

that is impossible.

there is no USDCHF to be found in the print commands.

   Alert ("EURUSD is selected successfully");
else
   Alert("EURUSD is not selected");


however if you mean

Alert(Symbol());

it will simply only alert the chart symbol.

so you use,

if(OrderSymbol()=="EURUSD")
 {
  Alert("EURUSD Selected");
 }


With OrderSelect() so not with SymbolSelect() it depends on what you are trying to do which is a mystery to me as of yet but it seems you are trying to select an order.

Jose Miguel Soriano
4584
Jose Miguel Soriano  
mahmood0:
How do i exactly use symbolselect function?
I used it this way it doesn't work

String pair="EURUSD";
SymbolSelect(Pair,true);
Alert (symbol());

 i use alert to see if the symbol is selected but i see it always alerts usdchf by default,
Please me with,  write the exactly code which select EURUSD symbol
SymbolSelect () selects a symbol in Market Watch, but Symbol() and other generic functions always are refers to the graphic symbol.
If symbolselect ("symbNom") == false you can not get price information of "symbNom"
To add comments, please log in or register