Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Compiled indicator does not show up among those i can add to chart

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

    Compiled indicator does not show up among those i can add to chart

    Hi.
    Very strange platform behavior : i created an indicator, it compiles without errors, yet I don't see it as a part of those I can add to the chart.
    It used to be there, but at certain point just disappeared. I removed it and added back in - does not help.
    Can you suggest what to do in this situation?
    Thank you

    #2
    Hello stasha,

    Thanks for your post.

    If your NinjaScript Custom assembly is compiling without issue, I may suspect there is a difference between the the NinjaScript's Name property and the class name and file name.

    Indicators on a chart will list by the Indicator's Name property that is set in State.SetDefaults.

    Please make sure that this indicator can compile and that you can find the indicator by it's Name property in the Indicators window.

    If there is anything else we can do to help, please let us know.
    JimNinjaTrader Customer Service

    Comment


      #3
      Thanks for suggestion, but unfortunately not. Names are fine, yet no results. Please see attached, compiles wont show up.zip. See if you can find why, it used to work and suddenly disappeared from chart indicators selection (but does showing up in code editor).
      Thanks in advance,

      Comment


        #4
        Hello stasha,

        The indicator is in a custom namespace so it will be listed in a subfolder in the Indicators window.

        The indicator is failing in OnStateChange() when it is cloned to be listed in the Indicators window. Please check the log tab of the Control Center to see the error, and then I would suggest adding prints in the OnStateChange method (specifically in State.SetDefaults) to identify which specific line(s) are throwing the error.

        Previously I had pointed out referencing Plots[0].AutoWidth would work in State.SetDefaults, however, you should make sure that each plot is added before you reference it. (The first added plot would be Plots[0] and the next added plot would be Plos[1].)

        I have included a link for debugging tips here - https://ninjatrader.com/support/help...script_cod.htm

        Please let us know if we can be of additional help.
        JimNinjaTrader Customer Service

        Comment


          #5
          Thanks Jim,

          Following your advise, i analyzed the issue, it was actually PlotBrushes[0][0] = Brushes.Transparent; inside OnStateChange --> State.SetDefaults.

          You would be correct, in general case, but my indicator i've sent you is inheriting from another indicator (to reuse some if its calculations), which i removed while sending you to simplify the story.
          All I am trying to do is to hide that base indicator plot. I find doing PlotBrushes[0][0] = Brushes on every bar close inefficient.
          Is there a better way to do it only once in OnStateChange somewhere? (like you do it only once in GUI, until the next session, when it appears again)

          Thank you Jim! Great help!
          Last edited by stasha; 11-20-2018, 04:33 PM. Reason: Clarifying the situation

          Comment


            #6
            Hello stasha,

            PlotBrushes[][] is for setting a plot's brush historically. I may suggest setting Plots[0].Brush instead.

            Let me know if there is anything else I can do to help.
            JimNinjaTrader Customer Service

            Comment


              #7
              Worked. Thanks!

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by CortexZenUSA, Today, 12:53 AM
              0 responses
              1 view
              0 likes
              Last Post CortexZenUSA  
              Started by CortexZenUSA, Today, 12:46 AM
              0 responses
              1 view
              0 likes
              Last Post CortexZenUSA  
              Started by usazencortex, Today, 12:43 AM
              0 responses
              5 views
              0 likes
              Last Post usazencortex  
              Started by sidlercom80, 10-28-2023, 08:49 AM
              168 responses
              2,266 views
              0 likes
              Last Post sidlercom80  
              Started by Barry Milan, Yesterday, 10:35 PM
              3 responses
              13 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Working...
              X