Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

reconstructing strategy position after disconnect or restart

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

    reconstructing strategy position after disconnect or restart

    Would it be theoretically possible, by periodically saving the ORDERS GRID in the control panel as a csv file, to reconstruct the strategy position later after restart? This would be done by having the strategy first read and parse the saved CSV file by copying into memory OnStartUp() the relevant order ID info and thereby reacquire control of the order, particularly targets and stops that were GTC?
    Alternatively, the strategy could write out Order Id information at execution time to a local file and read it back in on restart.

    Or is this prevented by manipulations of order status on the broker side.
    Broker in question is IB.
    Last edited by roland_nt; 03-25-2014, 10:44 PM.

    #2
    Hi Roland, I'm not aware of anything like that already implemented but think working back from the Executions would be most feasible. Which would bring up the question why not saving the position you have in realtime before shutting the instance down. For a disconnect scenario though the KeepRunning would also be an option which would mean the position would persist as no new instance is used and thus no historical part recalcuated. http://www.ninjatrader.com/support/h...sub=disconnect
    BertrandNinjaTrader Customer Service

    Comment


      #3
      reconstruct strategy position

      Bertrand:
      Thanks for reply.
      In the worst case of NT or CPU crashing, the Keep Running option will not suffice.
      There is also the case of re starting the strategy with a new version of the strategy code (that may have fixed a strategy coding bug). or modifying a parameter setting.
      In these cases it is important to not disturb existing orders but to also be able to adjust existing positions and orders as and when market conditions warrant.

      That is what I am trying to do, Thus my question about either saving the order states in an external file or using the ORDERS information to "revers engineer" the state just before crash or the state before restart with a new code version of the strategy.
      Last edited by roland_nt; 03-26-2014, 03:35 PM.

      Comment


        #4
        Understand Roland, thanks. You could perhaps introduce an input that would set if historical would be processed or not for your strategy, that you can control what historical strategy position is present. If you save the one you have and it crashes for any reason, you can inject the needed position historically and thus on starting up still be exactly in sync to the account you execute to. On liberal fills I would expect a limit order placed to give you exactly the spec'ed price so performance summaries should be still fine.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          hi bertrand

          roland is assisting me with my strategy, i read your response but am not sure it offers a solution to his previous questions.
          these are my needs:
          i trade stocks on one strategy with overnight positions.
          i am connected to IB and IQfeed-kinetick
          i want to close everything down each weekend after market close.
          when i start up my strategy again on sunday night my previous positions are no longer in my strategy?
          so in short, how do i ensure that my strategy picks up on monday from exactly where it left off on the friday, with same positions, working orders, dynamic orders.etc

          i am aware that most of NT clients are probably day traders but there must be a solution for traders holding positions?

          thanks

          jio

          Comment


            #6
            Jio, it offered thoughts what potentially could be done. There's unfortunately no 100% supported solution here for your scenario. If you restart the strategy instance it will recalculate it's positions coming from historical data, the outcome in terms of position and orders needed could be therefore different and thus you would need to sync to be able to continue with it. Our next major platform updated is expected to offer more flexible sync options in this regard.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Strategy restart

              following on from this thread - can a restarted strategy pick up existing positions via position.marketposition? or does that only refer to strategylevel data and not account level data?regards

              Comment


                #8
                Hello everington_f,

                Thanks for your post.

                Regrettably this is not possible with NinjaTrader 7. You do have some choices in how NinjaTrader syncs, please see: http://ninjatrader.com/support/helpG..._positions.htm

                In NinjaTrader 8 it is possible to adopt account positions: http://ninjatrader.com/support/helpG..._positions.htm
                Paul H.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by helpwanted, Today, 03:06 AM
                0 responses
                3 views
                0 likes
                Last Post helpwanted  
                Started by Brevo, Today, 01:45 AM
                0 responses
                7 views
                0 likes
                Last Post Brevo
                by Brevo
                 
                Started by aussugardefender, Today, 01:07 AM
                0 responses
                5 views
                0 likes
                Last Post aussugardefender  
                Started by pvincent, 06-23-2022, 12:53 PM
                14 responses
                242 views
                0 likes
                Last Post Nyman
                by Nyman
                 
                Started by TraderG23, 12-08-2023, 07:56 AM
                9 responses
                384 views
                1 like
                Last Post Gavini
                by Gavini
                 
                Working...
                X