Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

The question about the exit from a position by a limit order

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

    The question about the exit from a position by a limit order

    Good day, help please. I use in my script to enter a position with a limit order. Also I have registered stop loss SetStopLoss ( "" , CalculationMode.Ticks...
    But I do not specify a fixed take profit size
    I want to exit a position with a limit order if certain conditions are met
    I did so
    if (...............)
    {
    ExitLongLimit(Close[0], "", "")
    }

    if (...............)
    {
    ExitShortLimit(Close[0], "", "")
    }
    However, the robot does not want to leave the position
    Please tell me where the error?

    #2
    Hello Kovalev,

    Thanks for your post.

    Please check your "Log" tab of the control center any time something does not work as expected as you may find error messages that occur during the start-up or running of the script.

    In this case, you likely would see a message that an exit order at (date & time) has been ignored. Please search on the term "Internal Order handling rules" in the help guide.

    For your convenience here is a link to the help guide on the managed approach which has the section, "Internal Order Handling Rules that Reduce Unwanted Positions" https://ninjatrader.com/support/help...d_approach.htm. The specific rule that generates the error message is "Methods that generate orders to exit a position will be ignored if: A position is open and an order submitted by a set method (SetStopLoss() for example) is active".

    An alternative would be to use the market orders of ExitLong() and ExitShort() as the referenced section above notes that the rules do not apply to those market orders.


    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    559 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
    546 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