Symbol Interface - assigning a value to it

Created at 07 Jan 2015, 09:13
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
JA

jaideepc99

Joined 07.01.2015

Symbol Interface - assigning a value to it
07 Jan 2015, 09:13


Hi all,

I am trying to create a cAlgo BOT, which will run in a single chart only, and should be able to open trades for any currency pair (i.e for other charts)

Now, to open an order for another currency pair (rather than the currency pair of the current chart), I need to update the Interface Symbol, with my target currency pair. Then pass the Symbol to ExecuteMarketOrder API.

Something like Symbol.Code = "USDJPY", assuming that my BOT is running in "EURUSD" or any other chart.

However since Symbol.Code is read only, as such I am unable to understand how to pass my target currency pair?

Or maybe my query should be re-phrased as to how to open trades for different Symbols, other than the symbol for the current chart?

Thanks,


@jaideepc99
Replies

Invalid
07 Jan 2015, 15:26

Use MarketData.GetSymbol(string symbolCode)

ExecuteMarketOrder(TradeType.Sell,MarketData.GetSymbol("GBPJPY"), 1 000 000);

/api/reference/internals/marketdata/getsymbol-6503


@Invalid

jaideepc99
07 Jan 2015, 18:30

RE:

Thanks !!!

Invalid said:

Use MarketData.GetSymbol(string symbolCode)

ExecuteMarketOrder(TradeType.Sell,MarketData.GetSymbol("GBPJPY"), 1 000 000);

/api/reference/internals/marketdata/getsymbol-6503

 


@jaideepc99