Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ExitLongStop

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

  • emmahudson88
    replied
    Originally posted by NinjaTrader_Bertrand View Post
    Hi Antony, as Matthew posted you're running into the order handling rules here - please try abandon the one Set() method in your setup and work directly with an ExitLongLimit for example for the Long target, if needed you could cancel order this then directly and issue your other order, this would then not get caught in the order handling rules, for explicit order cancellation using IOrders, please see this link :

    http://www.ninjatrader.com/support/h...ancelorder.htm
    Such a very amazing link!
    __________________
    Watch The Big Year Movie Online Free
    Last edited by emmahudson88; 10-13-2011, 03:32 AM.

    Leave a comment:


  • Antony
    replied
    Entry and exit on same bar

    If entry is taken on a bar and the same bar target or stoploss reached, but exit orders not executed. I can use only ExitLongLimit and ExitLongStop.

    Any suggestion?, Sample Code?

    if (Position.MarketPosition == MarketPosition.Flat)
    {
    EnterLong(1, "");
    justLEntered = true;
    }
    if (Position.MarketPosition == MarketPosition.Long && justLEntered == true)
    {
    LStopV = Position.AvgPrice - (initialStop*0.25);
    justLEntered = false;
    }

    if (Position.MarketPosition == MarketPosition. Long)
    {
    If (LStopV > 0) ExitLongStop(LStopV);
    }

    Error message is

    **NT** A Sell stop order placed at '10-08-2011 9:00:00 AM' has been ignored since the stop price is greater than or equal to close price of the current bar. This is an invalid order and subsequent orders may also be ignored. Please fix your strategy.

    Here long entry taken at open of the bar and the same bar price has broken the stoploss.

    Any error on code?

    Please Help…

    Antony



    Thanks,

    Antony.
    Last edited by Antony; 10-12-2011, 11:58 AM. Reason: need more help

    Leave a comment:


  • NinjaTrader_Bertrand
    replied
    Hi Antony, as Matthew posted you're running into the order handling rules here - please try abandon the one Set() method in your setup and work directly with an ExitLongLimit for example for the Long target, if needed you could cancel order this then directly and issue your other order, this would then not get caught in the order handling rules, for explicit order cancellation using IOrders, please see this link :

    Leave a comment:


  • Antony
    replied
    Originally posted by Antony View Post
    Hi All,

    I have the following error on back testing on my code.

    **NT** An Exit() method to submit an exit order at '04-01-2011 10:15:00 AM' has been ignored. Please search on the term 'Internal Order Handling Rules' in the Help Guide for detailed explanation.

    The problem is stop loss order not executing on backtesting.

    The following entryorders EnterLong, EnterlongLimit, EnterShort, EnterShortLimit on same strategy and following exitorders ExitLongStop for long stoploss, ExitShortStop for short stoploss and SetProfitTarget for profit.

    I would like to know how we can come out of this situation?

    Antony
    Hi All,

    I have the following error on back testing on my code.

    The problem is stop loss order not executing on backtesting.

    The following entry orders EnterLong, EnterlongLimit, EnterShort, EnterShortLimit on same strategy and following exitorders ExitLongStop for long stoploss, ExitShortStop for short stoploss.

    If entry and exit condition satisfied on same bar then entry order executed. But exit order not executed.

    I would like to know how we can come out of this situation?

    Antony

    Leave a comment:


  • NinjaTrader_Matthew
    replied
    Hello,

    This issue is likley coming from using SetProfitTarget when using ExitLongStop. Please review our Order Handling Rules:



    Methods that generate orders to exit a position will be ignored if:
    •A position is open and an order submitted by an enter method (EnterLongLimit() for example) is active and the order is used to open a position in the opposite direction
    A position is open and an order submitted by a set method (SetStopLoss() for example) is active
    SetStopLoss() is just used an example, however SetProfitTarget() can trigger this violation as well. You will need to use another Exit method for your profit target, or use both SetStopLoss and SetProfitTarget together (which will be inheritancely OCO used togther)

    Leave a comment:


  • Antony
    started a topic ExitLongStop

    ExitLongStop

    Hi All,

    I have the following error on back testing on my code.

    **NT** An Exit() method to submit an exit order at '04-01-2011 10:15:00 AM' has been ignored. Please search on the term 'Internal Order Handling Rules' in the Help Guide for detailed explanation.

    The problem is stop loss order not executing on backtesting.

    The following entryorders EnterLong, EnterlongLimit, EnterShort, EnterShortLimit on same strategy and following exitorders ExitLongStop for long stoploss, ExitShortStop for short stoploss and SetProfitTarget for profit.

    I would like to know how we can come out of this situation?

    Antony

Latest Posts

Collapse

Topics Statistics Last Post
Started by CaptainJack, 05-29-2026, 05:09 AM
0 responses
476 views
0 likes
Last Post CaptainJack  
Started by CaptainJack, 05-29-2026, 12:02 AM
0 responses
317 views
0 likes
Last Post CaptainJack  
Started by charlesugo_1, 05-26-2026, 05:03 PM
0 responses
254 views
1 like
Last Post charlesugo_1  
Started by DannyP96, 05-18-2026, 02:38 PM
1 response
340 views
0 likes
Last Post NinjaTrader_ChelseaB  
Started by CarlTrading, 05-11-2026, 05:56 AM
0 responses
305 views
0 likes
Last Post CarlTrading  
Working...
X