Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Decimal precision of a column

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

    Decimal precision of a column

    How do I change the decimal precision of a column in Market Analyzer?
    The output value is a DataSeries and has this code:

    public DataSeries Status
    {
    get { return Values[0]; }
    }

    Thanks,
    Gary

    #2
    Unfortunately this is beyond what we provide support for.

    However, here is a hint: please take a look at the method
    >> protected override string Format(double value)
    .. in the file MarketAnalyer/@AskPrice.cs

    Comment


      #3
      Originally posted by NinjaTrader_Dierk View Post
      Unfortunately this is beyond what we provide support for.

      However, here is a hint: please take a look at the method
      >> protected override string Format(double value)
      .. in the file MarketAnalyer/@AskPrice.cs
      Ah interesting. I understand that NinjaTrader Support can't provide support for such methods, but because the default NetChange in the Market Analyzer doesn't work on EOD data (when there is no connection to a data provider), I'm struggling to find a work around for this. So, I hope that perhaps other forum users can help me find the error in the following code in my indicator:

      Code:
      [COLOR=black][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]protected[/SIZE][/FONT][/SIZE][/FONT][/SIZE][/FONT][/COLOR][COLOR=black][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]override[/SIZE][/FONT][/SIZE][/FONT][/SIZE][/FONT][/COLOR][COLOR=black][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]void[/SIZE][/FONT][/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]OnBarUpdate[/SIZE][/FONT][B][COLOR=black]()[/COLOR][/B]
      [B][COLOR=black]{[/COLOR][/B]
      [/SIZE][/FONT][/SIZE][/FONT][/COLOR][COLOR=black][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]double[/SIZE][/FONT][/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]percChange=[B] (([/B]Close[B][[/B]0[B]] [/B]-Close[B][[/B]1[B]]) [/B]/Close[B][[/B]1[B]]) [/B]*100[/SIZE][/FONT][B][COLOR=black];[/COLOR][/B]
      [COLOR=black]DailyPercChange.Set[B]([/B]percChange[/COLOR][B][COLOR=black]);[/COLOR][/B]
      [B][COLOR=black]}[/COLOR][/B]
      [/SIZE][/FONT][/SIZE][/FONT][/COLOR][COLOR=black][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]protected[/SIZE][/FONT][/SIZE][/FONT][/SIZE][/FONT][/COLOR][COLOR=black][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]override[/SIZE][/FONT][/SIZE][/FONT][/SIZE][/FONT][/COLOR][COLOR=black][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]string[/SIZE][/FONT][/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]Format[B]([/B][/SIZE][/FONT][/SIZE][/FONT][/SIZE][/FONT][/COLOR][COLOR=black][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]double[/SIZE][/FONT][/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]value[/SIZE][/FONT][B][COLOR=black])[/COLOR][/B]
      [B][COLOR=black]{[/COLOR][/B]
      [/SIZE][/FONT][/SIZE][/FONT][/COLOR][COLOR=black][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]return[/SIZE][/FONT][/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]value.ToString[B]([/B][/SIZE][/FONT][/SIZE][/FONT][/SIZE][/FONT][/COLOR][COLOR=black][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]"0.00"[/SIZE][/FONT][/SIZE][/FONT][/SIZE][/FONT][B][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]) [/SIZE][/FONT][/SIZE][/FONT][/SIZE][/FONT][/B][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]+[/SIZE][/FONT][/SIZE][/FONT][/SIZE][/FONT][/COLOR][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2][COLOR=black]"%"[/COLOR][/SIZE][/FONT][/SIZE][/FONT][/SIZE][/FONT][B][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2][COLOR=black];[/COLOR][/SIZE][/FONT][/SIZE][/FONT][/SIZE][/FONT][/B][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]
      [B][SIZE=2][FONT=Consolas][COLOR=black]}[/COLOR][/FONT][/SIZE][/B]
      [/SIZE][/FONT][/SIZE][/FONT]
      If there is another way to let the Market Analyzer work with Historical data (instead of the OnMarketData method) I would love to hear about this.

      Regards,

      Comment


        #4


        You likely miss this check above - do you see any errors in the log tab of the Control Center when trying to load this snippet you've created?

        Comment


          #5
          Originally posted by NinjaTrader_Bertrand View Post
          http://www.ninjatrader.com/support/f...ead.php?t=3170

          You likely miss this check above - do you see any errors in the log tab of the Control Center when trying to load this snippet you've created?
          Thanks Bertrand.

          The error I receive is (translated from Dutch so on an English Windows version it might look somewhat different):
          Code:
          NinjaTrader.Indicator.MANetChange.Format(double): not founded a suitable method to overwrite - CS0115
          If I need to guess, I'd say that it doesn't work because with an custom indicator you use a DataSeries, whereas the default Market Analyzer indicators only use one value (the most recent OnMarketData value).

          Regards,

          Comment


            #6
            The code snippet you picked is for a MA column, not an indicator I believe...

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            88 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            48 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            30 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            34 views
            0 likes
            Last Post TheRealMorford  
            Started by Mindset, 02-28-2026, 06:16 AM
            0 responses
            68 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Working...
            X