Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Re-Connections

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

    Strategy Re-Connections

    I'm trying to figure out how to set my strategy's start behavior so that when the strategy loses connection and reconnects it won't 1, cancel any open orders or 2, execute again and increase the position size.

    I've tried all 4 start behaviors and I've made sure of the following:

    To resume a strategy and ensure orders are not cancelled when the strategy is disabled.
    Ensure 'Cancel entry orders when a strategy is disabled' is unchecked and disabled
    Ensure 'Cancel exit orders when a strategy is disabled' is unchecked and disabled

    But it's still not working, what am I doing wrong?

    Thanks!!

    #2
    Hello GibbsB613,

    Thanks for opening the thread.

    If you would like to have your strategy resume if data has been reloaded or if the strategy has briefly been disabled, I would suggest to look into using Immediately Submit instead of the default Wait Until Flat start behavior.

    Immediately Submit will try to match any active orders that were made by the strategy, while Wait Until Flat will cancel any active orders that were previously made.

    I would suggest to review the documentation on syncing account positions for complete information on how these start behaviors work exactly. It's important to understand how these behaviors work when you decide to go live with your strategy. After reviewing the documentation, I would suggest to test the behaviors when disabling and re-enabling a simple strategy that can enter a position quickly. The reading can be a little dense, so testing the behaviors can provide a good visual.

    The SampleOnOrderUpdate strategy is a good example that can be used to test start behaviors quickly. You could to set the BarsRequired to 0 and apply it to a 5 second data series on the simulated data feed to get some quick entries. You can then disable and enable the strategy from the Control Center to trigger the start behavior as well as the cancel-on-disable behaviors.

    Syncing Account Positions is documented here: https://ninjatrader.com/support/help..._positions.htm

    SampleOnOrderUpdate strategy - http://ninjatrader.com/support/forum...ead.php?t=7499

    Here is a video I made demonstrating this behavior with the SampleOnOrderUpdate strategy as well: https://www.screencast.com/t/FUCm2zymF8Cd

    Please let me know if you have any questions.

    Comment


      #3
      Thanks, I'll give it another try, but I'm sure I tested that behavior.

      Comment


        #4
        I still cannot get it to work and I'm using a simple strategy.Can you check the attached strategy?

        Thanks!!
        Attached Files

        Comment


          #5
          Hello GibbsB613,

          Thanks for the reply.

          After testing, I can observe something is going wrong with your code. As we know that the behavior works properly in the SampleOnOrderUpdate strategy, we know the behavior works and we will need to troubleshoot your code to find out where the issue is coming from. As debugging client code is outside of our scope of services, I will not be able to do this for you.

          I would suggest to make an even simpler strategy using the Strategy Builder that closely resembles what you are trying to do, testing and then comparing with your version to see where the issue is coming from. I would suggest to comment out your lines of code that differ between the Builder's code to see if anything you are adding is causing issue when trying to match active orders.

          If you find something that sticks out that you believe to be an issue with NinjaTrader, please let me know.

          Comment


            #6
            Ok, I'll try but it seems to be pretty bare bones now.

            1. It opens a position.
            2. It updates the stop and limit.

            Thanks!!

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by NullPointStrategies, 03-13-2026, 05:17 AM
            0 responses
            93 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            152 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            80 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            53 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            65 views
            0 likes
            Last Post TheRealMorford  
            Working...
            X