Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Order Handling Questions...

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

    Order Handling Questions...

    Hello folks,

    as my trade manager started doing crazy things during fast markets, I realize I need better order handling. So, some questions:

    * Given a signal has a stop and target order, what is the FASTEST way and most SAFE way to close it so that I per definition can not get leftover contracts?

    Basically, I can not just issue "cancel" on both and a sell order - then I have a chance that not only my sell is executed, but in the time it takes until the orders are cancelled, one of the target/stop orders may also trigger, leaving me with leftover contracts. So far, it looks to me like the only really safe way is to get rid of both (cancel), wait for the cancelled state to be reached, and then issue a market close order for the amount I got reported. I would like something a little faster...

    * What happens in the case of an OverFill? I mean, I can track them. But how can I get rid of the surplus items? Example:
    - Long 3 contracts
    - Stop to sell 3
    - Market order to sell 3
    Somehow both get triggered, leaving me with -3 positions (three short) on the signal name. How can I legally close them without your order handling getting in my way? What do I order here? CloseLong (the original), or CloseShort (the new proper direction)? I have the code to track that, but I have no clue how to close them.

    * Is there any way to get a list of signals your logic knows as well as what your logic think the position for that signal would be?

    #2
    1. Modify target down below the market to ensure a market fill.
    2. ExitShort(). If Position.MarketPosition says its Short then you close short. If it says you are long then you close long.
    3. No way to get a list of signal names. Position.MarketPosition gives you what the strategy thinks the position direction is and Position.Quantity gives you what size it thinks it is.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Re:

      2: - want to avoid those Problem is.... this IS prone to overfill, too, and if I do 90%, I can as well go to doing 100%.

      1: ok, that IS better. I can cancel the stop, then move the limit target order to something on the other side. Agreed.

      3: Pretty beginner mistake in API design, isn't i? I can define Singal names, and you must track internally what position is assigned to a signal (otherwise you could not know what to close), but somehow someone forgot to expose all that to the poor user. I have about 5 pages Trade Manager code here by no that SIMPLY is based on this - hm - little glitch from whoever was the architect on your side I find that funny.

      Comment


        #4
        2. Not sure I follow.

        3. If you want to keep track of things you need to use IOrders and keep track of them yourself. That is why IOrders exist.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          3: yeah, i know. THis is what i Do. Not I need an approach to get positions closed without a possibility for an overfill.

          Here is my problem, though. You guys all assume always the most simple approach. That is not real world.

          I can not jus tsay "exit short" - heck, the market position may not even be whort.

          I have a strategy here with 5 signals. scale in, scale out. If ONE of it gets an overfill for some reason.... and 3 others are still long, for example, I may be long 3 total instead of 5. I need to track that on a "per signal" basis. Because the strategy actually decides what to do based on the state of the different signals.

          So, I have no other choice than tracking order AND position based on signal, and actually repro the complete worlk you do internally. Overfills, thus, have to also be accounted for properly (i.e. in the right sub-position) and corrected from there.

          Comment


            #6
            Check your position. If it is not what you want then send Exit orders when necessary. Unfortunately I do not know why you view this as something you cannot do.

            Not following you on what signal names have to do with anything. If you know you want to be long 3 but you are actually flat. Place a trade to get you long 3. If you know you are short 3 but should be flat. Place a trade to cover those 3.
            Josh P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            558 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            324 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            101 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            545 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            547 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X