Announcement

Collapse
No announcement yet.

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 Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            558 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            324 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            101 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            545 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            547 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X