Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problem with my ExitShort

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

    Problem with my ExitShort

    hello, I am having an issue with my strategy that executes on every tick (CalculateOnBarClose=false) on a 100 tic chart.

    I execute my trade for 3 contracts with the following command EnterLong(tradeContracts, "") where tradeContracts is set to "3". This command works fine.

    I then sell my first contract with the command ExitShort(contractExit) with contractExit set to "1". This executes when I reach 5 tics. This command also works fine. I then sell my second contract with the same command ExitShort(contractExit) with contractExit set to "1". This executes when I reach 10 tics. This command is ignored!

    The second contract executes the same exit code as the first, so I know the code is syntactically correct since it worked for the first contract.

    Both of these exit commands occur in the same bar.

    Any insight or advice is greatly appreciated.

    #2
    Hello,

    What message comes up in the output window when this occurs? (tools -> output window)

    Have you verified the second exit is being called with a Print() ?

    While this may not apply to this situation please see the section Internal Order Handling Rules that Reduce Unwanted Positions
    for more information on why this might have been ignored: http://www.ninjatrader.com/support/h...d_approach.htm
    LanceNinjaTrader Customer Service

    Comment


      #3
      Thank you Lance. I tried several things and finally got it to work. Seems I needed to label my exits since they occur within the same bar. Once I did that, it worked like a charm. Hope this helps someone else with same issue.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      650 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      370 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      109 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      574 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      577 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X