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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    67 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    36 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    60 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    62 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    53 views
    0 likes
    Last Post CarlTrading  
    Working...
    X