Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Data Box, precision

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

    Data Box, precision

    NT 7b11

    I have an indicator that gets values into +- several million. When displayed in the Data Box the values are shown as whole numbers suffixed with an "M". This is virtually useless.

    Am I missing something or does this need to be fixed in your code?
    Attached Files

    #2
    tquinn,

    If you would like more decimal points please override the FormatPriceMarkers() method to do so.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      I'm willing, but I'll need another tip or 2 to get going. Thanks for your patience

      Comment


        #4
        Please see my code snippet here in post #46: http://www.ninjatrader-support2.com/...t=24358&page=4
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Josh, have tried your code snippet as follows;

          public override string FormatPriceMarker(double price)
          {
          // Formats price values to 4 decimal places
          return price.ToString("N4");

          }
          But I am getting the following Error "'NinjaTrader.Indicator.SolasTrendFinderAlgorithmF OREX.FormatPriceMarker(double)': no suitable method found to override"

          I have 2 dataseries that I would like to increse their precision .. Long_TStop and Short_TStop....

          protected override void Initialize()
          {
          Add(new Plot(Color.FromKnownColor(KnownColor.Green), PlotStyle.Bar, "Long_TStop"));
          Add(new Plot(Color.FromKnownColor(KnownColor.Red), PlotStyle.Bar, "Short_TStop"));
          }

          #region Properties
          [Browsable(false)] // this line prevents the data series from being displayed in the indicator properties dialog, do not remove
          [XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
          public DataSeries Trend
          {
          get { return Values[0]; }
          }

          [Browsable(false)] // this line prevents the data series from being displayed in the indicator properties dialog, do not remove
          [XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
          public DataSeries Long_TStop
          {
          get { return Values[1]; }
          }

          [Browsable(false)] // this line prevents the data series from being displayed in the indicator properties dialog, do not remove
          [XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
          public DataSeries Short_TStop
          {
          get { return Values[2]; }
          }

          Question : What am I missing?

          Comment


            #6
            mefTrader,

            Are you on NT7? If so, please be sure the method is on the same "level" as OnBarUpdate() and Initialize(). Perhaps you had it outside of the Indicator class? This would not be available in 6.5.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Im on NT 6.5 - and I have it at the same level at OnBarUpdate() and Initialize()

              Here is the code snippet

              protected override void Initialize()
              {
              Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Trend"));
              Add(new Plot(Color.FromKnownColor(KnownColor.Green), PlotStyle.Bar, "Long_TStop"));
              Add(new Plot(Color.FromKnownColor(KnownColor.Red), PlotStyle.Bar, "Short_TStop"));
              Add(new Plot(Color.FromKnownColor(KnownColor.Black), PlotStyle.Bar, "DoNothing"));
              Add(new Plot(Color.FromKnownColor(KnownColor.White), PlotStyle.Line, "MaxRange"));
              Add(new Plot(Color.FromKnownColor(KnownColor.White), PlotStyle.Line, "Brkout_FIF_H"));
              Add(new Plot(Color.FromKnownColor(KnownColor.White), PlotStyle.Line, "Brkdn_FIF_L"));
              Add(new Plot(Color.FromKnownColor(KnownColor.White), PlotStyle.Line, "Brkout_Hourly_H"));
              Add(new Plot(Color.FromKnownColor(KnownColor.White), PlotStyle.Line, "Brkdn_Hourly_L"));
              Add(new Plot(Color.FromKnownColor(KnownColor.White), PlotStyle.Line, "Brkout_F_Hourly_H")); // 4 Hourly
              Add(new Plot(Color.FromKnownColor(KnownColor.White), PlotStyle.Line, "Brkdn_F_Hourly_L"));
              Add(new Plot(Color.FromKnownColor(KnownColor.White), PlotStyle.Line, "Brkout_YHOD"));
              Add(new Plot(Color.FromKnownColor(KnownColor.White), PlotStyle.Line, "Brkdn_yLOD"));
              Add(new Plot(Color.FromKnownColor(KnownColor.White), PlotStyle.Line, "Brkout_HOD"));
              Add(new Plot(Color.FromKnownColor(KnownColor.White), PlotStyle.Line, "Brkdn_LOD"));
              Add(new Plot(Color.FromKnownColor(KnownColor.White), PlotStyle.Line, "Stock_Weighting"));
              CalculateOnBarClose = true;
              Overlay = false;
              PriceTypeSupported = false;
              PercentR = new DataSeries(this);
              TrStop = new DataSeries(this);
              VendorLicense("SolasFinancial", "SolasAnnual2010", "www.solastrader.com", "[email protected]");
              Plots[1].Pen.Width = 2;
              Plots[2].Pen.Width = 2;
              Plots[3].Pen.Width = 2;
              }

              public override string FormatPriceMarker(double price)
              {
              // Formats price values to 4 decimal places
              return price.ToString("N4");
              }
              /// <summary>
              /// Called on each bar update event (incoming tick)
              /// </summary>
              protected override void OnBarUpdate()
              {

              Comment


                #8
                mefTrader,

                This will not work in NT6.5. You can only do this going forward in NT7.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  how do I do it for NT6.5? My Forex Charts / Data box shows only 2pts of precision!

                  Comment


                    #10
                    You cannot do it in 6.5. This feature is only available in 7.
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #11
                      OKay working in NT7 now - but can I select which plots I would like the higher precision on and leave the other alone?

                      Comment


                        #12
                        mefTrader, unfortunately this is an all-or-nothing piece of code. Either all the plots have the same higher precision or none of them do.
                        AustinNinjaTrader Customer Service

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                        0 responses
                        595 views
                        0 likes
                        Last Post Geovanny Suaza  
                        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                        0 responses
                        343 views
                        1 like
                        Last Post Geovanny Suaza  
                        Started by Mindset, 02-09-2026, 11:44 AM
                        0 responses
                        103 views
                        0 likes
                        Last Post Mindset
                        by Mindset
                         
                        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                        0 responses
                        556 views
                        1 like
                        Last Post Geovanny Suaza  
                        Started by RFrosty, 01-28-2026, 06:49 PM
                        0 responses
                        554 views
                        1 like
                        Last Post RFrosty
                        by RFrosty
                         
                        Working...
                        X