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

Disable Indicators with a Checkbox

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

    Disable Indicators with a Checkbox

    I have a strategy with 4 indicators. I want to disable and re-enable individual each indicator. I have seen other strategies achieve this with a checkbox on the front end. How do I achieve this in the strategy builder?

    For example, I have a strat with an SMA and MACD, but I check the box and now the strat only accounts for the MACD.

    #2
    Hello goelon,

    Really indicators don't get disabled like NinjaScript Strategies are. They are either applied or not applied.

    You can hide plots by setting these to transparent.

    You can choose whether AddChartIndicator is used for a strategy with an if statement in an unlocked script, but this would not be a feature of the Strategy Builder.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      when I use this code in my strategy with "enablePanel" = false, the strategy gets disabled.

      Code:
      if (enablePanel)
        AddChartIndicator(myIndicator);
      ​
      any thoughts?
      Last edited by dibDab; 03-06-2023, 04:08 AM.

      Comment


        #4
        Hello dibDab,

        Thank you for your note.

        So we may better assist, please answer the following:
        • At what point does the strategy get disabled?
        • If you add print statements to your script, do you see any of them in the NinjaScript Output window before the strategy is disabled?
        • Are there any errors on the Log tab of the Control Center? If so, what do these errors report?

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

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by inanazsocial, Today, 01:15 AM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_Jason  
        Started by rocketman7, Today, 02:12 AM
        0 responses
        10 views
        0 likes
        Last Post rocketman7  
        Started by dustydbayer, Today, 01:59 AM
        0 responses
        2 views
        0 likes
        Last Post dustydbayer  
        Started by trilliantrader, 04-18-2024, 08:16 AM
        5 responses
        23 views
        0 likes
        Last Post trilliantrader  
        Started by Davidtowleii, Today, 12:15 AM
        0 responses
        3 views
        0 likes
        Last Post Davidtowleii  
        Working...
        X