Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

RMS rejecting to close the position to flat

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

    RMS rejecting to close the position to flat

    Hi,

    It is sort of strange but understandable that RMS rejects the following order.

    Program:
    EnterLong(); // OK, enough margin
    // after short period of time with MarketPosition.Long
    ExitLong(); // rejected by RMS if no more extra (double) margin -> NinjaTrader close the program and manage to close the position in some other way!

    But how this should be handled or how to ask the program to close the position as actually there aren't more positions coming ever than the initial one, strategy only wants to close the position, although it is done via sell order which ExitLong generates and that's the reason RMS hit in I think.

    Any advice or is it so that NinjaTrader programs need double margins compared to manual trading? (And that points the q, how DOM can handle the close part?)

    #2
    NinjaTrader will not check your margins before submitting the order. Your brokers risk system will either accept or reject the order.

    Do you have other working orders such as stops and targets working when you try to submit this ExitLong()?
    MatthewNinjaTrader Product Management

    Comment


      #3
      Hi Matthew,

      Actually I was just thinking that as there are those targets (target&stopLoss) orders it can be a reason for that. So DOM cancels those orders before close order .. so it can work. (and maybe same kind of approach could be used here but better to just rise amount of money ..)

      Comment


        #4
        Just FYI, not an advice, I made a simple function which remove those active targets before exit and it seems to work:

        void CancelTargets(){

        foreach (Order io in this.Orders){
        if (io.Name == "Profit target")
        if (io.OrderState == OrderState.Working){
        io.Cancel();
        if (debug) PrintWithTimeStamp(io.Name + " *** " + io.Info + " CancelRequest sent");
        }
        }
        }


        And just before ExitLong() or ExitShort() call this CancelTargets()
        Probably there are much more better ways to find out the targets and cancel those but that's at least one example (not supported I think).

        (And as StopLoss is an OCO for that only one cancel needed, if you have both..)

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        639 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        366 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        107 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        569 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        572 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X