Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ExitLongLimit not being updated

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

    ExitLongLimit not being updated

    I would like to find an explanation for this strange behaviour of Exit Limit orders.

    I use to launch Exit Limit orders as a profit target with LiveUntil Cancelled set to true:

    ProfitOrder = ExitLongLimit(0,true,Position.Quantity,ProfitPrice ,"","");

    This is thi only active order. So, there are not other orders competing with this one. I allways manage to have only one active limit order.

    The strange thing is that those orders sometimes dissapear from the Orders tab. When I print the order state of ProfitOrder it appears as filled (while the position is still open) , Cancelled or simply equals to null.

    In this case what I do is to recover again the order. To do this I check that the market position is Long or Short and if ProfitOrder is null I set it again:

    ProfitOrder = ExitLongLimit(0,true,Position.Quantity,ProfitPrice ,"","");

    When doing this two thing happen: the order is not set again or I receive a message like this

    "**NT** You can't change the order quantity below the amount of already filled units. Affected order: Order='03c9bc614a1c44f39851526af9b8e76f/Sim101' Name='Buy to cover' State=PartFilled Instrument='$AUDUSD' Action=BuyToCover Limit price=1.0155 Stop price=0 Quantity=130,400 Strategy='FOREX2' Type=Limit Tif=Gtc Oco='' Filled=104453 Fill price=1.0155 Token='03c9bc614a1c44f39851526af9b8e76f' Gtd='12/1/2099 12:00:00 AM'"

    This later error message appears even when the Position.Quantity = 25947

    Perhaps there is any previous step to take before setting up again the order?

    thanks

    #2
    guillembm,

    I am happy to assist you.

    Unfortunately without some test case, such as your strategy, I am unable to really comment further.

    Please ensure your strategy isn't causing cases like below :

    Methods that generate orders to enter a position will be ignored if:
    • A position is open and an order submitted by an exit method (ExitLongLimit() 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 and the order is used to open a position in the opposite direction
    • The strategy position is flat 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
    • The entry signal name is not unique

    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

    Set() 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 an exit method (ExitLongLimit() for example) is active

    If you would post a strategy exhibiting the behavior and give me the setup details you are using to test it with (i.e. which data provider, which instrument, which timeframe, etc.). I would be happy to test it out for you.

    Please let me know if I may assist further.
    Adam P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by fx.practic, 10-15-2013, 12:53 AM
    5 responses
    5,406 views
    0 likes
    Last Post Bidder
    by Bidder
     
    Started by Shai Samuel, 07-02-2022, 02:46 PM
    4 responses
    98 views
    0 likes
    Last Post Bidder
    by Bidder
     
    Started by DJ888, Yesterday, 10:57 PM
    0 responses
    8 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by MacDad, 02-25-2024, 11:48 PM
    7 responses
    160 views
    0 likes
    Last Post loganjarosz123  
    Started by Belfortbucks, Yesterday, 09:29 PM
    0 responses
    9 views
    0 likes
    Last Post Belfortbucks  
    Working...
    X