Announcement

Collapse
No announcement yet.

Math and display of instruments that have an apostrophe in the price (ex:119'03).

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

  • Math and display of instruments that have an apostrophe in the price (ex:119'03).

    Hello,

    I have a script that does some calculation based on the price and outputs a line at a particular level.

    It works great for instruments that use normal decimals. However, for instruments like bonds (ZB #F) that have a price of 119'01, for example, when I display the number it comes out as a decimal value. It draws the line at the correct level, but the display value is 119.03125. Is there a function I can call to convert this to 119'01, or do I have to do a conversion myself?

    I believe the logic is every half tick is 0.015625 and every full tick is 0.03125, so some math could perform the conversion. But it would be nice if there was something already built-in.

    Thanks!

    Daniel
    eSignal File Share: http://share.esignal.com/groupcontents.jsp?groupid=1130

  • #2
    Re: Math and display of instruments that have an apostrophe in the price (ex:119'03).

    Daniel
    Use the formatPriceNumber() function to draw the text in the same format of the symbol
    Alex


    Originally posted by neoikon
    Hello,

    I have a script that does some calculation based on the price and outputs a line at a particular level.

    It works great for instruments that use normal decimals. However, for instruments like bonds (ZB #F) that have a price of 119'01, for example, when I display the number it comes out as a decimal value. It draws the line at the correct level, but the display value is 119.03125. Is there a function I can call to convert this to 119'01, or do I have to do a conversion myself?

    I believe the logic is every half tick is 0.015625 and every full tick is 0.03125, so some math could perform the conversion. But it would be nice if there was something already built-in.

    Thanks!

    Daniel

    Comment


    • #3
      Re: Re: Math and display of instruments that have an apostrophe in the price (ex:119'

      Perfect! That's just what I was looking for!

      Thanks!


      Originally posted by Alexis C. Montenegro
      Daniel
      Use the formatPriceNumber() function to draw the text in the same format of the symbol
      Alex
      eSignal File Share: http://share.esignal.com/groupcontents.jsp?groupid=1130

      Comment


      • #4
        Re: Re: Re: Math and display of instruments that have an apostrophe in the price (ex:119'

        Daniel
        You are most welcome
        Alex


        Originally posted by neoikon
        Perfect! That's just what I was looking for!

        Thanks!

        Comment

        Working...
        X