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 carnitron, Today, 08:42 PM
            0 responses
            5 views
            0 likes
            Last Post carnitron  
            Started by strategist007, Today, 07:51 PM
            0 responses
            6 views
            0 likes
            Last Post strategist007  
            Started by StockTrader88, 03-06-2021, 08:58 AM
            44 responses
            3,974 views
            3 likes
            Last Post jhudas88  
            Started by rbeckmann05, Today, 06:48 PM
            0 responses
            8 views
            0 likes
            Last Post rbeckmann05  
            Started by rhyminkevin, Today, 04:58 PM
            4 responses
            58 views
            0 likes
            Last Post dp8282
            by dp8282
             
            Working...
            X