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

Keeping pending orders live

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

    Keeping pending orders live

    Hi,
    If I have pending orders on my chart, what if I want to keep them live even I wanted to shut down my computer for some reason. That mean, when I restart my pc will the pending order will remain active? if no, how can I keep that live until I cancel it or it get filled?

    #2
    Hello asmmbillah,

    Thanks for opening the thread.

    While we don't recommend shutting down NinjaTrader while in an open position, NinjaScript strategies can be designed to keep those orders running, and resume an active position if the strategy config allows.

    There are additional overloads for the order methods in the Managed Approach to follow "isLiveUntilCancelled" rules. These rules can be used to make sure the order stays live until it is cancelled.

    Additionally, it is advised to check your NinjaScript settings in the options menu as well as looking into your start behaviors so that the strategy will not cancel those orders when the strategy is disabled or when the strategy is enabled.

    Wait Until Flat will cancel live orders that were previously generated by the strategy. Immediately Submit will use the historical data processed by the strategy upon enablement to determine if there are any live orders previously generated by the strategy that can match orders created from the historical data. Immediately Submit will then try to resume those orders.

    It is important to understand the intricacies of the Start Behaviors as well as the NinjaScript settings in the Options menu. I'll include publicly available documentation for further reading.

    isLiveUntilCancelled orders - https://ninjatrader.com/support/help...ancelledOrders

    EnterLongLimit() (see isLiveUntilCancelled overload as an example) - https://ninjatrader.com/support/help...rlonglimit.htm

    Start Behaviors (Important read!) - https://ninjatrader.com/support/help..._positions.htm

    NinjaScript Strategy Options - https://ninjatrader.com/support/help...riptProperties

    I strongly recommend testing these settings using live data and a Sim account or with the Playback connection to get a better idea on how they are intended to function.

    Please let us know if you have any questions on the material.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by andrewtrades, Today, 04:57 PM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by chbruno, Today, 04:10 PM
    0 responses
    5 views
    0 likes
    Last Post chbruno
    by chbruno
     
    Started by josh18955, 03-25-2023, 11:16 AM
    6 responses
    436 views
    0 likes
    Last Post Delerium  
    Started by FAQtrader, Today, 03:35 PM
    0 responses
    7 views
    0 likes
    Last Post FAQtrader  
    Started by rocketman7, Today, 09:41 AM
    5 responses
    19 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X