Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Plotting a custom indicator

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

    Plotting a custom indicator

    Hi

    I have a very simple question.
    I don't know why I can't see my custom indicator plot line.

    I see the last bar level on the price axis colored blue but I don't see the historical line plotted on the chart.

    In the Initialize method :

    Code:
    Add(new Plot(Color.Blue, PlotStyle.Line, "Mycustom"));
    CalculateOnBarClose = true;
    Overlay = true;
    On Bar Update :
    Code:
    if(CurrentBar == 0)
    Mycustom.Set(0);
    
    Mycustom.Set(Close[0]);
    In properties :
    Code:
    [Browsable(false)]
    [XmlIgnore]
    public DataSeries Mycustom
    {
      get { return Values[0]; }
    }
    What could be wrong ?

    #2
    Hi blar58,

    I can't see what's wrong there. That's essentially the bare bones script that's created when you create an indicator in the wizard. Any error messages in log tab of control center?

    Please feel free to try with attached script, which is the about the same as you posted and is working here.
    Attached Files
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Ryan


      I have no errors in the log. I didn't create this indicator with the wizard. I created it from scratch.

      Comment


        #4
        Then that is the problem. You need to create indicators from the wizard. There's additional required code that is only there when you create through the wizard.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by blar58 View Post
          Ryan


          I have no errors in the log. I didn't create this indicator with the wizard. I created it from scratch.
          How do you mean "from scratch"? Did you not use the NT Editor?

          Comment


            #6
            Hi Koganam


            I just wanted to say that I didn't use the wizard.

            Comment


              #7
              The only way to create indicators is to use Tools > New NinjaScript > Indicator (the wizard).
              Ryan M.NinjaTrader Customer Service

              Comment


                #8
                Hi Ryan


                I think there has been a misunderstanding. I used the wizard. I have to.

                I still have the same problem. Don't see the plotting line.

                I mean this is a simple indicator what is the problem ?

                Comment


                  #9
                  blar58, did you compile the script after you coded it? Can you please describe the exact steps you took in creating this indicator?
                  AustinNinjaTrader Customer Service

                  Comment


                    #10
                    Austin

                    Can I send you the file

                    Comment


                      #11
                      blar58, yes you can direct the file to support at ninjatrader dot com so we can give it a quick run on our end for you.

                      Thanks,

                      Comment


                        #12
                        Bertrand


                        I have sent you the file to your attention.

                        I will be leaving in about an hour for the day so would appreciate if you could look at it as soon as you can

                        thank you

                        Comment


                          #13
                          I just replied, there's no need for you to keep the custom Plot override section if you intend to plot from the OnBarUpdate().

                          Comment


                            #14
                            Bertrand

                            You got it.

                            I am using a template that incorporate all useful methods. I forgot to hide the override plot method


                            Many thanks

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by cmoran13, 04-16-2026, 01:02 PM
                            0 responses
                            43 views
                            0 likes
                            Last Post cmoran13  
                            Started by PaulMohn, 04-10-2026, 11:11 AM
                            0 responses
                            25 views
                            0 likes
                            Last Post PaulMohn  
                            Started by CarlTrading, 03-31-2026, 09:41 PM
                            1 response
                            163 views
                            1 like
                            Last Post NinjaTrader_ChelseaB  
                            Started by CarlTrading, 04-01-2026, 02:41 AM
                            0 responses
                            98 views
                            1 like
                            Last Post CarlTrading  
                            Started by CaptainJack, 03-31-2026, 11:44 PM
                            0 responses
                            158 views
                            2 likes
                            Last Post CaptainJack  
                            Working...
                            X