• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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 chartish, Today, 12:18 PM
    0 responses
    2 views
    0 likes
    Last Post chartish  
    Started by brokerbombero, Today, 09:42 AM
    2 responses
    22 views
    0 likes
    Last Post brokerbombero  
    Started by 12VMan, Today, 09:29 AM
    1 response
    13 views
    0 likes
    Last Post NinjaTrader_PatrickG  
    Started by PBreen, Today, 08:41 AM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by U0000999, Today, 05:54 AM
    2 responses
    20 views
    0 likes
    Last Post NinjaTrader_ChrisL  
    Working...
    X