Indicateur type MACD – squeeze momentum

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #181530 quote
    ipbvbaipbvba
    Participant
    Junior

    Bonjour, je cherche à traduire cet indicateur du type MACD de la platforme trading view à PRT, je n’y comprends rien.

    Est ce possible? Merci

    //
    // @author LazyBear
    // List of all my indicators: https://www.tradingview.com/v/4IneGo8h/
    //
    study(shorttitle = “SQZMOM_LB”, title=”Squeeze Momentum Indicator [LazyBear]”, overlay=false)

    length = input(20, title=”BB Length”)
    mult = input(2.0,title=”BB MultFactor”)
    lengthKC=input(20, title=”KC Length”)
    multKC = input(1.5, title=”KC MultFactor”)

    useTrueRange = input(true, title=”Use TrueRange (KC)”, type=bool)

    // Calculate BB
    source = close
    basis = sma(source, length)
    dev = multKC * stdev(source, length)
    upperBB = basis + dev
    lowerBB = basis – dev

    // Calculate KC
    ma = sma(source, lengthKC)
    range = useTrueRange ? tr : (high – low)
    rangema = sma(range, lengthKC)
    upperKC = ma + rangema * multKC
    lowerKC = ma – rangema * multKC

    sqzOn = (lowerBB > lowerKC) and (upperBB < upperKC)
    sqzOff = (lowerBB < lowerKC) and (upperBB > upperKC)
    noSqz = (sqzOn == false) and (sqzOff == false)

    val = linreg(source – avg(avg(highest(high, lengthKC), lowest(low, lengthKC)),sma(close,lengthKC)),
    lengthKC,0)

    bcolor = iff( val > 0,
    iff( val > nz(val[1]), lime, green),
    iff( val < nz(val[1]), red, maroon))
    scolor = noSqz ? blue : sqzOn ? black : gray
    plot(val, color=bcolor, style=histogram, linewidth=4)
    plot(0, color=scolor, style=cross, linewidth=2)

    #181617 quote
    NicolasNicolas
    Keymaster
    Legend

    Je pense  que cet indicateur a déjà été convertit: https://www.prorealcode.com/prorealtime-indicators/squeeze-momentum-indicator-2/

    ipbvba thanked this post
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Indicateur type MACD – squeeze momentum


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
ipbvba @ipbvba Participant
Summary

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

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 11/13/2021
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...