Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

exit position - new entry

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

    exit position - new entry

    Hello,

    I have in my script Exitshort() before doing the enterlong when conditions are true. But there are more short positions closed than have been in the trade. Thats strange and cant find the reason.In the attached screenshot one can see that the short rS1a and rS1b from a trade and they are closed with Buy-To-Cover and Close Position. Where might this Close Position come from, is this maybe by default from NinjaTrader before doing a trade in the other direction?

    Thank you!
    Tony​
    Attached Files
    Last edited by tonynt; 01-24-2024, 04:31 PM. Reason: translation error

    #2
    Hello tonynt,

    Thank you for your post.

    In the Unmanaged Approach, an Enter() method in the opposite direction will automatically reverse the position. The internal order handling rules attempt to prevent the unwanted position you have described, though the rules do not apply to market orders, such as ExitShort() and ExitLong(). In your script, you can remove the ExitShort() and the new entry will result in two orders - one to close the short position and another to enter the long position. This is noted in the help guide here:
    • https://ninjatrader.com/support/help...d_approach.htm
      • "Entry() methods will reverse the position automatically. For example if you are in a 1 contract long position and now call EnterShort() -> you will see 2 executions, one to close the prior long position and the other to get you into the desired 1 contract short position."
    Please let us know if we may be of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    43 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    21 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    30 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    50 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    40 views
    0 likes
    Last Post CarlTrading  
    Working...
    X