Cannot get stoploss and takeprofit

Created at 05 Mar 2014, 16:21
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!
DV

dv007

Joined 05.12.2013

Cannot get stoploss and takeprofit
05 Mar 2014, 16:21


I want to get stoploss and takeprofit of position in  Position Opened Event but it null

private void PositionsOnOpened(PositionOpenedEventArgs args)
        {
            var pos = args.Position; 
            Print("TP: " + pos.TakeProfit.ToString() + ", SL: " + pos.StopLoss.ToString());
        }

It's bug?


@dv007
Replies

dv007
05 Mar 2014, 16:23

RE:

dv007 said:

I want to get stoploss and takeprofit of position in  Position Opened Event but it null

private void PositionsOnOpened(PositionOpenedEventArgs args)
        {
            var pos = args.Position; 
            Print("TP: " + pos.TakeProfit.ToString() + ", SL: " + pos.StopLoss.ToString());
        }

It's bug?

In position closed event, stoploss and takeprofit are available!


@dv007

Spotware
06 Mar 2014, 09:43

SL and TP are applied after position is opened. Positions.Opened event could be raised before protection is applied.


@Spotware