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

autoscale

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

    autoscale

    Hi

    How do i turn autoscale off in an indicator?

    Its greyed out and the indicator is printing strange!

    Regards

    #2
    The problem is the scale starts too low at 0 which makes the indicator look weird

    Comment


      #3
      Hello lucyjoy,

      Thank you for your post.

      Please attach a screenshot of your chart to your response so I may investigate this matter further.

      Comment


        #4
        Hi thanks

        On the right you see tradestation, on the left ninjatrader, i dont understand how tradestation decides the scale but it looks messed up in ninja.

        I can manually change the scale which fixes it but how do i get it to plot correct as standard?

        Comment


          #5
          Hello lucyjoy,

          Thank you for your response.

          Is this a custom indicator you have developed? If so, may I test the indicator on my end?

          I look forward to your response.

          Comment


            #6
            Hi Patrick

            Thanks, I have pm'ed you, you help would be really appreciated.

            Lucy

            Comment


              #7
              Hello lucyjoy,

              Thank you for that file.

              You will need to set the AutoScale in the Initialize() method:
              Code:
                      protected override void Initialize()
                      {
              	 AutoScale = false;
              For information on AutoScale please visit the following link: http://www.ninjatrader.com/support/h.../autoscale.htm

              Please let me know if I may be of further assistance.

              Comment


                #8
                Hi

                That code is already in the code i sent you....

                It sets the scale from 1 to 0 i need it to mimic the scale of the chart... like

                1.55443 - 1.55043

                Thanks
                Last edited by lucyjoy; 05-01-2013, 02:38 PM.

                Comment


                  #9
                  Hello Lucy,

                  Thank you for your response.

                  Can you attach a screenshot of your chart to your response?

                  I look forward to your response.

                  Comment


                    #10
                    Hi

                    I want the scale on the emahisto indicator to match the scale on the main chart because it does not look right at moe



                    the top number is ok but the bottom should be more like 14800 instead of 0

                    Comment


                      #11
                      Hello Lucy,

                      Thank you for your response.

                      With the Bar Plot Style you will see the scaling from 0 to the value of the indicator. This can show large Bars with a moving average as the value of the moving average is likely extremely higher than the 0 line.

                      There is no method to use the current scaling of one panel for another panels scaling. You will need to either develop a custom plot for this indicator or use another Plot Style.

                      You can view a sample of custom plotting by going to the NinjaTrader Control Center > Tools > Edit NinjaScript > Indicator > CustomPlotSample.

                      Please let me know if I may be of further assistance.

                      Comment


                        #12
                        I was hoping you could help me code something please.

                        could i not make another indicator with

                        AutoScale = true;

                        MAX(EMAHISTO(CurrentBar - ChartControl.FirstBarsPainted))[0];
                        MIN(EMAHISTO(CurrentBar - ChartControl.FirstBarsPainted))[0];

                        im just not sure how to make this indicator please help.
                        Last edited by lucyjoy; 05-02-2013, 08:09 AM.

                        Comment


                          #13
                          Hello Lucy,

                          Thank you for your response.

                          You will need to include the Period for the MAX and MIN:
                          Code:
                          MAX(EMAHISTO(CurrentBar - ChartControl.FirstBarsPainted), [B]maxPeriod[/B])[0];
                          MIN(EMAHISTO(CurrentBar - ChartControl.FirstBarsPainted), [B]minPeriod[/B])[0];
                          For information on MAX and MIN please visit the following links:
                          Please let me know if I may be of further assistance.

                          Comment


                            #14
                            Hi

                            I have tried everything, i dont usually get these sort of problems...

                            Code:
                            // This namespace holds all indicators and is required. Do not change it.
                            namespace NinjaTrader.Indicator
                            {
                                /// <summary>
                                /// Enter the description of your new custom indicator here
                                /// </summary>
                                [Description("Enter the description of your new custom indicator here")]
                                public class MyCustomIndicator : Indicator
                                {
                                    #region Variables
                                    // Wizard generated variables
                                        private int myInput0 = 1; // Default setting for MyInput0
                                    // User defined variables (add any user defined variables below)
                                    #endregion
                            
                                    /// <summary>
                                    /// This method is used to configure the indicator and is called once before any bar data is loaded.
                                    /// </summary>
                                    protected override void Initialize()
                                    {
                                        Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Plot0"));
                                        Overlay				= false;
                            			AutoScale = true;
                                    }
                            
                                    /// <summary>
                                    /// Called on each bar update event (incoming tick)
                                    /// </summary>
                                    protected override void OnBarUpdate()
                                    {
                                        // Use this method for calculating your indicator values. Assign a value to each
                                        // plot below by replacing 'Close[0]' with your own formula.
                                        MAX(EMAHISTO(CurrentBar - ChartControl.FirstBarsPainted), 10)[0];
                                    }
                            Here is my indicator

                            Im getting these errors

                            How do i just make this work


                            Indicator\MyCustomIndicator.cs Only assignment, call, increment, decrement, and new object expressions can be used as a statement CS0201 - click for info 45 13

                            Indicator\MyCustomIndicator.cs 'NinjaTrader.Gui.Chart.ChartControl' does not contain a definition for 'FirstBarsPainted' and no extension method 'FirstBarsPainted' accepting a first argument of type 'NinjaTrader.Gui.Chart.ChartControl' could be found (are you missing a using directive or an assembly reference?) CS1061 - click for info 45 52

                            Comment


                              #15
                              Hello Lucy,

                              Thank you for your response.

                              What are you trying to achieve with MAX, MIN and the use of the ChartControl.FirstBarsPainted?

                              I look forward to your response.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by cmtjoancolmenero, Yesterday, 03:58 PM
                              3 responses
                              23 views
                              0 likes
                              Last Post cmtjoancolmenero  
                              Started by Brevo, Today, 01:45 AM
                              1 response
                              14 views
                              0 likes
                              Last Post NinjaTrader_ChelseaB  
                              Started by rjbtrade1, 11-30-2023, 04:38 PM
                              2 responses
                              72 views
                              0 likes
                              Last Post DavidHP
                              by DavidHP
                               
                              Started by suroot, 04-10-2017, 02:18 AM
                              5 responses
                              3,021 views
                              0 likes
                              Last Post NinjaTrader_Gaby  
                              Started by Stanfillirenfro, Today, 07:23 AM
                              1 response
                              6 views
                              0 likes
                              Last Post NinjaTrader_Gaby  
                              Working...
                              X