• 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

Ninja places order with label "Close position" by itself

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

    Ninja places order with label "Close position" by itself

    Hello,

    I know this could be difficult to explain but I have broken my head over this issue. There are quite a few details but overall how can this be?

    I have a fully scripted automated strategy.
    All my orders have names.
    How come, Ninja places an order with a name that doesn't even appear anywhere in my script "Close position"?
    Obviously at some point this really messes up the whole strategy.

    Has anyone come across a similar issue or can suggest anything? Thank you.

    #2
    Hello tradealgo,

    Welcome to the NinjaTrader forums!

    When calling an entry method in the opposite direction of your position this will cause your position to be reversed. NinjaTrader will automatically submit an order to close your existing position and then enter an order to enter you into the opposite position.

    This order will be named 'Close position'.

    Are you reversing your position in the strategy using the managed approach?



    As a heads up, if you exit and then call an entry method in the same run of OnBarUpdate, the OnPositionUpdate() will not have yet run and NinjaTrader will not have known that your position is closed. This will cause both actions to complete and end up sending 3 orders. The first order is the exit position from your exit method, the second order is to close the position from NinjaTrader automatically reversing your position, the third order is to enter you into the opposite position.

    The result is that either the script will double the quantity when it reverses or it will cause an overfill and stop the script.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Zenersev, 10-19-2019, 02:11 PM
    7 responses
    52 views
    0 likes
    Last Post NinjaTrader_PatrickG  
    Started by Lancer, Today, 10:39 AM
    4 responses
    24 views
    0 likes
    Last Post Lancer
    by Lancer
     
    Started by koganam, Today, 11:50 AM
    2 responses
    12 views
    0 likes
    Last Post koganam
    by koganam
     
    Started by koganam, Today, 10:33 AM
    4 responses
    14 views
    0 likes
    Last Post koganam
    by koganam
     
    Started by FREEN, Today, 10:17 AM
    4 responses
    12 views
    0 likes
    Last Post FREEN
    by FREEN
     
    Working...
    X