Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.


    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by cls71, Today, 04:45 AM
    0 responses
    1 view
    0 likes
    Last Post cls71
    by cls71
     
    Started by mjairg, 07-20-2023, 11:57 PM
    3 responses
    213 views
    1 like
    Last Post PaulMohn  
    Started by TheWhiteDragon, 01-21-2019, 12:44 PM
    4 responses
    544 views
    0 likes
    Last Post PaulMohn  
    Started by GLFX005, Today, 03:23 AM
    0 responses
    3 views
    0 likes
    Last Post GLFX005
    by GLFX005
     
    Started by XXtrader, Yesterday, 11:30 PM
    2 responses
    12 views
    0 likes
    Last Post XXtrader  
    Working...
    X