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

Running a Strategy with Manual Intervention + How to stop a strategy

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

    Running a Strategy with Manual Intervention + How to stop a strategy

    Hi,
    As I watch the strategy execute, I'm trying to move my stop up manually, but it keeps resetting itself to its original position with each bar. My strategy is set to 'on bar close'. So that makes sense. But I am curious, is there a way to execute a strategy such that manual intervention can be allowed..?

    Also, I've noticed that on simulation mode, when I end a strategy, the account value keeps changing - looks like the orders did not completely cancel! How do I END or STOP executing a Strategy such that all orders are immediately closed out and the account is FLAT? This is certainly important when the strategy is executing on the actual account.

    Thanks.

    RK

    #2
    Hello rasdaka,

    You will need to submit an exit order using isLiveUntilCancelled as true, and then not update the order after submitting it.

    See the post below with details.
    https://ninjatrader.com/support/foru...21#post1204121

    To automatically cancel working entry and exits enable 'Cancel entry orders when a strategy is disabled' and 'Cancel exit orders when a strategy is disabled' in Tools -> Options -> Strategy.

    To submit an order to close a position, call ExitLong() and ExitShort() when State is State.Terminated in OnStateChange().
    https://ninjatrader.com/support/help...tatechange.htm

    You could also call CancelOrder() with any orders assigned to variables in OnOrderUpdate() when the strategy is terminating.
    https://ninjatrader.com/support/help...ancelorder.htm
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks, ChelseaB. I've set the config on Tools > Options > Strategy as advised.

      I do wonder about the 'ATM Strategy' config items. Curious if you might be able to direct me to some documentation explaining these options..?

      Click image for larger version

Name:	image.png
Views:	134
Size:	94.9 KB
ID:	1219636​​

      Many thanks!

      RK
      Attached Files

      Comment


        #4
        Hello RK,

        This is related to Atm Strategy templates and not NinjaScript.

        Below is a link to the help guide definitions.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by akuntysh, 05-18-2018, 03:39 AM
        12 responses
        820 views
        0 likes
        Last Post cedavra
        by cedavra
         
        Started by Uregon, Today, 03:44 AM
        0 responses
        2 views
        0 likes
        Last Post Uregon
        by Uregon
         
        Started by CyberNate, 11-17-2020, 08:15 PM
        2 responses
        426 views
        0 likes
        Last Post nurpalgo  
        Started by sdauteuil, 09-23-2021, 10:16 AM
        7 responses
        1,247 views
        0 likes
        Last Post marcus2300  
        Started by sofortune, 05-18-2024, 11:48 AM
        2 responses
        34 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Working...
        X