if (FirstTickOfBar)
{
DateTime startTime = DateTime.Now;
Print("first tick of bar: " + Close[0] + " at: " + startTime);
}
if (Bars.TickCount == 17)
{
DateTime stopTime = DateTime.Now;
Print("bar ends: " + stopTime);
TimeSpan duration = stopTime - startTime;
Print("seconds:" + duration.TotalSeconds);
//Console.WriteLine("milliseconds:" + duration.TotalMilliseconds);
}
so my question is: does anyone have any suggestions for allowing me to access the variable 'startTime' from the 1st if block while in the 2nd if block?

Comment