Announcement

Collapse
No announcement yet.

ATR study

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

  • ATR study

    When I use the Atr function in my efs script the values get returned with two decimal points. But when I load the Average True Range from the Basic studies the returned value has 6 decimal points. How can i make the function return more than 2 decimals inside my efs script?
    I call it like this var study = atr(14);

    Many thanks,

    Baldur

  • #2
    Hello Baldur,

    The Advanced Chart does some automatic rounding in the cursor window for returned indicators. One option you can try so that you can see the 6 decimal places is to return the indicator twice. One return will be a number, which gets plotted on the chart. The second return will be a string representation of the number that will show the 6 decimal places. To create the string, use the .toFixed(6) method like below.

    PHP Code:
    function main() {
        var 
    study atr(14);
        return new Array(
    studystudy.toFixed(6));

    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation

    Comment

    Working...
    X