Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trade Management

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

    Trade Management

    Hello, I have a strategy that I wrote that should effectively reverse my trade position long and short. I should always be in a trade. I have is code so that I exit previous trade first then I enter a new trade; For example:

    if(submitTrades == true) ExitShort();
    if(submitTrades == true) EnterLong(DefaultQuantity, "");

    I do the opposite when entering a short trade. However, it's not working as I expected. I notice in my DOM that my contracts are accumulating as if the exit is not being executed.

    Any thoughts? thanks

    #2
    Hello pman777,

    Using the Managed Approach calling EnterLong() when you are in a short position, NinjaTrader will automatically an order to exit your short position and then enter an order to create your long position.

    By submitting two orders at the same time you will be accumulating contracts. You may try removing the Exit() method when you want to reverse a position and use the Enter() method in the opposite direction to reverse your position.
    JCNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    639 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    366 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    107 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    569 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    572 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X