• 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.

  • NinjaTrader_Jim
    replied
    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.

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by chartish, Today, 04:43 PM
0 responses
7 views
0 likes
Last Post chartish  
Started by Trader17, Today, 04:07 PM
0 responses
4 views
0 likes
Last Post Trader17  
Started by GussJ, Today, 01:30 PM
2 responses
18 views
0 likes
Last Post GussJ
by GussJ
 
Started by GARZONJ, Today, 12:25 PM
3 responses
17 views
0 likes
Last Post NinjaTrader_PaulH  
Started by RandanAL, Today, 11:53 AM
1 response
13 views
0 likes
Last Post NinjaTrader_ChelseaB  
Working...
X