Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Activate / Deactivate Strategy

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

    Activate / Deactivate Strategy

    Hello! I am looking to activate (allow to trade) / deactivate (not allowed to trade) strategy while it is Enabled. Is there a way to do it?

    Here is what I have tried so far without any success: I created a Boolean variable and a Boolean parameter, used them in my condition builder. It still requires me to Disable the whole Strategy before I can activate or deactivate. Appreciate any guidance provided.

    #2
    Hello Strategist,

    Thanks for your post and welcome to the NinjaTrader forums!

    If you are using the Strategy Builder then there would not be a way to accomplish this.

    You can accomplish your goal in Ninjascript. You can create a chart button that when clicked can allow trade or not allow a trade.

    Here is a link to a strategy that uses chart buttons that you may be able to adapt to your needs.



    Here is a basic guideline of how to Import NinjaScripts.

    To import NinjaScripts you will need the original .zip file.

    To Import
    1. Download the NinjaScripts to your desktop, keep them in the compressed .zip file.
    2. From the Control Center window select the menu Tools>Import>Ninjascript add-on..
    3. Select the downloaded .zip file
    4. NinjaTrader will then confirm if the import has been successful.

    Critical - Specifically for some NinjaScripts, it will prompt that you are running newer versions of @SMA, @EMA, etc. and ask if you want to replace, press 'No'

    The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.

    Comment


      #3
      Thank you for your response. Looks like I will need to integrate ON/OFF script into my strategy otherwise it is working independently.

      Comment


        #4
        One more question about Strategy. I currently testing a couple of Strategies in Simulation account. During the day, when I disable a strategy and reenable it, it does not show the daily P&L in the Strategy Control window but starts back from 0. Is there some setting that would retain the daily P&L?

        Comment


          #5
          Hello Strategist,

          Thanks for your reply.

          The strategy will only show the real-time realized PNL that the strategy instance itself has collected. When you stop the strategy and restart it, the real-time realized PNL will be zero until it completes its first real-time trade.

          You can view the realized PNL for the account under the accounts tab.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Yesterday, 05:17 AM
          0 responses
          62 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          134 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          75 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          45 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          50 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X