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

Panel Plot Min and Max

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

    Panel Plot Min and Max

    Hi,
    Is it possible to set a max and min value for the panels below the price pane? I would like to set the y-axis to be between min = 0 and max = 1.35. If yes, how? Thank you.

    #2
    Zeos,

    Unfortunately there is no way to set the indicator scale by code. It's based on the highest and lowest values of the indicator.

    One work around to this is setting upper / lower bound plot values to the same color as the chart background.

    Please let me know if I may assist further.
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      Hi Adam_P,

      Thank you. Can you shoot me a quick sample of doing this? Thanks.

      Comment


        #4
        Zeos,

        Sure, http://www.ninjatrader.com/support/f...ead.php?t=3227

        Please let me know if I may assist further.
        Adam P.NinjaTrader Customer Service

        Comment


          #5
          That is not what I had in mind but thank you.

          Comment


            #6
            Zeos,

            Basically :

            if ( MyDataseries[0] > 1.35)
            {
            //set color to same as background
            }
            else if ( MyDataseries[0] < 0 )
            {
            //set color to same as background
            }

            I believe Color.Transparent will work. The reference sample I provided should allow you to figure out how to change colors for your plots.

            Please let me know if I may assist further.
            Adam P.NinjaTrader Customer Service

            Comment


              #7
              Hi Adam_P,

              Thank you. Your code simply cuts off the display of the data. I wanted the panel plot to remain between y-min and y-max because all values would always remain between those min and max values. So for example, if your values are always between 0 and 1 then you want the y-axis of the panel to always remain between 0 and 1. The idea is to set a min and a max value for the plot.

              One way to do it would be to plot a transparent horizontal line at the min and max values but I thought that there might be a cleaner way to do this via some setting.

              In fact Chart Controls allow you to set Axis.Minimum and Axis.Maximum so it should be doable in NInja.
              Last edited by Zeos6; 02-14-2012, 03:35 PM.

              Comment


                #8
                Zeos,

                If you want to totally cut out these values, you could simply check for max/min and truncate.

                I.e.

                If ( MyDataSeries[0] > 1.35)
                {
                MyDataSeries[0] = 1.35;
                }

                Something like that. You can even keep track of a secondary data series that is the actual values, then truncate only the plot values.
                Adam P.NinjaTrader Customer Service

                Comment


                  #9
                  Hi,
                  Chart Controls allow you to set Axis.Minimum and Axis.Maximum so it should be doable in NInja. Can you please confirm. Thanks.

                  Comment


                    #10
                    Zeos,

                    Yes, the issue is that its unsupported so I was trying to offer you suggestions we could support. If you want to do this you would need to seek help from the community.

                    Please let me know if I may assist further.
                    Adam P.NinjaTrader Customer Service

                    Comment


                      #11
                      Thank you. I understand. I will work on this.

                      Comment


                        #12
                        Limit a plot value

                        Hi Adam I have read through this post as I want to set a max value for a plot. Hope you can help as the suggestions made did not work and it is because I am working with time.

                        I have written a simple code to time a volume bar relative to previous bars and then color it accordingly. This shows me whether the volume is accelerating or not. I want to limit the plot value of each bar to a max of 120 secs regardless of the actual time value.
                        I want to do this as the first bar on Sunday pm is 179,100 secs (fri close to sunday pm open)
                        and the average is about 70 secs during trading hours so the 70 gets lost from the graph once the bar is plotted. Same problem over night as well.

                        Obviously I cant have anything less or more than 86,400 secs in a day but I was hoping to be able to terminate the plot (not the value) at 120 secs per bar.

                        Any ideas?

                        Code:
                        TimeSpan timer = Time[0] - Time[1];
                        Value.Set(timer.TotalSeconds);

                        Thanks;

                        Ben.

                        Comment


                          #13
                          Originally posted by stocktraderbmp View Post
                          Hi Adam I have read through this post as I want to set a max value for a plot. Hope you can help as the suggestions made did not work and it is because I am working with time.

                          I have written a simple code to time a volume bar relative to previous bars and then color it accordingly. This shows me whether the volume is accelerating or not. I want to limit the plot value of each bar to a max of 120 secs regardless of the actual time value.
                          I want to do this as the first bar on Sunday pm is 179,100 secs (fri close to sunday pm open)
                          and the average is about 70 secs during trading hours so the 70 gets lost from the graph once the bar is plotted. Same problem over night as well.

                          Obviously I cant have anything less or more than 86,400 secs in a day but I was hoping to be able to terminate the plot (not the value) at 120 secs per bar.

                          Any ideas?

                          Code:
                          TimeSpan timer = Time[0] - Time[1];
                          Value.Set(timer.TotalSeconds);

                          Thanks;

                          Ben.
                          Ben,

                          What is your CalculateOnBarClosed set to? Could you possible clarify what you are trying to do here? I am not sure I understand.

                          Setting max / min values for a plot is different than max/min amount of time you want to take into consideration for a plot.
                          Adam P.NinjaTrader Customer Service

                          Comment


                            #14
                            Hi Adam;

                            I have had a reply from one of the other guys thank you, who has solved the problem using 'Math.Min'.

                            Obvious when you see the answer but I was trying to formulate a maximum value during the calculation rather than when the plot is 'Set'.

                            Thanks for your time,

                            Ben.

                            Comment


                              #15
                              Originally posted by NinjaTrader_AdamP View Post
                              Zeos,

                              Unfortunately there is no way to set the indicator scale by code. It's based on the highest and lowest values of the indicator.
                              What is the highest and lowest values for an indicator? Do you mean values from added plots?

                              I have the same problem. My indicator on the secondary pane usually fluctuates around 2,000 (it is >= 1950) so because NinjaTrader shows price scale from 0 to 2000, the plot becomes really flat.

                              is there any way to move min price scale value of 0 (why is it zero btw?) to the minimum of indicator's series value?

                              Thank you.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by jclose, Today, 09:37 PM
                              0 responses
                              5 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
                              11 views
                              0 likes
                              Last Post firefoxforum12  
                              Started by stafe, Today, 08:34 PM
                              0 responses
                              11 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