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

Trying to rearrange order the pivots line up on Data Box

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

    Trying to rearrange order the pivots line up on Data Box

    I thought I just posted this but cant find it.

    I tried to rearrange the order the pivots show in the data box to read top to bottom:
    R3,R2,R1,PP,S1,S2,S3

    but all I was able to do was rearrange the names, but the values stayed in the original order as the ninja default that runs from PP on down.

    I think it must be in properties somehow but I couldnt figure out how.
    It wont let me post all the code so I just posted the parts I changed from the ninja default after copying it into 'MyPivots' script. I didnt switch any data in properties, but reproduced the relevant parts I think so you can view it easily.
    HTML Code:
     
    /// </summary>
    protected override void Initialize()
    {
    Add(new Plot(Color.Red, "R3"));
    Add(new Plot(Color.Red, "R2"));
    Add(new Plot(Color.Red, "R1"));
    Add(new Plot(Color.Black,"PP"));
    Add(new Plot(Color.Green,"S1"));
    Add(new Plot(Color.Green,"S2"));
    Add(new Plot(Color.Green,"S3"));
     
    {
    R3.Set(r3);
    R2.Set(r2);
    R1.Set(r1);
    PP.Set(pp);
    S1.Set(s1);
    S2.Set(s2);
    S3.Set(s3);
    }
    }
    #region Properties
    /// <summary>
    /// </summary>
    [Description("Type of period for pivot points.")]
    [Category("Parameters")]
    public Data.PivotRange PivotRangeType 
    {
    get { return pivotRangeType; }
    set { pivotRangeType = value; }
    }
    /// <summary>
    /// </summary>
    [Browsable(false)]
    [XmlIgnore]
    public DataSeries PP
    {
    get { return Values[0]; }
    }
    /// <summary>
    /// </summary>
    [Description("Approach for calculation the prior day HLC values.")]
    [Category("Parameters")]
    public Data.HLCCalculationMode PriorDayHLC
    {
    get { return priorDayHLC; }
    set { priorDayHLC = value; }
    }
    /// <summary>
    /// </summary>
    [Browsable(false)]
    [XmlIgnore]
    public DataSeries R1
    {
    get { return Values[1]; }
    }
    /// <summary>
    /// </summary>
    [Browsable(false)]
    [XmlIgnore]
    public DataSeries R2
    {
    get { return Values[3]; }
    }
     
    /// <summary>
    /// </summary>
    [Browsable(false)]
    [XmlIgnore]
    public DataSeries R3
    {
    get { return Values[5]; }
    }
     
    /// <summary>
    /// </summary>
    [Browsable(false)]
    [XmlIgnore]
    public DataSeries S1
    {
    get { return Values[2]; }
    }
     
    /// <summary>
    /// </summary>
    [Browsable(false)]
    [XmlIgnore]
    public DataSeries S2
    {
    get { return Values[4]; }
    }
    /// <summary>
    /// </summary>
    [Browsable(false)]
    [XmlIgnore]
    public DataSeries S3
    {
    get { return Values[6]; }
    }
    /// <summary>
    /// close value for user defined pivots calculation
     
     

    #2
    See the Properties region of the code. Notice how you have Values[0], Values[1], etc. You need to change the order there.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Josh View Post
      See the Properties region of the code. Notice how you have Values[0], Values[1], etc. You need to change the order there.
      i tried changing the values so from top down R3 had 0, R2 had 1 etc.. but that didnt do it correctly.

      Comment


        #4
        Your code does not suggest you have made the change. Values[0] corresponds with the first Add(new Plot(...)) in Initialize(). Values[1] goes to the next, etc.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Josh View Post
          Your code does not suggest you have made the change. Values[0] corresponds with the first Add(new Plot(...)) in Initialize(). Values[1] goes to the next, etc.

          I'll try again. I did change the properties but when it didn’t change properly I put it back as it was originally in order to post to the forum

          Comment


            #6
            Remember you need to remove the indicator and add a new instance after you compile these changes.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Josh View Post
              Your code does not suggest you have made the change. Values[0] corresponds with the first Add(new Plot(...)) in Initialize(). Values[1] goes to the next, etc.
              finally got it. thanks.
              it just makes more sense that if r1 gets hit that i care more about easily seeing r2 or pp rather than seeing s1 being next on the data box list.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by jclose, Today, 09:37 PM
              0 responses
              4 views
              0 likes
              Last Post jclose
              by jclose
               
              Started by WeyldFalcon, 08-07-2020, 06:13 AM
              10 responses
              1,413 views
              0 likes
              Last Post Traderontheroad  
              Started by firefoxforum12, Today, 08:53 PM
              0 responses
              10 views
              0 likes
              Last Post firefoxforum12  
              Started by stafe, Today, 08:34 PM
              0 responses
              10 views
              0 likes
              Last Post stafe
              by stafe
               
              Started by sastrades, 01-31-2024, 10:19 PM
              11 responses
              169 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Working...
              X