Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Reverse a position by EnterLongLimit / EnterShortLimit order

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

    Reverse a position by EnterLongLimit / EnterShortLimit order

    Hi,

    I have an automatic strategy developed for futures which allowed to Long or Short a futures, i.e. ES mini. At first I use the EnterLong() / EnterShort function for my strategy and it can automatically reverse my position. However, when I use the EnterLongLimit() / EnterShortLimit(), it can't reverse my position. It will stay with the initial position until it hit profit / stop loss order. Can anyone explain the reason and what should be done to make it happen?

    Because if use the EnterLong/EnterShort, it become market order which lead to higher execution price.

    Meantime, If I set an ExitShort + EnterLongLimit together under same condition, it happen theExitShort() executed on first bar then EnterLongLimit() executed at next bar. I actually want them execute at the same period! What can I do?

    Thanks!!



    #2
    Hello ManIp,

    Are you checking the Output Window with TraceOrders enabled to see if you are getting orders ignored for violating the internal order handling rules?



    For example:
    "Methods that generate orders to enter a position will be ignored if:
    •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"
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi Chelsea,

      Yes, I do have a SetStopLoss() set for my strategy. Is that means I can't use EnterLongLimit() if I have a SetStopLoss()? It seems not make sense and I think you must have some alternative solutions? Pls share the best practise, thanks!

      Comment


        #4
        Hello ManIp,

        If you are in a position and a stop loss created with set stop loss (or even if there were a working exit limit or stop order with exit methods) you would not be able to place an enter limit order. You can place market orders and immediately change the position, but this would not be possible with working orders.

        The issue is that since both orders are working, both orders could fill. This would cause the position to be double in the opposite direction which would be an unwanted position. Instead, when using the managed approach it is not allowed for two orders to be working if the second order is opposite to the position to prevent the possibility for the unwanted position if both orders were to fill at the same time.

        You would need to change to the unmanaged approach and code that logic manually.

        Below is a link to the help guide on the unmanaged approach.
        https://ninjatrader.com/support/help...d_approach.htm
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by helpwanted, Today, 03:06 AM
        1 response
        7 views
        0 likes
        Last Post sarafuenonly123  
        Started by Brevo, Today, 01:45 AM
        0 responses
        7 views
        0 likes
        Last Post Brevo
        by Brevo
         
        Started by aussugardefender, Today, 01:07 AM
        0 responses
        5 views
        0 likes
        Last Post aussugardefender  
        Started by pvincent, 06-23-2022, 12:53 PM
        14 responses
        242 views
        0 likes
        Last Post Nyman
        by Nyman
         
        Started by TraderG23, 12-08-2023, 07:56 AM
        9 responses
        384 views
        1 like
        Last Post Gavini
        by Gavini
         
        Working...
        X