Start trading

Closed positions: get close price and time

Created at 12 May 2022, 09:04
cTrader Reddit
cTrader Discord
AL

Algo_Invest

Joined 19.03.2020

Closed positions: get close price and time
12 May 2022, 09:04


Hello,

How to get the close price and time of a closed position?

 

Thank you.


@Algo_Invest
Replies

amusleh
12 May 2022, 09:06 ( Updated at: 12 May 2022, 09:07 )

Hi,

A closed position is a deal/trade, you have to use either Positions.Closed event or History collection, the deal has both entry time and close time.


@amusleh

Algo_Invest
16 May 2022, 20:13

RE:

amusleh said:

Hi,

A closed position is a deal/trade, you have to use either Positions.Closed event or History collection, the deal has both entry time and close time.

Hi amusleh,

Thanks for your reply. It's working now! ????

One more question:

Is there a way to filter out from History collection the partial close trades only?

Thank you!


@Algo_Invest

amusleh
17 May 2022, 11:11

RE: RE:

ncel01 said:

amusleh said:

Hi,

A closed position is a deal/trade, you have to use either Positions.Closed event or History collection, the deal has both entry time and close time.

Hi amusleh,

Thanks for your reply. It's working now! ????

One more question:

Is there a way to filter out from History collection the partial close trades only?

Thank you!

Hi,

No, you can't filter historical trades by type of their close.


@amusleh

Algo_Invest
18 May 2022, 13:20

RE: RE: RE:

amusleh said:

ncel01 said:

amusleh said:

Hi,

A closed position is a deal/trade, you have to use either Positions.Closed event or History collection, the deal has both entry time and close time.

Hi amusleh,

Thanks for your reply. It's working now! ????

One more question:

Is there a way to filter out from History collection the partial close trades only?

Thank you!

Hi,

No, you can't filter historical trades by type of their close.

amusleh,

Okay, no worries. I'll create a counter for this inside Positions_Modified.


@Algo_Invest