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

What is the standard strategy with opened position behaviour when Reload NinjaScript

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

    What is the standard strategy with opened position behaviour when Reload NinjaScript

    Hello.

    I searched for same threads, but find nothing.

    I made strategy.
    It open position and SetStopLoss().
    I click on chart and press F5.
    What we have after?

    Stop loss cancelled.
    Position remains opened.

    Is this expected behaviour?

    Can I do something to close positions and cancel all orders on Reload NinjaScript?

    I tried make something in State.Termination, but Positions object is null and all orders are null at this state.
    fx.practic
    NinjaTrader Ecosystem Vendor - fx.practic

    #2
    Hello fx.practic,

    Thanks for opening the thread.

    When you press F5, you reload the NinjaScript. The strategy will then reprocess historical data and then return to Realtime data. Associated orders with the strategy will be lose their association. We do not recommend reloading NinjaScripts while in an active strategy position. The strategy should be ready to perform when it is enabled live.

    There are some options that you can set that determine what should happen to entry and exit orders when a strategy is disabled.

    NinjaTrader offers Start Behaviors that allow your strategy to match orders created in the historical processing stage of the strategy with active orders on your account. Depending on the associated Start Behavior, your strategy could wait until it is in a flat position before submitting live orders, or it can use the historical data to match orders and resume managing its position. The behavior to match orders is inside the Immediately Submit behavior.

    It is important to understand that strategies manage their own virtual position separate from the live account position. This allows you to run separate strategies concurrently.

    Please take the time to review the documentation on Start Behaviors and Strategy Positions vs. Account Positions.

    Strategy Position vs. Account Position - https://ninjatrader.com/support/help..._positions.htm

    Start Behaviors (Syncing Account Positions) - https://ninjatrader.com/support/help..._positions.htm

    NinjaScript options (cancelling orders on disable) - https://ninjatrader.com/support/help...riptProperties

    Please let me know if I may be of further assistance.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by tsantospinto, 04-12-2024, 07:04 PM
    5 responses
    67 views
    0 likes
    Last Post tsantospinto  
    Started by cre8able, Today, 03:20 PM
    0 responses
    6 views
    0 likes
    Last Post cre8able  
    Started by Fran888, 02-16-2024, 10:48 AM
    3 responses
    49 views
    0 likes
    Last Post Sam2515
    by Sam2515
     
    Started by martin70, 03-24-2023, 04:58 AM
    15 responses
    115 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by The_Sec, Today, 02:29 PM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X