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

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.
    Paul H.NinjaTrader Customer Service

    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.

          Paul H.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Waxavi, Today, 02:10 AM
          0 responses
          6 views
          0 likes
          Last Post Waxavi
          by Waxavi
           
          Started by TradeForge, Today, 02:09 AM
          0 responses
          11 views
          0 likes
          Last Post TradeForge  
          Started by Waxavi, Today, 02:00 AM
          0 responses
          2 views
          0 likes
          Last Post Waxavi
          by Waxavi
           
          Started by elirion, Today, 01:36 AM
          0 responses
          4 views
          0 likes
          Last Post elirion
          by elirion
           
          Started by gentlebenthebear, Today, 01:30 AM
          0 responses
          5 views
          0 likes
          Last Post gentlebenthebear  
          Working...
          X