EA works always on the wrong chart (USDCHF)

 

Hello to all of you guys,

 

This is my first message, I trade as hobby in free-time since 3 months ago on real account with good results (approx +80% profit ) and since 2 days I'm trying programming  EA (I just made few programs at the university lot of years ago  ).

 

Here some references: broker Fxpro,instant execution, MT4, demo account correctly working to test EA  .

 

Now, my problem :  When I start running EA immediatly on the trading terminal appear always the USDCHF chart anytime and EA get USDCHF prices instead EURUSD prices.

Of course before running the only open chart is EURUSD and in no place in EA is called  the USDCHF so I really don't understand why EA opens that symbol and I don't know how to solve it.

 

Anyone with more experience could kindly help me?

 

thank you

 
crazyfede:

Hello to all of you guys,

 

This is my first message, I trade as hobby in free-time since 3 months ago on real account with good results (approx +80% profit ) and since 2 days I'm trying programming  EA (I just made few programs at the university lot of years ago  ).

 

Here some references: broker Fxpro,instant execution, MT4, demo account correctly working to test EA  .

 

Now, my problem :  When I start running EA immediatly on the trading terminal appear always the USDCHF chart anytime and EA get USDCHF prices instead EURUSD prices.

Of course before running the only open chart is EURUSD and in no place in EA is called  the USDCHF so I really don't understand why EA opens that symbol and I don't know how to solve it.

 

Anyone with more experience could kindly help me?

 

thank you

Post your code here and only then someone would be able to help.
 

Thank Mirza Baig for the attention.

 

just solved placing

 

ChartSetSymbolPeriod(0,"EURUSD",0); 

 

in init function and now it works correclty with EURUSD

 
crazyfede:

Thank Mirza Baig for the attention.

 

just solved placing

 

ChartSetSymbolPeriod(0,"EURUSD",0); 

 

in init function and now it works correclty with EURUSD

Great !