Login Page - Create Account

Support Board


Date/Time: Sat, 04 May 2024 03:12:31 +0000



Post From: how to get the last bar of a trading session

[2021-05-05 15:37:10]
User30743 - Posts: 364
how to get the last bar of a trading session?

for example, US futures ends at 15:15 on normal days so it is easy to close the position by hardcoding some previous time.

but what about days that have early close? Around 12:00 clock. How to deal with it?

I would like to have a systematic approach and never hold any positions over night, so I need to somehow get the last bar of current trading session and flat the position there, if it was not done earlier.

Ay ideas how to do it?