how to properly check if SL or/and TP is set?

Created at 05 Aug 2016, 19:41
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!
A1

a1112

Joined 24.03.2016

how to properly check if SL or/and TP is set?
05 Aug 2016, 19:41


Hello,

Sometimes the StopLoss is not set when opening a trade (quite less often the TakeProfit too), and these are like 10 pips away so nothing extreme there.

My question is, how do I properly check if SL/TP is in place when a trade is running? I don't need to check if they are set the correct distance away from entry price, only if they are running for now.

 

what I did for check was to

//
            bool isStopLossRunning;
            if (StopLoss != 0)
            {
                isStopLossRunning = true;
                Print("SL is in place");
            }
            else
            {
                Print("SL is NOT RUNNING");
            }
//

but I guess this is not quite the proper way to do it.

Also, IF one of them SL/TP is not running, how do I set them?

Thanks in advance.


@a1112
Replies

... Deleted by UFO ...

a1112
07 Aug 2016, 18:44

Looks perfect.

Thank you "lucian"


@a1112