Help to convert Smart Money Flow Cloud [BOSWaves] Please

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #259880 quote
    ahenryahenry
    Participant
    Average

    Hi gurus,

    Can help me convert this smart money flow cloud into prorealtime indicator?

    I’ve tried using a few AI tools and not really successful as it’s using ALMA not EMA etc.

    Smart Money Flow Cloud [BOSWaves] β€” Indicator by BOSWaves β€” TradingView


    Thanks in advance. πŸ™‚

    #259889 quote
    robeen12robeen12
    Participant
    Veteran

    Hello,

    there it is…..

    // ================================================================

    // Smart Money Flow Cloud [BOSWaves] – ProRealTime ProBuilder

    // Adapted from Pine Script v6 (c) BOSWaves

    //

    // LIMITATIONS vs Pine Script original:

    //  – ALMA engine replaced by EMA (ALMA not built-in in ProBuilder)

    //  – Trend-strength gauge: use the companion oscillator script

    //  – Buy/Sell label styling is basic (no custom color per label)

    //

    // NOTE: In ProBuilder, period arguments in built-in functions must

    //  be LITERAL INTEGERS. To change a period, edit the number directly

    //  in the function call AND update the matching comment.

    // ================================================================


    // ─── Parameters ──────────────────────────────────────────────────

    // Periods are hardcoded as literals β€” see note above.

    // len=34 | basisSmooth=3 | mfLen=24 | mfSmooth=5 | atrLen=14


    mfPower   = 1.2  // Flow Boost      [min 0.5]

    minMult   = 0.9  // Band Tightness (Calm) [min 0.1]

    maxMult   = 2.2  // Band Expansion (Strong)[min 0.1]

    dotCooldown = 12  // Retest Signal Cooldown (bars)


    // Bullish color #00C8FF β†’ RGB(0, 200, 255)

    bullR = 0  

     bullG = 200 

     bullB = 255


    // Bearish color #FF005D β†’ RGB(255, 0, 93)

    bearR = 255 

     bearG = 0  

     bearB = 93


    // ─── Basis ───────────────────────────────────────────────────────

    // EMA(34) β†’ EMA(3) smoothing on open & close

    rawBasisC = EXPONENTIALAVERAGE[34](close)

    rawBasisO = EXPONENTIALAVERAGE[34](open)

    bC = EXPONENTIALAVERAGE[3](rawBasisC)

    bO = EXPONENTIALAVERAGE[3](rawBasisO)

    bMain = bC


    // ─── Smart Money Flow (CLV Γ— Volume) ────────────────────────────

    IF high = low THEN

    clv = 0

    ELSE

    clv = ((close – low) – (high – close)) / (high – low)

    ENDIF


    rawMF = clv * volume

    // mfLen=24 β€” change both [24] below to adjust the flow window

    sumRaw = SUMMATION[24](rawMF)

    sumAbs = SUMMATION[24](ABS(rawMF))


    IF sumAbs = 0 THEN

    mfRatio = 0

    ELSE

    mfRatio = sumRaw / sumAbs

    ENDIF


    // mfSmooth=5

    mfSm = EXPONENTIALAVERAGE[5](mfRatio)


    mfStrength = MAX(0, MIN(1, POW(ABS(mfSm), mfPower)))

    bandMult  = minMult + (maxMult – minMult) * mfStrength


    // ─── Adaptive Bands ──────────────────────────────────────────────

    // atrLen=14

    atr  = AVERAGETRUERANGE[14]

    upper = bMain + atr * bandMult

    lower = bMain – atr * bandMult


    // ─── Regime Tracking ─────────────────────────────────────────────

    longCond = close > upper AND close[1] <= upper[1]

    shortCond = close < lower AND close[1] >= lower[1]


    IF BarIndex = 0 THEN

    IF close >= bMain THEN

    lastSignal = 1

    ELSE

    lastSignal = -1

    ENDIF

    ELSIF longCond THEN

    lastSignal = 1

    ELSIF shortCond THEN

    lastSignal = -1

    ELSE

    lastSignal = lastSignal[1]

    ENDIF


    switchUp  = (lastSignal = 1) AND (lastSignal[1] = -1)

    switchDown = (lastSignal = -1) AND (lastSignal[1] = 1)


    // ─── Retest Dot Cooldown ─────────────────────────────────────────

    IF BarIndex = 0 THEN

    lastBearDotBar = -10000

    lastBullDotBar = -10000

    ENDIF


    bearDotCond = (lastSignal = -1) AND (high > bC)

    bullDotCond = (lastSignal = 1) AND (low < bC)


    bearOk = bearDotCond AND (dotCooldown = 0 OR (BarIndex – lastBearDotBar) >= dotCooldown)

    bullOk = bullDotCond AND (dotCooldown = 0 OR (BarIndex – lastBullDotBar) >= dotCooldown)


    IF bearOk THEN

    lastBearDotBar = BarIndex

    ENDIF

    IF bullOk THEN

    lastBullDotBar = BarIndex

    ENDIF


    // ─── Regime Color & Candles ──────────────────────────────────────

    // DRAWCANDLE replaces Pine Script’s plotcandle() β€” colors body and border

    IF lastSignal = 1 THEN

    DRAWCANDLE(open, high, low, close) COLOURED(bullR, bullG, bullB) BORDERCOLOR(bullR, bullG, bullB)

    r = bullR 

     g = bullG 

     b = bullB

    ELSE

    DRAWCANDLE(open, high, low, close) COLOURED(bearR, bearG, bearB) BORDERCOLOR(bearR, bearG, bearB)

    r = bearR 

     g = bearG 

     b = bearB

    ENDIF


    // ─── ColorBetween Fills ──────────────────────────────────────────

    // 1. Basis cloud: fill between bO and bC (regime-colored, 75% transparent)

    ColorBetween(bO, bC, r, g, b, 75)


    // 2. Bull fill: zone between lower band and close (bull regime only)

    IF lastSignal = 1 THEN

    ColorBetween(lower, close, bullR, bullG, bullB, 50)

    ENDIF


    // 3. Bear fill: zone between close and upper band (bear regime only)

    IF lastSignal = -1 THEN

    ColorBetween(close, upper, bearR, bearG, bearB, 50)

    ENDIF


    // ─── Trend Strength Calculation (tanh of normalized price position) ─

    upSpan = MAX(upper – bMain, 0.0001)

    dnSpan = MAX(bMain – lower, 0.0001)

     

    IF lastSignal = 1 THEN

    rawTS = (close – bMain) / upSpan

    ELSE

    rawTS = -(bMain – close) / dnSpan

    ENDIF

     

    tsX     = rawTS * 1.5

    tsEx    = EXP(tsX)

    tsEmx    = EXP(-tsX)

    tanhVal   = (tsEx – tsEmx) / (tsEx + tsEmx)

    strengthVal = EXPONENTIALAVERAGE[3](tanhVal)

    strengthPct = ROUND(ABS(strengthVal) * 100)

     

    // ─── Strength Dashboard (fixed panel, top-right corner) ──────────

    // anchor(topRIGHT, XSHIFT, YSHIFT) β†’ position fixe sur l’Γ©cran

    // #strengthPct# β†’ valeur dynamique insΓ©rΓ©e dans le texte

    IF ISLASTBARUPDATE THEN 

    // Fond colorΓ© selon le rΓ©gime (rectangle semi-transparent)

    DRAWRECTANGLE(-210, -25, -10, -100) ANCHOR(topRIGHT, XSHIFT, YSHIFT) FILLCOLOR(r, g, b, 70) BORDERCOLOR(r, g, b)

     

    // Titre

    DRAWTEXT(“Smart Money Flow”, -100, -42) ANCHOR(topRIGHT, XSHIFT, YSHIFT) COLOURED(25, 25, 25)

     

    // RΓ©gime (β–² Bull / β–Ό Bear)

    IF lastSignal = 1 THEN

    DRAWTEXT(“β–² Bull”, -100, -61) ANCHOR(topRIGHT, XSHIFT, YSHIFT) COLOURED(25, 25, 25)

    ELSE

    DRAWTEXT(“β–Ό Bear”, -100, -61) ANCHOR(topRIGHT, XSHIFT, YSHIFT) COLOURED(25, 25, 25)

    ENDIF

     

    // Pourcentage de force (valeur dynamique via #…#)

    DRAWTEXT(“Strength : #strengthPct# %”, -100, -80) ANCHOR(topRIGHT, XSHIFT, YSHIFT) COLOURED(25, 25, 25)

    endif 


    // ─── Buy / Sell Signal Labels ────────────────────────────────────

    atrOff = atr * 0.25


    IF switchUp THEN

    DRAWTEXT(“Buy”, BarIndex, low – atrOff) COLOURED(bullR, bullG, bullB)

    ENDIF

    IF switchDown THEN

    DRAWTEXT(“Sell”, BarIndex, high + atrOff) COLOURED(bearR, bearG, bearB)

    ENDIF


    // ─── Retest Markers (β–² below bar = bull retest, β–Ό above = bear) ──

    IF bullOk THEN

    DRAWTEXT(“β–²”, BarIndex, low – atrOff * 0.5) COLOURED(bullR, bullG, bullB)

    ENDIF

    IF bearOk THEN

    DRAWTEXT(“β–Ό”, BarIndex, high + atrOff * 0.5) COLOURED(bearR, bearG, bearB)

    ENDIF


    // ─── Series Output ───────────────────────────────────────────────

    RETURN bC  COLOURED(r, g, b) AS “Basis Close”,bO  COLOURED(r, g, b) AS “Basis Open”,upper COLOURED(r, g, b) AS “Upper Band”,lower COLOURED(r, g, b) AS “Lower Band”



    IvΓ‘n GonzΓ‘lez thanked this post
    #259891 quote
    robeen12robeen12
    Participant
    Veteran
    #259893 quote
    robeen12robeen12
    Participant
    Veteran

    Ca sera mieux comme ca pour rΓ©cupΓ©rer le fichier itf

    Smart-Money-FlowCloud.itf
    #259916 quote
    ahenryahenry
    Participant
    Average

    Sincere thanks to Robeen for the amazing work. ^.^

    #265708 quote
    larouedegannlarouedegann
    Participant
    Master

    Here is another version; afterwards, the color areas and properties need to be worked on.ο»Ώ

    // β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
    // Smart Money Flow Cloud [BOSWaves] β€” Version Γ‰purΓ©e avec Fond Dynamique
    // β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
    
    
    // --- Paramètres / Inputs ---
    len = 34              // Longueur de la tendance principale
    basisType = 1         // 1 = EMA, 2 = ALMA
    basisSmooth = 3       // Lissage supplΓ©mentaire de la tendance
    
    
    mfLen = 24            // FenΓͺtre de calcul du flux (Flow)
    mfSmooth = 5          // Lissage du flux
    mfPower = 1.2         // Boost du flux
    
    
    atrLen = 14           // Longueur de l'ATR pour les bandes
    minMult = 0.9         // Multiplicateur min (Calme)
    maxMult = 2.2         // Multiplicateur max (Forte tendance)
    
    
    // β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
    // 1. Calcul du Smart Money Flow (MF) et Tendance
    // β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
    IF High = Low THEN
       clv = 0.0
    ELSE
       clv = ((Close - Low) - (High - Close)) / (High - Low)
    ENDIF
    
    
    rawMF = clv * Volume
    numMF = SUMMATION[mfLen](rawMF)
    denMF = SUMMATION[mfLen](ABS(rawMF))
    
    
    IF denMF = 0.0 THEN
       mf = 0.0
    ELSE
       mf = numMF / denMF
    ENDIF
    
    
    IF mfSmooth > 1 THEN
       mfSm = ExponentialAverage[mfSmooth](mf)
    ELSE
       mfSm = mf
    ENDIF
    
    
    strength = EXP(mfPower * LOG(ABS(mfSm)))
    IF strength > 1.0 THEN
       strength = 1.0
    ELSIF strength < 0.0 THEN
       strength = 0.0
    ENDIF
    
    
    mult = minMult + (maxMult - minMult) * strength
    
    
    // β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
    // 2. Calcul du Core Trend Engine (Baseline : Open et Close)
    // β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
    rawBasisO = ExponentialAverage[len](Open)
    rawBasisC = ExponentialAverage[len](Close)
    
    
    IF basisType = 2 THEN
       rawBasisO = WeightedAverage[len](Open)
       rawBasisC = WeightedAverage[len](Close)
    ENDIF
    
    
    IF basisSmooth > 1 THEN
       bO = ExponentialAverage[basisSmooth](rawBasisO)
       bC = ExponentialAverage[basisSmooth](rawBasisC)
    ELSE
       bO = rawBasisO
       bC = rawBasisC
    ENDIF
    
    
    bMain = bC
    
    
    // β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
    // 3. Calcul des Bandes Adaptatives et Γ‰tats
    // β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
    vATR = AverageTrueRange[atrLen](close)
    
    
    longCond = (Close CROSSES OVER (bMain + (vATR * mult)))
    shortCond = (Close CROSSES UNDER (bMain - (vATR * mult)))
    
    
    IF BarIndex = 0 THEN
       lastSignal = 0
       IF Close >= bMain THEN
          lastSignal = 1
       ELSE
          lastSignal = -1
       ENDIF
    ELSE
       IF longCond THEN
          lastSignal = 1
       ELSIF shortCond THEN
          lastSignal = -1
       ENDIF
    ENDIF
    
    
    // β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
    // 4. Logique de masquage des courbes, ciblage du prix et couleur de fond
    // β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
    IF lastSignal = 1 THEN
       // Tendance HAUSSIÈRE (Bleu) -> On affiche la LOWER band
       upperBandOut = bMain
       lowerBandOut = bMain - (vATR * mult)
       remplissageCible = Low
       
       // Application du fond bleu (trΓ¨s transparent, opacitΓ© = 25 sur 255)
       BACKGROUNDCOLOR(0, 200, 255, 25)
    ELSE
       // Tendance BAISSIÈRE (Rouge) -> On affiche la UPPER band
       upperBandOut = bMain + (vATR * mult)
       lowerBandOut = bMain
       remplissageCible = High
       
       // Application du fond rouge (trΓ¨s transparent, opacitΓ© = 25 sur 255)
       BACKGROUNDCOLOR(255, 0, 93, 25)
    ENDIF
    
    
    // β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
    // 5. Rendu Graphique (Lignes pures envoyΓ©es Γ  l'interface ProRealTime)
    // β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
    RETURN bMain AS "Basis Close", bO AS "Basis Open", remplissageCible AS "Cible Prix", upperBandOut AS "Upper Band", lowerBandOut AS "Lower Band"
    
    Capture-decran-2026-10-19-214059.png Capture-decran-2026-10-19-214059.png
Viewing 6 posts - 1 through 6 (of 6 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

Help to convert Smart Money Flow Cloud [BOSWaves] Please


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
ahenry @ahenry Participant
Summary

This topic contains 5 replies,
has 3 voices, and was last updated by larouedegannlarouedegann
2 weeks, 6 days ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 04/06/2026
Status: Active
Attachments: 3 files
ProRealCode ProRealCode
Loading...