Plot issue with custom exponential indicator.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #46171 quote
    xel
    Participant
    Average

    Good day folks!

    Im having a crazy issue with one of my custom indicators, The Exponential Deviation Band:

    // EXPONENTIAL WEIGHTED DEVIATION BANDS
    PRICE  = LOG(customclose)
    // EWMA (EMA)
    EWMA   = ExponentialAverage[Lookback](PRICE)
    // ELASTIC WEIGHTED STANDARD DEVIATION (ESD)
    alpha  = 2/(Lookback+1)
    error  = PRICE - EWMA
    dev    = SQUARE(error)
    if barindex < Lookback then
    var  = dev
    else
    var   = alpha * dev + (1-alpha) * var[1]
    endif
    ESD   = SQRT(var)
    // BANDS
    UB  = EXP(EWMA + (DEVIATIONS*ESD))
    BB  = EXP(EWMA - (DEVIATIONS*ESD))
    MID = EXP(EWMA)
    RETURN MID as "EVWMA", UB as "+ESD", BB as "-ESD"

    When applying the former one to normal series price, EDBands plots quite well but if you try to apply it to some other indicators, in particular to the Internal  ProRealTime (v10.3 – 1.8.0_45) “Historical Volatility” the bands just do not return any value at all.

    Screenshot added.

    Anything I am missing at coding..?

    Cheers everyone!

    #46285 quote
    Nicolas
    Keymaster
    Master

    I did not test this quick fix, but you can try embed the whole code into these lines:

    if barindex>Lookback then 
     // add the indicator code
    endif
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Plot issue with custom exponential indicator.


ProBuilder support

New Reply
Author
author-avatar
xel @xel Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by Nicolas
8 years, 4 months ago.

Topic Details
Forum: ProBuilder support
Language: English
Started: 09/13/2017
Status: Active
Attachments: 1 files
Logo Logo
Loading...