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

Ninjascript Order Handling

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

    Ninjascript Order Handling

    I have an ninjascript which allows me to swing trade with trades occasionally going across 2 - 3 days. I would like to switch of my computer when the market is closed and restart the ninja script once the market reopens. What Ninjascript Order Handling options will allow me to to do that?

    Based on what I have read, it appears to be "Immediately Submit Live working historical orders, Sync Account Position = true"

    #2
    Please also indicate if there are any other settings I have take care of. For example, I would like my orders to be intact if I disable and and reenable my strategies. Additionally, I would like to know what would happen if I miss restarting my strategies? Will profit target and stop losses be intact in the market?

    Comment


      #3
      sandeshrai, correct you would want to use the Immediately Submit option then to have the strategy continue to manage the open positions you kept overnight - if the strategy position did not change due to the recalculation on restart, the sync should not be needed.

      Under Tools > Strategies > NinjaScript you can set Order Handling options, if you're not choosing to cancel the exit orders on script disablement > those could continue to rest in the market.
      BertrandNinjaTrader Customer Service

      Comment


        #4
        To continue this thread as I am facing the same problem, particularly with respect to system crash or connection drop types of situations.

        So is it fair to assume that, if there're open positions (from strategy of course) and there's a shutdown (either normal or crash), when the system restart later, it will be able to run through all the historical data, get into the current states, and sync with my account and compare the open positions with the current states. Assuming during the shutdown there's no human interactions on these open positions, then the system should be at the state as if the strategy is continuously running with no shutdown in between?

        How exactly the system will behavior for those 'catch up' actions since after restart, Ninjatrader does not know when/what is the state right before the shutdown?

        Let's assume yesterday 3:50pm a long position is issued by the strategy and successfully opened. Then a shutdown. The system restarts at 10:30am today, and at 10am there should be an exit call by the strategy on yesterday's long.
        How would Ninjatrader deal with such a scenario?

        Also since I assume Ninjatrader does not know when was the last time the strategy ran, how does Ninjatrader perform sync with my broker account's current open positions?

        Answers to those questions will have significant impacts to the design of a reliable auto-trading system.

        Thanks in advance.

        Comment


          #5
          Thanks for the post balancenv, the common situations your strategy would face and how they could be handled by the current sync options offered would be explained here in our guide - http://www.ninjatrader.com/support/h..._positions.htm

          To continue trading without sync or intervention, it needs to a 100% match for orders and position states.

          Generally the strategy will rerun through the historical part and come up then with a strategy position from historical data. So in your scenario, the strategy would have exited that historical long once the condition triggered. As it was restarted then later, the strategy would be flat, so depending on if you started with the auto sync option are market to reconciliate the strategy vs account position mismatch would be fired by NT.
          BertrandNinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by DavidHP, Today, 07:56 AM
          1 response
          5 views
          0 likes
          Last Post NinjaTrader_Erick  
          Started by kujista, Today, 06:23 AM
          3 responses
          8 views
          0 likes
          Last Post kujista
          by kujista
           
          Started by Mindset, Yesterday, 02:04 AM
          2 responses
          18 views
          0 likes
          Last Post NinjaTrader_RyanS  
          Started by f.saeidi, Today, 08:03 AM
          1 response
          5 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by samish18, 04-17-2024, 08:57 AM
          15 responses
          53 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Working...
          X