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

Default Plot Width and Location..

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

    Default Plot Width and Location..

    Is there anyway to set the default size and location of a dot within the Plot() function for an indicator?

    Essentially, I would like my PlotStyle.Dot to have a default width of 3 rather than 1. I would also like to place the dot below the bottom of the bar it occurred on and not in the bar.

    Your help is much appreciated.
    Nick

    #2
    If your indicator has a single plot, you could add the following line in the Initialize() method after the Add() method.

    Plots[0].Pen.Width = 3;

    Dots will be plotted at the value that you set for the data series associated to this plot. If you want it plotted at the bottom of the bar, set the value of the data series to the low of the bar.
    RayNinjaTrader Customer Service

    Comment


      #3
      Hi Ray-

      This helps me to plot for one of my hour inputs. How do I reference the other 3? I would like them all to default to a larger size.

      I am trying to reference them as follows without success. Only the first one plots with a width of 5.

      Plots[0].Pen.Width = 5;
      Plots[1].Pen.Width = 5;
      Plots[2].Pen.Width = 5;
      Plots[3].Pen.Width = 5;

      Thanks for your help.
      Nick
      Last edited by nmussa; 10-16-2007, 06:20 AM.

      Comment


        #4
        Please paste the code in your Initialize() method. Thanks.
        RayNinjaTrader Customer Service

        Comment


          #5
          Ray-

          Thanks again for your help...in posting the code (you) I answered my own question..

          Thanks.


          ++++++++++++++++++++++
          Here you go....

          protected override void Initialize()
          {
          Add(new Plot(Color.FromKnownColor(KnownColor.LawnGreen), PlotStyle.Dot, "RSI_Long"));
          Add(new Plot(Color.FromKnownColor(KnownColor.Green), PlotStyle.Dot, "RSI_Long_Div"));
          Add(new Plot(Color.FromKnownColor(KnownColor.Red), PlotStyle.Dot, "RSI_Short"));
          Add(new Plot(Color.FromKnownColor(KnownColor.DarkRed), PlotStyle.Dot, "RSI_Short_Div"));
          CalculateOnBarClose = true;
          Overlay = true;
          PriceTypeSupported = false;

          Plots[0].Pen.Width = 5;
          Plots[0].Pen.Width = 5;
          Plots[0].Pen.Width = 5;
          }
          Last edited by nmussa; 10-16-2007, 06:58 AM. Reason: Fixed problem

          Comment


            #6
            Your code is very different that what you have posted in post #3.

            You are setting the same index [0] 3 times.

            It should be:

            protected override void Initialize()
            {
            Add(new Plot(Color.FromKnownColor(KnownColor.LawnGreen), PlotStyle.Dot, "RSI_Long"));
            Add(new Plot(Color.FromKnownColor(KnownColor.Green), PlotStyle.Dot, "RSI_Long_Div"));
            Add(new Plot(Color.FromKnownColor(KnownColor.Red), PlotStyle.Dot, "RSI_Short"));
            Add(new Plot(Color.FromKnownColor(KnownColor.DarkRed), PlotStyle.Dot, "RSI_Short_Div"));
            CalculateOnBarClose = true;
            Overlay = true;
            PriceTypeSupported = false;

            Plots[0].Pen.Width = 5;
            Plots[1].Pen.Width = 5;
            Plots[2].Pen.Width = 5;
            Plots[3].Pen.Width = 5;
            }
            RayNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by bortz, 11-06-2023, 08:04 AM
            47 responses
            1,610 views
            0 likes
            Last Post aligator  
            Started by jaybedreamin, Today, 05:56 PM
            0 responses
            9 views
            0 likes
            Last Post jaybedreamin  
            Started by DJ888, 04-16-2024, 06:09 PM
            6 responses
            19 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by Jon17, Today, 04:33 PM
            0 responses
            6 views
            0 likes
            Last Post Jon17
            by Jon17
             
            Started by Javierw.ok, Today, 04:12 PM
            0 responses
            16 views
            0 likes
            Last Post Javierw.ok  
            Working...
            X