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

Programming plot line width

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

    Programming plot line width

    My old eyes sometimes have a hard time with narrow plot lines. How do I program into my custom indicators a thicker plot line width so I don't have to format it every time I apply it?

    #2
    Hi Hawk Arps,

    Place this line in Initialize()
    Plots[0].Pen.Width = 3;

    [0] is the first plot in the collection. Can reference subsequent plots with [1], [2], etc.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      An odd thing happened. When I put that line in initialize I got an error message in the output box "failed to call method initialize'. After remming the line out, the inidicator worked with the plot lines plotting thicker as I wanted. How does it work with them remmed out?

      Comment


        #4
        Hawk Arps,

        Please provide the complete snippet of what you have inside Initialize(). Thank you.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          It seems to be working now,,, thanks a lot.
          I have a new question regarding initialize method and the Variables region... I would like to create an alert and plot a line at a user defined level on a custom oscillator... one that I can reset (reload) as time passes. Is there an example of how this can be done?
          Thanks again in advance.

          Comment


            #6
            Most of this can be setup when you create a new indicator through the wizard. You can define custom inputs in the wizard. Create a double type input and then set a plot to it.

            You can then work with CrossAbove or CrossBelow to check for crossing and use Alert() command. If you have any trouble with syntax, you can create these expressions in strategy wizard, and copy paste into your indicator code.

            Ryan M.NinjaTrader Customer Service

            Comment


              #7
              Thank you for the help... (again). I have successfully created this alert and plot using the custom indicator wizard. It would be nice, however, to not have to recreate the indicator and in the process rename then delete the old one. For my own Ninja Script education I would like to understand how to accomplish this manually using the variables and properties regions along with the initialize method. However, thanks to your help my Ninja Script abilities are getting better! Thanks again.

              Comment


                #8
                Great to hear you're making progress. Best way to rename is Right Click in editor > Save as and provide a new new name. You can delete the old one after this.

                To better understand how inputs work with the properties region, can see the following link:
                Ryan M.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by port119, 04-27-2024, 02:43 PM
                3 responses
                30 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by sastrades, 01-31-2024, 10:19 PM
                13 responses
                204 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by reynoldsn, Today, 04:40 PM
                0 responses
                4 views
                0 likes
                Last Post reynoldsn  
                Started by Philippe56140, 04-27-2024, 02:35 PM
                6 responses
                54 views
                0 likes
                Last Post bltdavid  
                Started by ETFVoyageur, Yesterday, 06:05 PM
                7 responses
                45 views
                0 likes
                Last Post ETFVoyageur  
                Working...
                X