• 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!!



  • NinjaTrader_ChelseaB
    replied
    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

    Leave a comment:


  • ManIp
    replied
    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!

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    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"

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by [email protected], Today, 10:13 PM
0 responses
2 views
0 likes
Last Post garzon.javier.e@gmail.com  
Started by iceman2018, Today, 09:56 PM
0 responses
3 views
0 likes
Last Post iceman2018  
Started by iceman2018, Today, 09:51 PM
0 responses
3 views
0 likes
Last Post iceman2018  
Started by linacesaro, Today, 09:17 PM
0 responses
3 views
0 likes
Last Post linacesaro  
Started by n8dogg59, Today, 06:55 AM
2 responses
17 views
0 likes
Last Post n8dogg59  
Working...
X