Timestamps for Trades

Custom indicators, trading strategies, data export and recording and more...
rickbarlow
Posts: 43
Joined: Mon Feb 08, 2021 5:37 pm
Been thanked: 1 time

Timestamps for Trades

Post by rickbarlow » Mon Feb 08, 2021 11:17 pm

I am implementing the TradeDataListener and the HistoricalDataListener to get a list of all the trades that have happened. TradeInfo does not provide the actual timestamp of the trade that took place. How do I obtain the actual time of the trades? I've not been able to glean this from any of the api documentation or sample code. Thank you.

Andry API support
Posts: 548
Joined: Mon Jul 09, 2018 11:18 am
Has thanked: 25 times
Been thanked: 85 times

Re: Timestamps for Trades

Post by Andry API support » Tue Feb 09, 2021 8:26 am

Hi,
implement TimeListener and store the t value (nanoseconds) in a variable. Read the variable value when onTrade method is triggered.

rickbarlow
Posts: 43
Joined: Mon Feb 08, 2021 5:37 pm
Been thanked: 1 time

Re: Timestamps for Trades

Post by rickbarlow » Thu Feb 11, 2021 11:50 pm

Thank you!

Post Reply