Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Why won't Exits work?

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

    Why won't Exits work?

    Hello there,

    I'm finding that ExitLong() and ExitShort() don't work. However, before going realtime, the print statements show the exits were executed.

    What would cause this?

    They were both entered using EnterLong( "EnterLongMarket" ) and EnterShort( "EnterShortMarket" );

    Many Thanks, Caesar.
    Last edited by Skechers; 10-19-2023, 02:01 PM.

    #2
    Hello Caesar,

    Thank you for your post.

    Do you see any errors in the Log tab of the Control Center that could be related? If you enable Trace Orders in your strategy, does the output show anything about orders being ignored or rejected? Are you calling only ExitLong() and/or ExitShort(), or do you use signal names and fromEntrySignal values as well?

    I look forward to your reply.
    Emily C.NinjaTrader Customer Service

    Comment


      #3
      Hi Emily,

      It turns out I had called CancelOrders immediately after calling ExitLong or Short. The effect was the Exit order was cancelled before even going to the broker (I think). I've separated the two calls in different event methods, it works now.

      Many Thanks, Caesar.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by ageeholdings, Today, 07:43 AM
      0 responses
      7 views
      0 likes
      Last Post ageeholdings  
      Started by pibrew, Today, 06:37 AM
      0 responses
      4 views
      0 likes
      Last Post pibrew
      by pibrew
       
      Started by rbeckmann05, Yesterday, 06:48 PM
      1 response
      14 views
      0 likes
      Last Post bltdavid  
      Started by llanqui, Today, 03:53 AM
      0 responses
      6 views
      0 likes
      Last Post llanqui
      by llanqui
       
      Started by burtoninlondon, Today, 12:38 AM
      0 responses
      12 views
      0 likes
      Last Post burtoninlondon  
      Working...
      X