Login Page - Create Account

Support Board


Date/Time: Mon, 17 Jun 2024 07:20:25 +0000



[User Discussion] - BHCS_BAR_HAS_CLOSED

View Count: 1093

[2014-09-28 11:47:48]
Hendrixon - Posts: 130
I'm trying to time exactly how long a bar took to build and need to know when exactly this code will get executed:
if (sc.GetBarHasClosedStatus(sc.Index) == BHCS_BAR_HAS_CLOSED)
{
//code that gets current system time
}
I'm asking this cause there are situations when there are time gaps between last bar close and next/new bar open.
For example using 100 Ticks bar periodicity:
* When last bar counted the 100th tick [point A], its done... even though sc.Index still haven't advanced by +1.
* Next bar won't actually start forming right away, since SC needs to receive a new tick for that to happen. [we have a time gap]
* New Tick received so new bar starts forming. sc.Index gets advanced by +1. [point B]

Will the above statement execute at [point A] or [point B]?
Date Time Of Last Edit: 2014-09-28 12:46:37
[2014-09-28 14:01:57]
Sierra Chart Engineering - Posts: 104368
B
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account