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

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 Philippe56140, Today, 02:35 PM
                0 responses
                2 views
                0 likes
                Last Post Philippe56140  
                Started by 00nevest, Today, 02:27 PM
                0 responses
                1 view
                0 likes
                Last Post 00nevest  
                Started by Jonafare, 12-06-2012, 03:48 PM
                5 responses
                3,986 views
                0 likes
                Last Post rene69851  
                Started by Fitspressorest, Today, 01:38 PM
                0 responses
                2 views
                0 likes
                Last Post Fitspressorest  
                Started by Jonker, Today, 01:19 PM
                0 responses
                2 views
                0 likes
                Last Post Jonker
                by Jonker
                 
                Working...
                X