Submit order with different Symbol from the instance

Created at 04 Sep 2014, 13:28
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!
OB

obial

Joined 03.09.2014

Submit order with different Symbol from the instance
04 Sep 2014, 13:28


Dear Support

 

I'd like to reuse the position.SymbolCode as the "Symbol" for a pending order placement, but I always get an error:

Error CS1503: Argument 2: cannot convert from 'string' to 'cAlgo.API.Internals.Symbol'

 

PlaceStopOrder(TradeType.Buy, position.SymbolCode, TargetVolume, buyOrderTargetPrice, Strategy1, TargetSLSS, position.EntryPrice, expirationTime, Strategy1);

 

Regards

 


@obial
Replies

Invalid
04 Sep 2014, 14:13

RE:

 

PlaceStopOrder(TradeType.Buy,  MarketData.GetSymbol(position.SymbolCode) TargetVolume, buyOrderTargetPrice, Strategy1, TargetSLSS, position.EntryPrice, expirationTime, Strategy1);

 

obial said:

Dear Support

 

I'd like to reuse the position.SymbolCode as the "Symbol" for a pending order placement, but I always get an error:

Error CS1503: Argument 2: cannot convert from 'string' to 'cAlgo.API.Internals.Symbol'

 

PlaceStopOrder(TradeType.Buy, position.SymbolCode, TargetVolume, buyOrderTargetPrice, Strategy1, TargetSLSS, position.EntryPrice, expirationTime, Strategy1);

 

Regards

 

 


@Invalid

obial
04 Sep 2014, 14:32

That worked like a charm.

Thanks


@obial