Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Empty properties window, if the indicator is loaded via the strategy

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

    Empty properties window, if the indicator is loaded via the strategy

    hello, i have the following problem: i have created an indicator using c# script and it works even if it is loaded via the indicator window. as soon as the indicator is loaded via strategy, the properties are no longer displayed. why is that?

    Click image for larger version

Name:	Screenshot_1.jpg
Views:	364
Size:	102.0 KB
ID:	1123616

    Load in strategy:
    Code:
    (State == State.Configure)
    {
       AddChartIndicator(SidiOpenRange());
    }
    Click image for larger version

Name:	Screenshot_2.jpg
Views:	350
Size:	61.2 KB
ID:	1123617
    sidlercom80
    NinjaTrader Ecosystem Vendor - Sidi Trading

    #2
    Hello sidlercom80,

    Thank you for your note.

    Indicators loaded from within a strategy would not have settings available, as the settings for the indicator would be configured by the strategy other than the plots. If you'd like the user of your strategy to be able to configure the settings for the indicator, you would need to add these to the strategy as User Inputs and then use those variables to call the indicator within the strategy. You can look at the built in Sample MA Crossover indicator in the NinjaScript Editor for an example of using User Input in calling indicators.

    Please let us know if we may be of further assistance to you.

    Comment


      #3
      I ran into the same issue...
      I built a massive indicator with lot's of parameters.
      So essentially I need to copy all those parameters over to the Strategy code too and maintain code in 2 places.
      Seems like double work to me.

      Also my indicator won't plot on the chart if it is added via the strategy. I'm using the correct method and the indicator is in a custom namespace, so I'm using:
      Private NinjaTrader.NinjaScript.Indicators.Ard.DRiDR _myDR;

      No errors are shown.
      Last edited by ArdOfCrypto; 12-23-2022, 08:50 AM.

      Comment


        #4
        Hello ArdOfCrypto,

        Yes you would need to copy those parameters to the strategy if your intention is to expose them to a user. Indicator parameters are not automatically exposed so you can make custom parameters for the strategy its self. You can make any properties that you want to be configurable for the indicator and pass them to the indicator when you call it.

        If the indicator is not plotting hen using AddChartIndicator that can be caused if you are not calling the indicator from OnBarUpdate, please make sure you used the indicator as well from OnBarUpdate. This can also happen if you are trying to use a secondary series with the indicator, only primary series indicators can be used with AddChartIndicator.

        Comment


          #5
          I solved the last past part of the indicator not showing on the chart.

          Inside the OnBarUpdate I had to add this line:
          _myDR.Update();

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Yesterday, 05:17 AM
          0 responses
          54 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
          72 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