Support Board
Date/Time: Sat, 08 Feb 2025 05:56:00 +0000
Post From: A few basic ACSIL questions
[2020-06-24 23:46:17] |
Flipper - Posts: 65 |
So SCDateTime PriorDayCloseDateTime = sc.GetStartDateTimeForTradingDate(sc.GetTradingDayDate(sc.BaseDateTimeIn[sc.ArraySize - 1]) );
This give you a single (not array as you state) datetime value as a Double Working with the SCDateTime Variables and Values: SCDateTime Variables That Datetime value is the Datetime of the first Bar of the trading day. Which you have now set to PriorDayCloseDateTime. PriorDayCloseDateTime -= 1 * SECONDS;
This subtracts 1 second off that PriorDayCloseDateTime datetime variable. So now its not the start of current day but 1 second before. int PriorDayCloseDateTimeIndex = sc.GetContainingIndexForSCDateTime(sc.ChartNumber, PriorDayCloseDateTime);
Now this is taking the PriorDayCloseDateTime and finding the Bar Index that is the closest to the DateTime variable you have set above. PriorDayCloseValue = sc.BaseData[SC_LAST][PriorDayCloseDateTimeIndex];
Then you are using that index value to find the Close price of that bar. Which is of course yesterdays close.
|