Login Page - Create Account

Support Board


Date/Time: Mon, 24 Feb 2025 01:22:09 +0000



Post From: reseting calculation every day

[2021-02-24 13:53:52]
User907968 - Posts: 833
SCDateTime TradingDayStartDateTime = sc.GetTradingDayStartDateTimeOfBar(sc.BaseDateTimeIn[sc.IndexOfLastVisibleBar]);

This is not a good idea, if you want the start of the current day, replace 'sc.IndexOfLastVisibleBar' with 'sc.ArraySize - 1', otherwise you might change the start date simply by scrolling the chart.

Also, as you are using evening session, 'sc.GetTradingDayStartDateTimeOfBar' will return the bar that corresponds to the globex open, not the cash open.

Take a look at this function - https://www.sierrachart.com/index.php?page=doc/ACSIL_Members_Functions.html#scIsDateTimeInDaySession, it may help.
Date Time Of Last Edit: 2021-02-24 14:00:05