UpDownTickTest_NT8.zip
I'm interested in using Chris snippet with yours
Yours shows these lines 143-150 of interest
double price = BarsArray[1].GetClose(whatBar);
// This is where we decide what index to use
int whatBar = useCurrentBar ? CurrentBars[1] : Math.Min(CurrentBars[1] + 1, BarsArray[1].Count - 1);
// This is how we get the right tick values
double volume = BarsArray[1].GetVolume(whatBar);
double price = BarsArray[1].GetClose(whatBar);
if (price > BarsArray[1].GetClose(whatBar - 1) || (price == BarsArray[1].GetClose(whatBar - 1) && up))
{
Chris's snippet of interest
private Stopwatch stopWatch = new Stopwatch();
protected override void OnMarketData(MarketDataEventArgs marketDataUpdate)
{
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Print(String.Format("{0:00}:{1:00}:{2:00}.{3:00}",
ts.Hours, ts.Minutes, ts.Seconds,
ts.Milliseconds / 10));
stopWatch.Reset();
stopWatch.Start();
}
How should I approach measuring the time span for price to change?
I checked how stopwatch timer work
But not sure how to apply this knowledge to current case
Comment