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

Optimizing processing time in milliseconds

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

    Optimizing processing time in milliseconds

    Hi Ninjas

    NT platform does a great job running automated algoritms pretty fast, however I'm interested to optimize that process a little bit in my code, so a doubt rises for incoming tick by tick frame. Let's suppose that you have a decent internet connection, working with IB, a very fast PC and your strategy is working tick by tick:

    1. Approximately: how long ( in milliseconds ) does NT take for the whole process: from "Market Order signal triggered" until "Order filled received", meaning the complete round ? 100, 150, 200 milliseconds?

    2. If your Strategy triggered a new opposite order BEFORE that the last market order has been filled, will that situation create an overfill ?


    3. Which way could it be a faster code to process a comparison between variables :
    a) Using conditional sentences such as: IF .....THEN
    b) Substituting conditional sentences by a simple equation that has the same logic ?



    I'm pretty aware that NT is far from processing HFT algos but I'm trying to do my best.

    Thanks for your attention
    Last edited by pstrusi; 10-05-2016, 05:16 AM.

    #2
    Hello pstrusi,

    Order submissions are not timed. The amount of time it will take for the order to come back as accepted and then working depends on your internet speed and your computer speed.

    The faster your processor is, the faster orders can be prepared and submitted. The faster your internet and the closer your location to the servers of your broker, the faster order information can be transmitted and received.

    An overfill occurs if an order cancellation or order modification is sent and the order has already been filled or cancelled.

    Your description of an in-flight-execution (where change order or order cancellations are transmitted at the exact moment the order is filling on the exchange servers) is possible.
    Please see the help guide on the 'Risks of Electronic Trading with NinjaTrader' in the section 'In Flight Executions'.


    If NinjaTrader has not received a reply on an order, any further orders will be queued. If no information is received on an order, this will cause an error to appear in a popup in NinjaTrader.

    I'm not certain on the operations you are comparing, however, performing an if switch and doing a simple math operation are both likely to consume a single CPU cycle.
    I would recommend contacting a operating system engineer that would be able to further detail the exact amount of CPU caused by each operation type and variable byte size.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks a lot Chelsea for your help

      Best regards

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Christopher_R, Today, 12:29 AM
      0 responses
      8 views
      0 likes
      Last Post Christopher_R  
      Started by sidlercom80, 10-28-2023, 08:49 AM
      166 responses
      2,235 views
      0 likes
      Last Post sidlercom80  
      Started by thread, Yesterday, 11:58 PM
      0 responses
      3 views
      0 likes
      Last Post thread
      by thread
       
      Started by jclose, Yesterday, 09:37 PM
      0 responses
      7 views
      0 likes
      Last Post jclose
      by jclose
       
      Started by WeyldFalcon, 08-07-2020, 06:13 AM
      10 responses
      1,415 views
      0 likes
      Last Post Traderontheroad  
      Working...
      X