Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

conversion of trailing digits

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

    conversion of trailing digits

    Greetings,

    I'm trying to convert the trailing digits of an instrument price into a 1-100% scale. For example:

    if EUR/USD price = 1.55673, I'd like to convert to 67.3
    price = 1.5537, I'd like to convert to 37
    if USD/JPY price = 101.54, I'd like to convert to 54
    price = 101.982, I'd like to convert to 98.2
    etc, etc...

    Not sure of the commands used to accomplish this...Any help appreciated.

    #2
    Likely just do some math operations.
    RayNinjaTrader Customer Service

    Comment


      #3
      Yes I can multiply by 1000 or 100 or whatever is required but how am I to rid of the "leading" digits? What are the commands to "cut off" the ending digits that I require?

      Comment


        #4
        Please refer to the MSDN docs for this. It won't be a straight forward one step solution. You will need to manipulate the math on this several times.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Thank you. Does anybody know the name of this procedure? I need a place to start a search from but I don't have a guess as to what this type of operation is called?

          Comment


            #6
            Its really just math operations.

            the Math class may provide methods to help in this area.
            RayNinjaTrader Customer Service

            Comment


              #7
              If you have trouble with the math approach, you could aslo try string manipulation. Look up the string class for methods that can help you.
              RayNinjaTrader Customer Service

              Comment


                #8
                Thanks, strings seems a better approach.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by kazisl, Today, 06:41 PM
                0 responses
                2 views
                0 likes
                Last Post kazisl
                by kazisl
                 
                Started by einstein, Today, 06:20 PM
                0 responses
                2 views
                0 likes
                Last Post einstein  
                Started by op1031, Today, 05:51 PM
                0 responses
                3 views
                0 likes
                Last Post op1031
                by op1031
                 
                Started by nighttrader99, Today, 04:34 PM
                1 response
                8 views
                0 likes
                Last Post NinjaTrader_ShawnB  
                Started by Simon Investimens, Today, 02:51 PM
                1 response
                15 views
                0 likes
                Last Post NinjaTrader_ChrisL  
                Working...
                X