Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

New aproach: How to know the time of an entry order, even if I restart NT8 ?

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

    New aproach: How to know the time of an entry order, even if I restart NT8 ?

    Hello everyone,

    I need to know how to obtain the time of last entry order, even if I restart the NT8 or the desktop.

    I´m looking to use this information direct in my strategy. So, I need a instance that I can handling a DateTime variable. And the trade is not close: we just have the entry order.
    The final goal is to obtain MAE and MFE of the present position and the trade are not closed.​

    All sugestions are welcome !!


    #2
    Hello Eros Lima,

    Thanks for your post.

    You could consider saving the time (Time[0]) to a DateTime variable when the order is submitted.

    Or, you could consider saving the execution time to a variable by tracking the order in OnExecutionUpdate() and saving the time to a variable when the OrderState == OrderState.Filled.

    Note that the strategy would have to reprocess the order again if you restart NinjaTrader or the PC.

    See this help guide page for information about OnExecutionUpdate(): https://ninjatrader.com/support/help...tionupdate.htm

    And, see this reference sample demonstrating the use of OnExecutionUpdate(): https://ninjatrader.com/support/help...and_onexec.htm

    This thread will also be open to other community members to share their insights on the topic.
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      I'd use StreamWriter to save the info, then StreamReader to retrieve it.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Vitamite, Yesterday, 12:48 PM
      3 responses
      17 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by aligator, Today, 02:17 PM
      0 responses
      9 views
      0 likes
      Last Post aligator  
      Started by lorem, 04-25-2024, 09:18 AM
      22 responses
      94 views
      0 likes
      Last Post lorem
      by lorem
       
      Started by sofortune, Today, 10:05 AM
      3 responses
      16 views
      0 likes
      Last Post NinjaTrader_ChristopherJ  
      Started by ETFVoyageur, 05-07-2024, 07:05 PM
      23 responses
      185 views
      0 likes
      Last Post ETFVoyageur  
      Working...
      X