Announcement

Collapse
No announcement yet.

2M or 2K Average Volume

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

  • 2M or 2K Average Volume

    I've an EFS file that would return the average volume

    Example:

    20,000,000

    or

    2,000,000

    or

    200,000

    What code is needed to format the number to the one below, which is allot easier to read and less space on the screen.

    20M

    or

    2M

    or

    2K


    Thank you

    Keto

  • #2
    Keto
    Adding a letter will turn the numbers into a string which cannot be plotted. It will display in the cursor window in that format though (see image below).
    Alex

    Comment


    • #3
      Sorry Alexis maybe I was not clear I don't want to Plot it I just want the number in the picture

      4261660 to be 4M

      Thank you

      Keto
      Attached Files

      Comment


      • #4
        Keto
        Assume as an example that your moving average of Volume is vMA then you could do the following

        var vol;
        if(vMA>=1000000)
        vol=((vMA/1000000)).toFixed(0)+"M";
        if(vMA<1000000)
        vol=((vMA/1000)).toFixed(0)+"K";


        Then in the drawText command you would use vol as the value to be written in the chart.
        Alex

        Comment


        • #5
          What can I say

          Thank you very much for the million time

          that is what I needed

          you are the best

          Thank you very much

          Keto

          Comment

          Working...
          X