Gold Symbol in EA for MT4

 

hi, i have written a simple EA which works nicely with Currency pairs namely EURUSD and GBPUSD with reasonable profits...im however not sure how to code the Symbol for Gold trading as the XAUUSD doesnt seem to work at all. appreciate if someone could advise the correct symbol to be used in the EA for gold trading.

thanks a lot guys

AJAY

 

You can only trade what your broker provides. Market info (control-M) -> right click -> show all. On IBFX the symbol is XAUUSD.

Why would you have to code for Gold. Your EA should not have hard coded things in it. Use Symbol(), Digits, Point, etc. and it trades whatever pair you put it on. No coding required.

 
WHRoeder:

You can only trade what your broker provides. Market info (control-M) -> right click -> show all. On IBFX the symbol is XAUUSD.

Why would you have to code for Gold. Your EA should not have hard coded things in it. Use Symbol(), Digits, Point, etc. and it trades whatever pair you put it on. No coding required.


Thanks for the info bro.

im trading with Broker (Admiral Markets), the Gold trade symbol does appear under market watch when i use their MT4 platform ..so i guess they must be offering it. However, when i attach the EA to the gold trade window it does not work. cant do any back test either. but works well on trade and backtest when i use the EA on currency pairs.....

i searched through the internet and thought perhaps XAUUSD might work ...

ok ...ill check with the broker on this........... thanks again and have a good day bro...

 

Remember, it's highly possible that a badly coded EA may work fine on currencies, but won't work on other instruments which can have different digits, lotsizes, lotsteps, etc..

Unless it has proper adjustment built in for such instruments, it won't work.

Reason: