Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Time in position

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

    Time in position

    Hi,

    Is there an easy way to retrieve the time that a position has been open? Example: trade opened at 08:00, currently 11:15 .. Return 195 minutes.

    I know I could create variables and store but maybe NT has native support for this?

    Thanks

    #2
    Hello siroki,

    Thank you for your post.

    There is an average trade duration (http://www.ninjatrader.com/support/h...deduration.htm) but tracking the duration of an open position would need to be done manually.

    You can track the order filled via OnExecution() and then track the time using a variable and storing Time[0] at the time of fill. Then compare the variable for the time of fill against Time[0] to know the value of the duration of the position.

    For information on OnExecution() please visit the following link: http://www.ninjatrader.com/support/h...nexecution.htm
    For information on Time please visit the following link: http://www.ninjatrader.com/support/h...s/nt7/time.htm

    Please let me know if you have any questions.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    566 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    330 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    547 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    548 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X