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

Price label on indicator horiz' line

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

    #31
    quicktrick, thanks for the post - running a quick test I see decimals showing. What instrument / timeframe do you work on with it?

    Thanks,
    BertrandNinjaTrader Customer Service

    Comment


      #32
      Bertrand, thank you for the prompt reply.

      ES, CL, TF -- any instrument, any timeframe (minutes, range etc.). May it be because I use another locale -- Russian -- with comma as a period sign instead of dot?

      How to fix it not changing the locale?
      Last edited by quicktrick; 11-06-2014, 10:36 AM.

      Comment


        #33
        The price formatting is established in the OnBarUpdate method, subsection: if (!_init)

        Modify the line: _priceFormat = string.Format("F{0}", Digits);
        to get what you need.

        Check out the MSDN C# reference for parameters going to string.Format.

        Comment


          #34
          EnsoTrader, thank you for your help! I tried different string formats previously, but without much success. Today I tried to change string formats again and again without any success. But I noticed there one thing in two places: TickSize.ToString().IndexOf(".")

          I replaced dot with comma there, and everything is working now!

          Not very good code however, depending on the locale.

          Thanks again!

          Alex
          Last edited by quicktrick; 11-07-2014, 05:11 AM.

          Comment


            #35
            You're welcome Quicktrick.

            Check out this:
            http://msdn.microsoft.com/en-us/libr...ormatinfo.aspx

            Use NumberFormatInfo.CurrencyDecimalSeparator to remove the hard coding and make it culture locale aware.

            Comment


              #36
              Thanks a lot EnsoTrader!

              Though I'm not a programmer (I had been a C programmer for some time about 25 years ago ) and I don't know C#, I've made it.

              Here is a locale independent (I hope so) version of LabelHorzLinesAlerts.

              All the best to you!

              Alex
              Attached Files
              Last edited by quicktrick; 11-07-2014, 08:11 AM.

              Comment


                #37
                label horizontal lines zip

                It works for me. Thanks

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Rapine Heihei, Today, 08:19 PM
                1 response
                8 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by Rapine Heihei, Today, 08:25 PM
                0 responses
                6 views
                0 likes
                Last Post Rapine Heihei  
                Started by f.saeidi, Today, 08:01 PM
                1 response
                9 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by Rapine Heihei, Today, 07:51 PM
                0 responses
                8 views
                0 likes
                Last Post Rapine Heihei  
                Started by frslvr, 04-11-2024, 07:26 AM
                5 responses
                98 views
                1 like
                Last Post caryc123  
                Working...
                X