• 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

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?

    https://ninjatrader.com/support/help...antedPositions

    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 shmarola, Today, 01:01 AM
        0 responses
        1 view
        0 likes
        Last Post shmarola  
        Started by CriticalMind, 11-29-2015, 12:39 PM
        3 responses
        1,321 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by novel168, 06-14-2019, 09:20 PM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by johnnybegoode, Yesterday, 08:00 PM
        3 responses
        9 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by digibob, Yesterday, 03:00 PM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X