Announcement

Collapse
No announcement yet.

Adding decimalls

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

  • Adding decimalls

    Hi
    How do I get attached study to add at least 3 more decimal places. I tried going to file,preferences, and clicked on show price position but that didnt work.
    Thanks
    Attached Files

  • #2
    Re: Adding decimalls

    ljft
    At this time there isn't a way to increase the number of decimals of a plot beyond what is determined by the efs engine.
    You have a couple of workarounds available to you.
    One is to multiply each element of the returned array by a constant ie 10, 100, 1000, etc depending on how many digits you need eg
    PHP Code:
    return new Array (o*1000h*1000, ...) 
    The other is to also return a string for each element of the return array. The number of decimals in a string can be manipulated and while strings will not plot on a chart they will display their values in the Cursor Window. To do this you would use the .toFixed() method of the Number Object
    PHP Code:
    return new Array (oo.toFixed(5), hh.toFixed(5), ...//toFixed(5) will force the string to display 5 decimals 
    If you implement this option you will find that each item is then duplicated in the Cursor Window. To remove the redundant items [specifically the ones with less decimals) you need to add a setShowCursorLabel() statement in the preMain function for each element of the return array that you want to hide in the Cursor Window eg
    PHP Code:
    setShowCursorLabel(false0);//hides the first element of the return array
    setShowCursorLabel(false2);//hides the third element of the returned array
    //etc 
    Keep in mind that while the labels in the Cursor Window will display the number of decimals you have defined the plots themselves will still display the number of decimals determined by the efs engine
    Alex


    Originally posted by ljft
    Hi
    How do I get attached study to add at least 3 more decimal places. I tried going to file,preferences, and clicked on show price position but that didnt work.
    Thanks

    Comment


    • #3
      Thanks

      I appreciate the explanation

      Comment


      • #4
        ljft
        My pleasure
        Alex


        Originally posted by ljft
        Thanks

        I appreciate the explanation

        Comment

        Working...
        X