Announcement

Collapse
No announcement yet.

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.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        90 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        137 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        68 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        120 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        71 views
        0 likes
        Last Post PaulMohn  
        Working...
        X