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, 04: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'.
    http://ninjatrader.com/support/helpG...trading_wi.htm

    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 WHICKED, Today, 04:10 PM
      0 responses
      7 views
      0 likes
      Last Post WHICKED
      by WHICKED
       
      Started by Trasss_Kenneth, Today, 01:49 PM
      2 responses
      38 views
      0 likes
      Last Post bltdavid  
      Started by Newtrader101, Today, 03:22 PM
      2 responses
      14 views
      0 likes
      Last Post Newtrader101  
      Started by johnMoss, Today, 01:43 PM
      5 responses
      39 views
      0 likes
      Last Post NinjaTrader_ChrisL  
      Started by qs121, Today, 12:24 PM
      2 responses
      46 views
      0 likes
      Last Post qs121
      by qs121
       
      Working...
      X