Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

IB overnight sync issue.. again

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

    IB overnight sync issue.. again

    Hi sorry but I could find a lot of threads about the problems maintaining account sync through a shutdown but no solutions? Hoping I missed something..
    Had a shut down last night and I have a lot of disparity between what NT thinks its doing and what is actually happening at the IB end.
    I see a few references to some unsupported code that would somehow write in the correct data a few bars back. Am I the only one still struggling with this?
    Thanks

    #2
    Hello cosmo,

    Just to clarify, is the issue that when the strategy is enabled, the script has the Account Sync set to true and the Account is not being properly synced to the strategy position?

    Is the issue, that the strategy is not resuming its previous position correctly?

    Are you syncing the account manually, running the script, and the next time the strategy is run the account is no longer in sync?


    For a strategy to resume, meaning resume using the position and any previously made orders, the 'On starting a real-time strategy' option must be set to 'Immediately submit live working historical orders' and the strategy must calculate historically exactly the same as it calculated live when last run. This means that you pretty much have to add 1 tick intra-bar granularity to the script. Last, in between the time the strategy was last shutdown and the time it is re-enabled, the script will download any missing historical data. If this data gives a single to close, alter, send an order, this will also cause the position to not match.

    If you are trying to have a strategy resume with the same position that it was closed with, can you confirm that the Immediately submit live working historical orders is enabled, the strategy has 1 tick granularity added and that the position was not changed in historical data between the time it was disabled and re-enabled?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Is the issue, that the strategy is not resuming its previous position correctly?
      Yes.

      Reality and what NT thinks are now not the same. Any solution from the NT end seems to involve changing reality to match NT's (mistaken) view of the reality. I'm afraid I can't do this as a solution.

      I am now flat on all positions so I need to:
      1) Make NT understand we are back to a flat position on everything before restarting the strategy, so no orders are put through immediately and no yellow out of sync symbols.

      2) In future find a way to tell NT, after a shutdown, what the REAL positions are - so Interactive Brokers data would be written in to NT's historical data a few bars before the first bar the strategy is running. That way it would always have the same position as reality at the start of a session.

      I've read dozens of threads on this overnight issue going back 5 years or more.. help here would be great.

      Comment


        #4
        Hello cosmo,

        The Strategy position and Account position are separate. This means that any manual orders placed with NinjaTrader or orders made outside of NinjaTrader will not affect the Strategy Position.
        https://www.youtube.com/watch?v=US9c...A140D7&index=7

        If the strategy calculates the same in real-time as it does historically using intra-bar granularity the script will resume its previous position (granted the position does not change due to the historical data).

        At this point, I'm not sure which behavior you are getting and what behavior you are looking for.

        When you mention
        "Reality and what NT thinks are now not the same. Any solution from the NT end seems to involve changing reality to match NT's (mistaken) view of the reality."
        Does this mean that the Account position does not match your brokers position?
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Thanks for the reply. As far as I've been told, if I don't lose the data feed - ever - I should be Ok. I'm going down that road and hopefully the inevitable day NT loses track of the real account position it won't hurt too bad.

          I've also disabled the strategy running on historical bars as per code from this forum. However it seems I now can't use the strategy for backtesting. Does that seem normal?
          Thanks

          Comment


            #6
            Hello cosmo,

            Adding a return so the script does not calculate historically does not cause your strategy to resume or sync. This causes your strategy to start flat. If your strategy is disabled and you are long 1 in your account, when the strategy is re-enabled, your strategy is flat and your account is long 1. They are not in sync.

            Yes, it is expected that backtesting would not work, as backtesting is what the chart does in historical data. A regular backtest and enabling a strategy are the same thing.

            The only way to resume a strategy is with Immediately submit live working historical orders and having the trades in historical match the trades that were made in real time. The best way for this to happen is to add 1 tick granularity to the script. This causes the backtest/loading on a chart to take longer but provides tick accuracy for order fills and calculations.

            If you are using Interactive Brokers, there is a required disconnect every 24 hours. Below is a link to a thread that discusses this.
            http://ninjatrader.com/support/forum...ead.php?t=2327
            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by geddyisodin, Today, 05:20 AM
            2 responses
            16 views
            0 likes
            Last Post geddyisodin  
            Started by hazylizard, Today, 08:38 AM
            0 responses
            5 views
            0 likes
            Last Post hazylizard  
            Started by Max238, Today, 01:28 AM
            5 responses
            42 views
            0 likes
            Last Post Max238
            by Max238
             
            Started by giulyko00, Yesterday, 12:03 PM
            3 responses
            12 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Started by habeebft, Today, 07:27 AM
            1 response
            14 views
            0 likes
            Last Post NinjaTrader_ChristopherS  
            Working...
            X