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 CaptainJack, 05-29-2026, 05:09 AM
    0 responses
    51 views
    0 likes
    Last Post CaptainJack  
    Started by CaptainJack, 05-29-2026, 12:02 AM
    0 responses
    30 views
    0 likes
    Last Post CaptainJack  
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    99 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    177 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    170 views
    0 likes
    Last Post CarlTrading  
    Working...
    X