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 charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      57 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      143 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      161 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      97 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      276 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X