Announcement

Collapse
No announcement yet.

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 vantojo, Today, 09:32 AM
    0 responses
    4 views
    0 likes
    Last Post vantojo
    by vantojo
     
    Started by FelipeRXP, Today, 08:40 AM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by petedian, Today, 08:44 AM
    0 responses
    12 views
    0 likes
    Last Post petedian  
    Started by J0shTrader, Yesterday, 12:29 PM
    1 response
    2 views
    0 likes
    Last Post NinjaTrader_ChrisL  
    Started by bc24fl, Today, 08:07 AM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_ChrisL  
    Working...
    X