Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Limit order price fill problems

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

    Limit order price fill problems

    I'm trying to make a limit order from the low of the candle + 1 tick, but when I load it on the chart the price it fills at seems random. Here's the snippet I'm using for it:
    Code:
    {
        EnterLongLimit(1, (Low[0] + 1) , @"mystrategy");
    }​
    Is there something I'm doing wrong?

    Also, is there a way to cancel the limit order if it's not filled on the next candle ?

    #2
    Hello jourdale,

    To confirm, you are setting the limit to the low on every bar update and not just once, correct?

    So this would be a dynamically moving limit that changes on each new bar update.

    To confirm, the order fill price does not match the low of any of the bars from the time the order was open until it filled?

    To cancel an order with the managed approach (when isLiveUntilCancelled is false or not used), just do not call the order method again and it will automatically cancel.

    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      I would actually be setting it just once after all of my entry conditions are met and then cancelling it if it is unfilled on the next bar. It would not be updated to the low of each candle on every bar update unless the entry conditions were met once again. However the code does lie in the OnBarUpdate() section, so it theoretically would be assigned to the low of the next bar if I can't figure out a way to cancel it again. This is an automated strategy, so I'm not sure what you mean when you say, "To cancel an order with the managed approach".

      "To confirm, the order fill price does not match the low of any of the bars from the time the order was open until it filled?" I believe you are referring to my issue with the fill price. In a bit of a facepalm moment I discovered I could fix the fill price issue by changing it from low + 1 to low +0.25 (or whatever the instrument tick value is).

      Sorry for the late response, I didn't see a reply and began working on another project

      Comment


        #4
        Hello jourdale,

        The managed approach uses order methods like EnterLong() / ExitLong(), NinjaTrader manages the position, and there are internal order handling rules to try and prevent unwanted positions.
        The unmanaged approach has no rules and uses SubmitOrderUnmanaged() to submit all orders.

        Below is a link to the help guide on the managed approach.



        If you are using the managed approach and you want to cancel order an order, just don't resubmit it. If you want to keep an order alive you can resubmit it on each new bar update, or use the isLiveUntilCancelled bool as true.


        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        64 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        139 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        75 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        45 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        50 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X