I am looking for indexing bars from 4:00 PM at previous day to 1:00 AM today. I have no problem is doing it within a month. But I cannot find an automatic way to go over month boundary and year boundary by using DateTime methods/functions. Any suggestions?
DateTime EndTime = new DateTime(Time[0].Year, Time[0].Month, Time[0].Day, 1, 00, 00);
DateTime StartTime = new DateTime(Time[0].Year, Time[0].Month, Time[0].Day-1, Time[0].Hour+15, 00, 00);
int LookBack = GetBar(StartTime) - GetBar(EndTime);
Comment