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 Hwop38, 05-04-2026, 07:02 PM
    0 responses
    152 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    305 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    244 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    345 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    176 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Working...
    X