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 NullPointStrategies, Today, 05:17 AM
        0 responses
        53 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        130 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        70 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        44 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        49 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X