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

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.
    JimNinjaTrader Customer Service

    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.
          JimNinjaTrader Customer Service

          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 jaybedreamin, Today, 05:56 PM
            0 responses
            3 views
            0 likes
            Last Post jaybedreamin  
            Started by DJ888, 04-16-2024, 06:09 PM
            6 responses
            18 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by Jon17, Today, 04:33 PM
            0 responses
            1 view
            0 likes
            Last Post Jon17
            by Jon17
             
            Started by Javierw.ok, Today, 04:12 PM
            0 responses
            9 views
            0 likes
            Last Post Javierw.ok  
            Started by timmbbo, Today, 08:59 AM
            2 responses
            10 views
            0 likes
            Last Post bltdavid  
            Working...
            X