[pshaiCmd] SuperTrend Extended

0 1225 Views 1 Comment 2 years ago
  • SuperTrend Extended indicator.

    This command version provides inputs for price data, which allows to use this indicator over MACD or RSI data for example.

    Input paramaters:
    * atrPeriod : ATR period length (for example 22)
    * atrMult : ATR multiplier (for example 3)
    * [wicks] : Whether to take wicks into account or not (default is false)

    * SuperTrend line values

    **NOTE**: The command does not handle any plotting nor does it produce any signals!

    Example of usage:

    local c = ClosePrices()
    local macd = MACD(c, 12, 26, 9)
    local macdLine = macd[1]
    local st = CC_SuperTrendExt(macdLine, macdLine, macdLine, 22, 3)
    -- Plot macd
    Plot(1, 'MACD', macdLine)
    local upperId = Load('uid', NewGuid())
    local lowerId = Load('lid', NewGuid())
    if st < macdLine then
        upperId = NewGuid() -- reset upper id
        Plot(1, 'Long Stop', st, {c=Green, id=lowerId})
        -- DoBuy()
        lowerId = NewGuid() -- reset lower id
        Plot(1, 'Short Stop', st, {c=Red, id=upperId})
        -- DoSell()
    Save('uid', upperId)
    Save('lid', lowerId)
    • This topic was modified 1 year, 6 months ago by pshai. Reason: [UPDATE] Added warmup system
    • This topic was modified 1 year ago by pshai. Reason: Fixed HL
    HaasScript Code
    Sign in or Register to download for free
    • #2210

      hi, i need the steps on How to install. Thanks a bunch

Login or Register to Comment

Unlock your crypto trading potential

Create a free account and enjoy everything we have to offer.

Join for Free