If I need the price exactly at 9:00 AM everyday what will be the code. There is code below that you need to specify exact date. But I need that price in the indie everyday without changing the date. Can someone please specify the code for it.
Examples
// Check that its past 9:45 AM
if (ToTime(Time[0]) >= ToTime(9, 45, 00))
{
// Calculate the bars ago value for the 9 AM bar for the current day
int barsAgo = CurrentBar - Bars.GetBar(new DateTime(2006, 12, 18, 9, 0, 0));
// Print out the 9 AM bar closing price
Print("The close price on the 9 AM bar was: " + Close[barsAgo].ToString());
}
Thanks in advance
Comment