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

  • pstrusi
    replied
    Thanks a lot Chelsea for your help

    Best regards

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    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.

    Leave a comment:


  • pstrusi
    started a topic Optimizing processing time in milliseconds

    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.

Latest Posts

Collapse

Topics Statistics Last Post
Started by Shansen, 08-30-2019, 10:18 PM
25 responses
949 views
0 likes
Last Post NinjaTrader_BrandonH  
Started by JonesJoker, 04-22-2024, 12:23 PM
8 responses
41 views
0 likes
Last Post JonesJoker  
Started by timko, Today, 06:45 AM
0 responses
3 views
0 likes
Last Post timko
by timko
 
Started by Waxavi, 04-19-2024, 02:10 AM
2 responses
39 views
0 likes
Last Post poeds
by poeds
 
Started by chbruno, Yesterday, 04:10 PM
1 response
44 views
0 likes
Last Post NinjaTrader_Gaby  
Working...
X