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 Hwop38, 05-04-2026, 07:02 PM
              0 responses
              166 views
              0 likes
              Last Post Hwop38
              by Hwop38
               
              Started by CaptainJack, 04-24-2026, 11:07 PM
              0 responses
              320 views
              0 likes
              Last Post CaptainJack  
              Started by Mindset, 04-21-2026, 06:46 AM
              0 responses
              246 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by M4ndoo, 04-20-2026, 05:21 PM
              0 responses
              350 views
              0 likes
              Last Post M4ndoo
              by M4ndoo
               
              Started by M4ndoo, 04-19-2026, 05:54 PM
              0 responses
              179 views
              0 likes
              Last Post M4ndoo
              by M4ndoo
               
              Working...
              X