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

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,
                      BertrandNinjaTrader Customer Service

                      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().
                          BertrandNinjaTrader Customer Service

                          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 Nolyn, Today, 10:59 AM
                            0 responses
                            1 view
                            0 likes
                            Last Post Nolyn
                            by Nolyn
                             
                            Started by Gkomi, Today, 10:02 AM
                            1 response
                            6 views
                            0 likes
                            Last Post NinjaTrader_Jim  
                            Started by JTizz, Today, 08:58 AM
                            6 responses
                            30 views
                            0 likes
                            Last Post NinjaTrader_PaulH  
                            Started by Bob49, Today, 08:40 AM
                            0 responses
                            19 views
                            0 likes
                            Last Post Bob49
                            by Bob49
                             
                            Started by Malik_demoacct, Today, 08:31 AM
                            0 responses
                            17 views
                            0 likes
                            Last Post Malik_demoacct  
                            Working...
                            X