NT script for length of time for vol bars

Discussion in 'Strategy Building' started by bmwhendrix, Mar 24, 2011.

  1. I am a simpleton at programming, but I know what I want to see.
    I want to see the time it takes for a volume bar to complete expressed as you would normally see volume expressed on a time bar chart. Seems that it is something that must be out there somewhere.

    Guidance appreciated.
     
  2. I know there is one of the charting programs out there that offers a timer for the volume bars but I'm not sure which one.

    You do understand that the smaller the volume bar on a more liquid/volatile market/chart the faster they will complete. Sort of like timing an arrows release to it's target.

    I've yet to understand the reason why one would want to time the start of a bar's creation to the completion of the bar. Maybe you can offer me a lucid answer? I can understand a little bit for wanting to know the time in regards to swing or position trading volume bars because of how slow they complete.

    Thanks.
     
  3. I also do not know the reason for wanting to know the start time of a volume bars creation. My use would be to view the varying time bars like inverted volume bars on a time chart. I am not looking for a constant indicator of beginning-end of bar completion, rather the length of time expressed as a variable bar for the completion of the volume bar.
     
  4. if you mean NinjaTrader script, maybe something like

    if (!FirstTickOfBar && DateTime.Now.Second != last_second)
    {
    seconds++;
    last_second = DateTime.Now.Second;
    }
    else if (FirstTickOfBar)
    {
    seconds = 0;
    last_second = DateTime.Now.Second;
    }

    and plot the seconds as Bar.

    Not sure it will compile since I'm not running NT right now. Even if it works, it would only run on live data, so you wouldn't see history bars.
     
  5. Oh I get it, like speed.
    Interesting.
     
  6. Yeah. The only reason to look at it that way is for pacing.