Announcement

Collapse
No announcement yet.

Pivot formula in EMA

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

  • Pivot formula in EMA

    Hello,

    why does that not works:

    EMA5Piv = ema(5,(high()+low()+close())/3);
    ...
    ..
    .
    return new Array (yyy,xxx,EMA5Piv) ;

    The EMA5Piv won't be displayed! I want the EMA Length 5 of the pivot point.
    Is there any alternative to this code that works?

    Thanks for response.

    Best regards

    Roland

  • #2
    Roland
    In order for the ema() function to work the source needs to be a series (see the syntax at the linked article in the EFS KnowledgeBase). This can be a price series (ie high(), low(), volume(), etc) or a custom series created in a separate function or efs and called using either efsInternal() or efsExternal().
    (high()+low()+close())/3 does not return a series but a value because when you process a series [as in the case of your expression] the result is a single value and not a series.
    Anyhow there is already a wrapper function for the expression (high()+low()+close())/3 which is hlc3() and that returns a series
    Alex

    Comment

    Working...
    X