• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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.

    #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 nailz420, Yesterday, 08:38 AM
    2 responses
    11 views
    0 likes
    Last Post nailz420  
    Started by bouncetherubble, Today, 06:56 PM
    0 responses
    2 views
    0 likes
    Last Post bouncetherubble  
    Started by James108, Today, 06:09 PM
    0 responses
    5 views
    0 likes
    Last Post James108  
    Started by RandanAL, Today, 05:13 PM
    0 responses
    5 views
    0 likes
    Last Post RandanAL  
    Started by timko, Today, 05:06 PM
    0 responses
    6 views
    0 likes
    Last Post timko
    by timko
     
    Working...
    X