Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Someone give me a formula

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

    #16
    Dude. Where have you been for the past 9 months??

    That does look at lot easier than what I had to figure out the 'decimals' variable. I didn't even know that Round2TickSize() method existed! Thanks, buddy!

    Comment


      #17
      Giving back

      Well people like Ralph and many others have helped me along the path to enlightenment - otherwise known as C# - glad it helped.
      I pondered about posting my solution as I thought it can't be that simple

      Comment


        #18
        Not so simple

        Maybe someone else ( eg Nt?)could provide an answer to this

        if I Print(Close[0]) on forex futures eg 6E and the price is 1.350
        the output is 1.35 - no trailing zero.
        Is there anyway to 'restore' the trailing zero as I use a substring function to knock off the first 3 or 4 digits and it is just so irritating to have to consciously think ,no, 35 is actually 350. I know I know it''s picky.

        This doesn't happen on other futures it appears.
        Last edited by Mindset; 04-08-2010, 11:50 AM. Reason: added clarification of instrument

        Comment


          #19
          Have you tried already those formatting options for #'s?

          Comment


            #20
            Mindset, using String formatting will work but would be specific to an instrument. I place this outside of OnBarUpdate() usually just before Properties and use this in all my indicators.

            private string FormatPrice(double iVal)
            {
            return Bars.Instrument.MasterInstrument.FormatPrice(iVal) ;
            }

            Then a print statement like this will always work:

            Print(FormatPrice(Close[0]))
            eDanny
            NinjaTrader Ecosystem Vendor - Integrity Traders

            Comment


              #21
              FormatPrice

              Appreciate that eDanny.
              I had RoundPrice but this does the trick very well.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              633 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              364 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              105 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              567 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              568 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X