Support Board
Date/Time: Sat, 23 Nov 2024 21:52:34 +0000
[Programming Help] - How to access data of last trading day?
View Count: 187
[2024-07-15 14:53:00] |
User538264 - Posts: 26 |
I am using ASCIL programming to access bar wise data, I have to work with High and Low of the previous session, I can get the bar using the time and index of the bar using the time, but the problem arrives on Monday, that is I want to access the data of the last trading session which I can do by subtracting a day from the current date, but if it's monday then I have to subtract 3 days, even that works for me, but what about holidays? is there something by which I can get the date of the last trading session? like if Friday is Holiday and today is monday, and I want to get the data on 60 mins candles for the last trading session that would be thursday, so which is 4 days behind from monday, and it falls in the exception of subtracting 1 and 3 from the current date. So is there a function or way to get last trading days data, without opening two different charts that is daily and intraday
|
[2024-07-18 18:48:02] |
ForgivingComputers.com - Posts: 960 |
You can use Working with the SCDateTime Variables and Values: GetDayOfWeek() and on Monday go back day by day until you get to Friday. For holidays, this has been known to work: sc.CalculateTimeSpanAcrossChartBars() |
To post a message in this thread, you need to log in with your Sierra Chart account: