Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

A few basic questions on order execution

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

    A few basic questions on order execution

    Hi,

    I have a few rather basic questions about the way NT handles orders in real life trading.

    Suppose I use the following code in my strategy:

    if( condition1 ) { EnterLong( 10 ); }
    if( condition2 ) { EnterShort( 10 ); }
    if( condition3 ) { ExitLong( 10 ); }
    if( condition4 ) { ExitShort( 10 ); }

    1) Suppose that condition1..4 take a long time to evaluate (and/or PC is slow) and a new pricetick comes in when still in the middle of evaluating these four statements. Are all conditions then still evaluated using the same 'tick' ?

    2) If yes, is this next tick qeued and then executed on all four conditions with some delay? Or is the tick dropped? Or...?

    3) What would happen in an extreme case when the PC can really not keep up? Would it drop ticks or would it qeue them until it runs out of buffer, or....?

    Of course I understand I need a decent PC that is fast enough for the scripts that I'm running. The questions above are just to understand how NT handles these conditions.

    4) Suppose condition1, 2 and 3 become true at the same tick. Is my understanding correct that NT will only send one order to my broker for going short 10 contracts? i.e. NT will cancel the enterlong and exitlong against eachother?

    5) Suppose condition1 is true during tick1. NT sends an order to my broker to go long 10 contracts. However, only 3 of them are filled. Then the next tick comes in, and on this tick condition1 becomes invalid. Will NT then automatically cancel the order for the remaining 7 contracts or will this order remain in place?

    6) Suppose condition1 is true during tick1. NT sends an order to my broker to go long 10 contracts. However, only 3 of them are filled. Then the next tick comes in, and on this tick condition2 becomes valid. How will NT handle this? Will I end up with 7 contracts short or 10 contracts short?

    Thanks

    #2
    a few basic concepts:
    - NT will not loose ticks, but the OS will buffer incoming tick
    - ticks are processed one after the other
    - don't know what will happen are you code completely blocks NT
    - please check out how exits are handled in the docs, this should cover most questions
    - NT only exits the actual position size, there is no "overexit" in case of partial fills on the original position

    Comment


      #3
      Based on the documentation, I think the answers should be:

      1) Yes, same tick

      2) Ticks are Qeued by OS

      3) Unclear if it totally blocks, but if the PC can keep up on the average, but ocasionally slows down because other programs running, then I guess it will catch up with the qeue and process the qeued ticks with some delay.

      4) Correct

      5) This is still not clear to me. Please explain

      6) I hope I would end up with 10 contracts short but I'm not sure. Please confirm.

      Thanks

      Comment


        #4
        5) NT will not try to cancel the market order at the end of the bar. Would be true for stop/limit orders though.
        6) Current position is close. Opposite position is entered at 10 lots.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by ScottWalsh, 04-16-2024, 04:29 PM
        7 responses
        34 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by cls71, Today, 04:45 AM
        0 responses
        3 views
        0 likes
        Last Post cls71
        by cls71
         
        Started by mjairg, 07-20-2023, 11:57 PM
        3 responses
        214 views
        1 like
        Last Post PaulMohn  
        Started by TheWhiteDragon, 01-21-2019, 12:44 PM
        4 responses
        546 views
        0 likes
        Last Post PaulMohn  
        Started by GLFX005, Today, 03:23 AM
        0 responses
        3 views
        0 likes
        Last Post GLFX005
        by GLFX005
         
        Working...
        X