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 rhyminkevin, Today, 04:58 PM
                  0 responses
                  16 views
                  0 likes
                  Last Post rhyminkevin  
                  Started by lightsun47, Today, 03:51 PM
                  0 responses
                  6 views
                  0 likes
                  Last Post lightsun47  
                  Started by 00nevest, Today, 02:27 PM
                  1 response
                  14 views
                  0 likes
                  Last Post 00nevest  
                  Started by futtrader, 04-21-2024, 01:50 AM
                  4 responses
                  49 views
                  0 likes
                  Last Post futtrader  
                  Started by Option Whisperer, Today, 09:55 AM
                  1 response
                  15 views
                  0 likes
                  Last Post bltdavid  
                  Working...
                  X