Download MetaTrader 5

Set Chart Symbol?

To add comments, please log in or register
SteelAce
203
SteelAce  
It is still bit boring that when I run some script, then new chart is opened. Good is that now I can change how it looks like with ChartSetInteger() command, but I cannot choose chart symbol (EURUSD,USDCHF,USDJPY e.t.c) at beginning. I can only read that symbol with ChartSymbol() command. Is it somehow possible to Set Chart Symbol at chart starting (or before start)? Really things are so bad, that I cannot change running chart symbol even manually, so if anybody knows how to change it whatever way it is already step forward. Of course I need it because my tradingrobot is making OrderSend() commands and it is nice when it's MqlTradeRequest symbol is coincident with current chart symbol for better overview.
Biantoro Kunarto
18400
Biantoro Kunarto  

Please try this:

ChartOpen("EURUSD",PERIOD_W1);

That command will open new chart EURUSD with weekly period

SteelAce
203
SteelAce  
biantoro:

Please try this:

That command will open new chart EURUSD with weekly period

When I use  ChartOpen("EURUSD",PERIOD_W1); under OnInit() code of my script it just opens next chart and chart where are my form and script stays as fool as it was. Maybe to write it somewhere else but where? I am afraid that it is not overall helpful, sorry.
Biantoro Kunarto
18400
Biantoro Kunarto  

Ok, then use this :

ChartSetSymbolPeriod( 0,"EURUSD",0);

That will change your chart to EURUSD

SteelAce
203
SteelAce  
biantoro:

Ok, then use this :

That will change your chart to EURUSD

Yess yess yess!!! It works!!!
To add comments, please log in or register