Download MetaTrader 5

SymbolSelect()

To add comments, please log in or register
Have you found an interesting application? Publish it in Code Base - millions of traders will appreciate that!
Mahmood
75
Mahmood 2015.12.17 21:37 
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
Keith Watford
Moderator
9647
Keith Watford 2015.12.17 22:22  

What are you trying to do?

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

 Places a symbol in the Market Watch window if it is not already there.

Alert (symbol());

 gives a pop-up alert showing the chart symbol

The symbol in the 2 pieces of code are not related to each other 

Mahmood
75
Mahmood 2015.12.18 06:52  
GumRai:

What are you trying to do?

 Places a symbol in the Market Watch window if it is not already there.

 gives a pop-up alert showing the chart symbol

The symbol in the 2 pieces of code are not related to each other 

 

 

Thanks for responding...
My ea doesn't care about charts it just read trading signals from a txt file and open the trades...
For example the txt file says open a EURUSD buy...
So here my ea should select eurusd symbol in order to run orderSend function on that pair

All symbols i need are already exist on market watch, i need to select a specified one to make an order on
Keith Watford
Moderator
9647
Keith Watford 2015.12.18 07:26  
String pair="EURUSD";
Then you use the variable "pair" in your OrderSend etc.
Mahmood
75
Mahmood 2015.12.18 08:00  
GumRai:
Then you use the variable "pair" in your OrderSend etc.

May I ask your email? Or whatsapp number..
Mahmood
75
Mahmood 2015.12.18 08:10  
GumRai:
Then you use the variable "pair" in your OrderSend etc.

Didn't work
Each time i run my EA a default pair (usdchf) will appears and get active on chart
Keith Watford
Moderator
9647
Keith Watford 2015.12.18 08:23  
Mahmood000:

May I ask your email? Or whatsapp number..
Sorry, I'm not going to post my email here.
Keith Watford
Moderator
9647
Keith Watford 2015.12.18 08:24  
Mahmood000:

Didn't work
Each time i run my EA a default pair (usdchf) will appears and get active on chart

Then there is something wrong with your code.

Post your code and somebody may be able to help you. 

Mahmood
75
Mahmood 2015.12.18 08:27  
GumRai:

Then there is something wrong with your code.

Post your code and somebody may be able to help you. 


What you mean is:
OrderSend(eurusd,OP_buy,....); 
Right?
Didn't work

Keith Watford
Moderator
9647
Keith Watford 2015.12.18 10:22  
Mahmood000:

What you mean is:
OrderSend(eurusd,OP_buy,....); 
Right?
Didn't work

No, unless eurusd is the name of a string variable.

Symbol must be a string ie "eurusd "

Mahmood
75
Mahmood 2015.12.18 10:57  
Mahmood000:
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
Help...
123
To add comments, please log in or register