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

SIM101 Order and Account Handling

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

    SIM101 Order and Account Handling

    Hi,

    It is my understanding that when a stop loss or profit exit order is placed on a live account, in most if not all cases, the orders reside on the broker / exchange server and will be executed once the stop or limit prices are hit/exceeded. And the order will be executed even if the connection to the broker / exchange is broken, correct?

    If it is not a live account, but instead, the SIM101 account, we have two scenarios:

    1. Using a playback connection
    In this first scenario the order is not sent to the broker / exchange (obviously), but is handled within NT. Correct? If so, then if the connection is broken the order(s) will not get executed since there is no price feed to decide on whether the stops / limits have been reached. Correct?

    2. Using a live connection to my provider.
    In this scenario it is unclear to me where the orders reside. Are they still sent to the provider and will get executed if the connection is broken? Or are they stored / handled internally? Is the provider even aware of the existence of a 'SIM101' account? How does the provider know which account is in effect? Does the provider have its own SIM account different from NT's internal SIM101 account?

    Perhaps there is a document or reference available that explains how orders are routed / handled and how accounts are updated / managed under these scenarios.

    BTW, my strategy uses a totally unmanaged approach. It handles every aspect of order management. So this is why I am being very cautious and wanting to test all manner of anomalies and error conditions. But it seems that testing the behavior of my strategy under loss of connection would be totally different with a live connection and real account vs. live connection + SIM account vs. Playback connection + SIM account.

    Thanks,

    CJ


    #2
    Hello ChazJ,

    Thanks for your post.

    Sim101 and Playback accounts are both accounts simulated on your platform (not seen by your broker.)

    Orders submitted from the platform will be Accepted at the broker's order routing server and Working orders are at the exchange.

    Orders submitted to a simulation account (Sim101/Playback) will reside on your PC.

    If the connection is severed with an active live order, it will be at the broker/exchange and remain active.

    Your account is made available to you when you set up your connection. When you are connected, you will have access to Sim accounts to trade with realtime data, and you will have access to your live account. When you submit an order, you determine the account the order will be sent to in the order entry window. NinjaScript strategies are assigned an account when they are configured. NinjaTrader then dispatches the order to the broker through the broker's API.

    Differences between Sim101 and Playback would be minimal since orders are filled by the simulation engine. You may have variances between your data provider's data and Market Replay data, however.

    Where your orders reside - https://ninjatrader.com/support/help...rs_reside_.htm

    We look forward to assisting.
    JimNinjaTrader Customer Service

    Comment


      #3
      Thanks for the quick reply Jim.

      So let's see if I have this straight. If I am using a SIM account the orders are processed by the simulation engine regardless of whether my connection is Playback or Live. So in essence, the only difference between Playback and Live is where the Market data comes from (live market or historical data saved on the PC).

      This tells me that there is no way to test recovery from loss of a live data / account connection without actually using a live data / account connection with REAL MONEY! Correct?

      See, I am concerned about what will happen when a broken connection gets re-connected and a stop order I had placed, for example, had been executed while disconnected. Will I get OnOrderUpdate and OnExecutionUpdate events to inform my strategy that these orders executed while disconnected? Or do I need to examine the 'Account.Orders' collection to check the status of the orders I had sent earlier to the exchange? It also seems the answer to this question would depend on the option for 'On Connection Loss' handling.

      Thanks,

      Comment


        #4
        Hello ChazJ,

        Your understanding on playback and live is correct. The only minor corrections I would point out are that Sim is used on live connections for simulation trading and Playback only has access to the Playback account. Playback uses recorded historical data or recorded market replay data. Live connections load historical data and then update with realtime data. This is correct.

        This tells me that there is no way to test recovery from loss of a live data / account connection without actually using a live data / account connection with REAL MONEY! Correct?
        You can test using a paper trading account, which would be a demo account operated on a paper trading server. If you are trading futures on a NinjaTrader Continuum connection, a demo feed requested from CQG could be used to test the strategy and have orders submitted to the demo account provided with the CQG demo. The orders would be simulated outside NinjaTrader and your test you be apples to apples since it involves orders going through the same NinjaTrader Continuum connection. CQG limits demos to one 2 week demo per user per year. They can be requested at the link below.

        Free Live Data - https://ninjatrader.com/FreeLiveData

        If you set the strategy to KeepRunning and have a value for Disconnect Delay Seconds long enough to last the connection loss, then the order/execution/position updates will be read after the connection is re-established.

        Let us know if you have any additional questions.
        JimNinjaTrader Customer Service

        Comment


          #5
          Excellent. The demo account looks like what I need to test with.

          Thanks for all your help,

          CJ

          Comment


            #6
            hi,

            I am trying to place large orders on my SIM102 account and its giving me an exceeds limit error. How do I adjust the account to allow for larger orders?

            Click image for larger version

Name:	image.png
Views:	81
Size:	11.5 KB
ID:	1284644

            Comment


              #7
              Hello mrich0245,

              Please right click the Sim101 account at Control Center-->Accounts-tab and select 'Edit Account'. Increase the 'Max Position Size' setting or set it to zero and click OK. Also check that you have None selected for the risk template in the same account menu.
              JesseNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by f.saeidi, Yesterday, 02:09 PM
              3 responses
              18 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by Jltarrau, Today, 05:57 AM
              1 response
              5 views
              0 likes
              Last Post NinjaTrader_LuisH  
              Started by kujista, Today, 06:23 AM
              0 responses
              1 view
              0 likes
              Last Post kujista
              by kujista
               
              Started by traderqz, Yesterday, 04:32 PM
              1 response
              12 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Started by f.saeidi, Today, 05:56 AM
              1 response
              5 views
              0 likes
              Last Post Jltarrau  
              Working...
              X