How to get the close price of a closed position?

Created at 12 Jul 2016, 02:56
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!
GO

goldspanner

Joined 12.07.2016

How to get the close price of a closed position?
12 Jul 2016, 02:56


How can I get the close price of a closed position? The only thing I could find that could be it is the EntryPrice of the position that ClosePosition() returns, but now I'm not so sure.

Thanks


@goldspanner
Replies

Waxy
12 Jul 2016, 06:05

look it up with history, you can do:

            foreach (var hist in History)
            {
                if (hist.ClosingPrice == 1)
                {
                    //Do Stuff
                }
            }
            //
            HistoricalTrade _hist = History.FindLast("Label");
            Print(_hist.ClosingPrice);
            //
            HistoricalTrade[] _histlist = History.FindAll("Label");
            Print(_hist.ClosingPrice);

 


@Waxy

goldspanner
13 Jul 2016, 00:27

RE:

Waxy said:

look it up with history, you can do:

            foreach (var hist in History)
            {
                if (hist.ClosingPrice == 1)
                {
                    //Do Stuff
                }
            }
            //
            HistoricalTrade _hist = History.FindLast("Label");
            Print(_hist.ClosingPrice);
            //
            HistoricalTrade[] _histlist = History.FindAll("Label");
            Print(_hist.ClosingPrice);

 

Thanks! Much appreciated


@goldspanner