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

plot thickness

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

    plot thickness

    if I have the following code, How do I make the bar thickness default to 5 instead of 1?

    Add(new Plot(Color.FromKnownColor(KnownColor.Blue), PlotStyle.Bar, "up"));


    I put the following code in, but NT did not like that.

    Plots[
    0].Pen.Width = 5;

    #2
    Is this in the Initialize()? Which error do you get velocity?
    BertrandNinjaTrader Customer Service

    Comment


      #3
      it is in:
      protected
      overridevoid Initialize()

      when I compile it does it successfully, however, all the parameters display as <unknown><unknown>

      Comment


        #4
        velocity, could you please attach your code so I can take a look and try to reproduce?
        BertrandNinjaTrader Customer Service

        Comment


          #5
          ///<summary>
          /// This method is used to configure the indicator and is called once before any bar data is loaded.
          ///</summary>
          protectedoverridevoid Initialize()
          {
          Add(
          new Plot(Color.Transparent, PlotStyle.Line, "OscLine"));
          Add(
          new Plot(Color.Blue, PlotStyle.Bar, "OscBarUP"));
          Add(
          new Plot(Color.Magenta, PlotStyle.Bar, "OscBarDn"));
          Add(
          new Plot(Color.Blue, PlotStyle.Bar, "HPLineUp"));
          Add(
          new Plot(Color.Magenta, PlotStyle.Bar, "HPLineDn"));
          Add(
          new Line(Color.Transparent, 0, "ZeroLine"));

          diff =
          new DataSeries(this);
          avg =
          new DataSeries(this);

          CalculateOnBarClose =
          false;
          DrawOnPricePanel =
          false;
          Overlay =
          false;
          PriceTypeSupported =
          false;
          PaintPriceMarkers =
          false;

          /*
          Plots[0].Pen.Width = 1; // Bertrand, if you undo this you will get <unknowns>
          Plots[1].Pen.Width = 11;
          Plots[2].Pen.Width = 11;
          Plots[3].Pen.Width = 11;
          Plots[4].Pen.Width = 11;
          Plots[5].Pen.Width = 1;
          */

          }
          Last edited by velocity; 08-06-2009, 06:00 AM.

          Comment


            #6
            velocity, your line is not a plot, so using this throws an error to the log tab ( 'index out of bounds' ) - if you comment the last Plot width designation out it works -

            Plots[0].Pen.Width = 1;
            Plots[
            1].Pen.Width = 11;
            Plots[
            2].Pen.Width = 11;
            Plots[
            3].Pen.Width = 11;
            Plots[
            4].Pen.Width = 11;
            //Plots[5].Pen.Width = 1;
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Ok, thanks for taking a look

              Comment


                #8
                Originally posted by velocity View Post
                if I have the following code, How do I make the bar thickness default to 5 instead of 1?

                Add(new Plot(Color.FromKnownColor(KnownColor.Blue), PlotStyle.Bar, "up"));


                I put the following code in, but NT did not like that.

                Plots[
                0].Pen.Width = 5;
                Velocity,

                have you tried this,

                Add(new Plot(new Pen(Color.Blue, 5), PlotStyle.Line, "up"));

                RJay
                RJay
                NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

                Comment


                  #9
                  If you are not going to change the plots inside of your code, the above syntax is what I always use too.
                  eDanny
                  NinjaTrader Ecosystem Vendor - Integrity Traders

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by zstheorist, Today, 07:52 PM
                  0 responses
                  3 views
                  0 likes
                  Last Post zstheorist  
                  Started by pmachiraju, 11-01-2023, 04:46 AM
                  8 responses
                  149 views
                  0 likes
                  Last Post rehmans
                  by rehmans
                   
                  Started by mattbsea, Today, 05:44 PM
                  0 responses
                  5 views
                  0 likes
                  Last Post mattbsea  
                  Started by RideMe, 04-07-2024, 04:54 PM
                  6 responses
                  33 views
                  0 likes
                  Last Post RideMe
                  by RideMe
                   
                  Started by tkaboris, Today, 05:13 PM
                  0 responses
                  5 views
                  0 likes
                  Last Post tkaboris  
                  Working...
                  X