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

Hotkey to enable and disable a strategy

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

    Hotkey to enable and disable a strategy

    I want to be able to enable or disable a specified strategy with a hotkey e.g. 'ctrl + F1'. Is this possible? If so, would this need to be a custom script or can it be done through NT8's built-in features?

    Thank you for your feedback!

    #2
    Hello TraderJosh,

    Thank you for your post.

    There is current not a built-in way to enable/disable a strategy with a hot key. However, I can submit this as a feature request on your behalf if you would like.

    You can detect key presses through your code and use CloseStrategy() to close that specific strategy.

    Please see this forum post which includes a sample script demonstrating detecting key presses in your code:

    Hi guys, Are there available order entry hot key that is based on the previous bar? Would like to implementorders by hot keys which could be quick & less noticeable. Cheers, Leo


    CloseStrategy - https://ninjatrader.com/support/help...sestrategy.htm

    Please let me know if you have any further questions.
    Gaby V.NinjaTrader Customer Service

    Comment


      #3
      This is interesting... TraderJosh I bet you could do it by having a key press set a global variable to 0 or 1 (on or off) that enables or disables your strategy. This is also a great idea and something I will most likely incorporate.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by lightsun47, Today, 03:51 PM
      0 responses
      5 views
      0 likes
      Last Post lightsun47  
      Started by 00nevest, Today, 02:27 PM
      1 response
      9 views
      0 likes
      Last Post 00nevest  
      Started by futtrader, 04-21-2024, 01:50 AM
      4 responses
      45 views
      0 likes
      Last Post futtrader  
      Started by Option Whisperer, Today, 09:55 AM
      1 response
      14 views
      0 likes
      Last Post bltdavid  
      Started by port119, Today, 02:43 PM
      0 responses
      9 views
      0 likes
      Last Post port119
      by port119
       
      Working...
      X