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 manueldecastro, Yesterday, 10:26 AM
            5 responses
            24 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by memonic, 05-01-2024, 01:23 PM
            5 responses
            30 views
            0 likes
            Last Post memonic
            by memonic
             
            Started by dcriador, Yesterday, 10:45 AM
            2 responses
            18 views
            0 likes
            Last Post dcriador  
            Started by SnailHorn, Yesterday, 10:49 PM
            1 response
            10 views
            0 likes
            Last Post SnailHorn  
            Started by TraderIqbal, 10-20-2023, 10:12 AM
            2 responses
            121 views
            0 likes
            Last Post Funnywo
            by Funnywo
             
            Working...
            X