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

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:	259
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:	248
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.
    Kate W.NinjaTrader Customer Service

    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.
        JesseNinjaTrader Customer Service

        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 ender_wiggum, Today, 09:50 AM
          1 response
          5 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by rajendrasubedi2023, Today, 09:50 AM
          1 response
          10 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by geotrades1, Today, 10:02 AM
          0 responses
          4 views
          0 likes
          Last Post geotrades1  
          Started by bmartz, Today, 09:30 AM
          1 response
          8 views
          0 likes
          Last Post NinjaTrader_Erick  
          Started by geddyisodin, Today, 05:20 AM
          3 responses
          24 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Working...
          X