Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Duration of volume bar (in seconds)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Duration of volume bar (in seconds)

    Hello,

    What is the best way to calculate the duration in seconds of a volume based bar?

    My first inclination would be to subtract Time[1] - Time[0] and then convert that to an int.

    Is this the right way to go about this?

    If not, what is the proper way to do this?

    Thanks!

    #2
    Hello WalterSkinner,

    Thanks for your post.

    Yes, that would work.

    You have some options depending on what size of number you are looking for.

    (Time[0] - Time[1]).TotalMilliseconds;

    (Time[0] - Time[1]).TotalSeconds;

    (Time[0] - Time[1]).TotalMinutes;

    (Time[0] - Time[1]).TotalHours;

    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Rapine Heihei, Today, 08:25 PM
    0 responses
    3 views
    0 likes
    Last Post Rapine Heihei  
    Started by Rapine Heihei, Today, 08:19 PM
    0 responses
    1 view
    0 likes
    Last Post Rapine Heihei  
    Started by f.saeidi, Today, 08:01 PM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by Rapine Heihei, Today, 07:51 PM
    0 responses
    5 views
    0 likes
    Last Post Rapine Heihei  
    Started by frslvr, 04-11-2024, 07:26 AM
    5 responses
    96 views
    1 like
    Last Post caryc123  
    Working...
    X