Oscillatore Smart Money
Forums › ProRealTime forum Italiano › Supporto ProBuilder › Oscillatore Smart Money
- This topic has 1 reply, 2 voices, and was last updated 13 hours ago by
LucasBest.
Viewing 2 posts - 1 through 2 (of 2 total)
-
-
01/07/2026 at 10:34 AM #255047
Potrei avere la traduzione di questo indicatore? Mi sembra interessante.
https://it.tradingview.com/script/nRYrSLlN-Smart-Money-Flow-Oscillator-MarkitTick/
Grazie
01/08/2026 at 12:24 AM #255084Smart Money Flow Oscillator123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435//====================================================// Smart Money Flow Oscillator [MarkitTick] — ProBuilder (conversion TV -> PRT)// - Mode CDF (1) ou In/Out Ratio (0)// - Cloud via ColorBetween// - Divergences (pivots 5/10/20) + segments + labels (simplifié)//====================================================DEFPARAM DrawOnLastBarOnly = False//--------------------// Paramètres "utilisateur"//--------------------calcMode = 1 // 1 = CDF ; 0 = In/Out RatioautoPeriod = 1 // 1 = auto (Weekly=52, Daily=21) ; 0 = manuelmanualPeriod = 21impactAvgLen = 3impactCapMin = 0.2impactCapMax = 2.0thresholdFactor = 0.5showDivs = 1 // 1 = divergences + dessins ; 0 = off//--------------------// Constantes//--------------------epsilon = 0.000000001gradStdevLen = 50cloudAlpha = 85//--------------------// Période finale (auto)//--------------------finalPeriod = manualPeriodtfSec = GetTimeFrameIF autoPeriod THENIF tfSec >= 604800 THENfinalPeriod = 52ELSIF tfSec >= 86400 THENfinalPeriod = 21ELSEfinalPeriod = manualPeriodENDIFENDIFIF finalPeriod < 1 THENfinalPeriod = 1ENDIF//--------------------// Core calc//--------------------avgBody = Average[impactAvgLen](ABS(close - open))avgVol = Average[impactAvgLen](volume)tvBase = typicalPrice * volumecurrBody = ABS(close - open)rawEff = currBody / MAX(volume, 1)expEff = avgBody / MAX(avgVol, epsilon)relEff = rawEff / MAX(expEff, epsilon)effMult = MIN(impactCapMax, MAX(relEff, impactCapMin))closeChange = close - close[1]thresholdVal = ABS(open[1] - close[1]) * thresholdFactorisStrongUp = closeChange > thresholdValisStrongDown = closeChange < -thresholdValdeltaCurrent = 0IF isStrongUp THENdeltaCurrent = tvBase * effMultELSIF isStrongDown THENdeltaCurrent = -tvBase * effMultENDIFflowVal = deltaCurrentcumFlow = Summation[finalPeriod](flowVal)cumMA = Average[finalPeriod](cumFlow)inflow = MAX(flowVal, 0)outflow = MAX(-flowVal, 0)sumIn = Summation[finalPeriod](inflow)sumOut = Summation[finalPeriod](outflow)totFlow = sumIn + sumOutinOutRatio = 50IF totFlow > 0 THENinOutRatio = (sumIn / totFlow) * 100ENDIFinOutMA = Average[finalPeriod](inOutRatio)//--------------------// Série active (mode)//--------------------activeValue = cumFlowactiveMA = cumMAmidLine = 0IF calcMode = 0 THENactiveValue = inOutRatioactiveMA = inOutMAmidLine = 50ENDIFspread = activeValue - activeMA//--------------------// Couleur (approx gradient)//--------------------rangeVal = 5IF calcMode = 1 THENrangeVal = STD[gradStdevLen](spread) * 2ENDIFlabOff = max(rangeVal, 1) * 0.06intensity = MIN(1, ABS(spread) / MAX(rangeVal, epsilon))// couleurs "pales" -> "vives" (approx de TradingView)posR0 = 100posG0 = 220posB0 = 100posR1 = 0posG1 = 255posB1 = 0negR0 = 255negG0 = 120negB0 = 120negR1 = 255negG1 = 0negB1 = 0r = 160g = 160b = 160IF spread >= 0 THENr = posR0 + (posR1 - posR0) * intensityg = posG0 + (posG1 - posG0) * intensityb = posB0 + (posB1 - posB0) * intensityELSEr = negR0 + (negR1 - negR0) * intensityg = negG0 + (negG1 - negG0) * intensityb = negB0 + (negB1 - negB0) * intensityENDIFr = round(r)g = round(g)b = round(b)// Cloud entre activeValue et activeMAColorBetween(activeValue, activeMA, r, g, b, cloudAlpha)//--------------------// "Alerts" (plots 0/1)//--------------------crossZeroUp = (cumFlow CROSSES OVER 0)crossZeroDown = (cumFlow CROSSES UNDER 0)crossSigUp = (cumFlow CROSSES OVER cumMA)crossSigDown = (cumFlow CROSSES UNDER cumMA)//--------------------// Divergences (pivots 5/10/20) — sur la série active//--------------------divBull = 0divBear = 0hDivBull = 0hDivBear = 0// Etats pivots (6 états)ONCE ph5LastIdx = -1ONCE ph5LastPrice = 0ONCE ph5LastVal = 0ONCE ph10LastIdx = -1ONCE ph10LastPrice = 0ONCE ph10LastVal = 0ONCE ph20LastIdx = -1ONCE ph20LastPrice = 0ONCE ph20LastVal = 0ONCE pl5LastIdx = -1ONCE pl5LastPrice = 0ONCE pl5LastVal = 0ONCE pl10LastIdx = -1ONCE pl10LastPrice = 0ONCE pl10LastVal = 0ONCE pl20LastIdx = -1ONCE pl20LastPrice = 0ONCE pl20LastVal = 0IF showDivs THEN// ---------- Pivot High L=5 ----------L = 5win = 2*L+1hasPH = (barindex >= 2*L) AND (activeValue[L] >= Highest[win](activeValue))IF hasPH THENcurrIdx = barindex - LcurrPrice = high[L]currVal = activeValue[L]IF ph5LastIdx >= 0 THENregularBear = (currPrice > ph5LastPrice) AND (currVal < ph5LastVal)hiddenBear = (currPrice < ph5LastPrice) AND (currVal > ph5LastVal)IF regularBear THENdivBear = 1ENDIFIF hiddenBear THENhDivBear = 1ENDIFIF regularBear OR hiddenBear THENIF regularBear THENDrawSegment(ph5LastIdx, ph5LastVal, currIdx, currVal) COLOURED(255,0,0,220) STYLE(LINE,2)DrawText("R", currIdx, currVal + labOff, SansSerif, Bold, 20) COLOURED(255,0,0,220)ELSEDrawSegment(ph5LastIdx, ph5LastVal, currIdx, currVal) COLOURED(128,0,0,220) STYLE(DOTTEDLINE,2)DrawText("H", currIdx, currVal + labOff, SansSerif, Bold, 20) COLOURED(128,0,0,220)ENDIFENDIFENDIFph5LastIdx = currIdxph5LastPrice = currPriceph5LastVal = currValENDIF// ---------- Pivot High L=10 ----------L = 10win = 2*L+1hasPH = (barindex >= 2*L) AND (activeValue[L] >= Highest[win](activeValue))IF hasPH THENcurrIdx = barindex - LcurrPrice = high[L]currVal = activeValue[L]IF ph10LastIdx >= 0 THENregularBear = (currPrice > ph10LastPrice) AND (currVal < ph10LastVal)hiddenBear = (currPrice < ph10LastPrice) AND (currVal > ph10LastVal)IF regularBear THENdivBear = 1ENDIFIF hiddenBear THENhDivBear = 1ENDIFIF regularBear OR hiddenBear THENIF regularBear THENDrawSegment(ph10LastIdx, ph10LastVal, currIdx, currVal) COLOURED(255,0,0,220) STYLE(LINE,2)DrawText("R", currIdx, currVal + labOff, SansSerif, Bold, 20) COLOURED(255,0,0,220)ELSEDrawSegment(ph10LastIdx, ph10LastVal, currIdx, currVal) COLOURED(128,0,0,220) STYLE(DOTTEDLINE,2)DrawText("H", currIdx, currVal + labOff, SansSerif, Bold, 20) COLOURED(128,0,0,220)ENDIFENDIFENDIFph10LastIdx = currIdxph10LastPrice = currPriceph10LastVal = currValENDIF// ---------- Pivot High L=20 ----------L = 20win = 2*L+1hasPH = (barindex >= 2*L) AND (activeValue[L] >= Highest[win](activeValue))IF hasPH THENcurrIdx = barindex - LcurrPrice = high[L]currVal = activeValue[L]IF ph20LastIdx >= 0 THENregularBear = (currPrice > ph20LastPrice) AND (currVal < ph20LastVal)hiddenBear = (currPrice < ph20LastPrice) AND (currVal > ph20LastVal)IF regularBear THENdivBear = 1ENDIFIF hiddenBear THENhDivBear = 1ENDIFIF regularBear OR hiddenBear THENIF regularBear THENDrawSegment(ph20LastIdx, ph20LastVal, currIdx, currVal) COLOURED(255,0,0,220) STYLE(LINE,2)DrawText("R", currIdx, currVal + labOff, SansSerif, Bold, 20) COLOURED(255,0,0,220)ELSEDrawSegment(ph20LastIdx, ph20LastVal, currIdx, currVal) COLOURED(128,0,0,220) STYLE(DOTTEDLINE,2)DrawText("H", currIdx, currVal + labOff, SansSerif, Bold, 20) COLOURED(128,0,0,220)ENDIFENDIFENDIFph20LastIdx = currIdxph20LastPrice = currPriceph20LastVal = currValENDIF// ---------- Pivot Low L=5 ----------L = 5win = 2*L+1hasPL = (barindex >= 2*L) AND (activeValue[L] <= Lowest[win](activeValue))IF hasPL THENcurrIdx = barindex - LcurrPrice = low[L]currVal = activeValue[L]IF pl5LastIdx >= 0 THENregularBull = (currPrice < pl5LastPrice) AND (currVal > pl5LastVal)hiddenBull = (currPrice > pl5LastPrice) AND (currVal < pl5LastVal)IF regularBull THENdivBull = 1ENDIFIF hiddenBull THENhDivBull = 1ENDIFIF regularBull OR hiddenBull THENIF regularBull THENDrawSegment(pl5LastIdx, pl5LastVal, currIdx, currVal) COLOURED(0,255,0,220) STYLE(LINE,2)DrawText("R", currIdx, currVal - labOff, SansSerif, Bold, 20) COLOURED(0,255,0,220)ELSEDrawSegment(pl5LastIdx, pl5LastVal, currIdx, currVal) COLOURED(0,200,120,220) STYLE(DOTTEDLINE,2)DrawText("H", currIdx, currVal - labOff, SansSerif, Bold, 20) COLOURED(0,200,120,220)ENDIFENDIFENDIFpl5LastIdx = currIdxpl5LastPrice = currPricepl5LastVal = currValENDIF// ---------- Pivot Low L=10 ----------L = 10win = 2*L+1hasPL = (barindex >= 2*L) AND (activeValue[L] <= Lowest[win](activeValue))IF hasPL THENcurrIdx = barindex - LcurrPrice = low[L]currVal = activeValue[L]IF pl10LastIdx >= 0 THENregularBull = (currPrice < pl10LastPrice) AND (currVal > pl10LastVal)hiddenBull = (currPrice > pl10LastPrice) AND (currVal < pl10LastVal)IF regularBull THENdivBull = 1ENDIFIF hiddenBull THENhDivBull = 1ENDIFIF regularBull OR hiddenBull THENIF regularBull THENDrawSegment(pl10LastIdx, pl10LastVal, currIdx, currVal) COLOURED(0,255,0,220) STYLE(LINE,2)DrawText("R", currIdx, currVal - labOff, SansSerif, Bold, 20) COLOURED(0,255,0,220)ELSEDrawSegment(pl10LastIdx, pl10LastVal, currIdx, currVal) COLOURED(0,200,120,220) STYLE(DOTTEDLINE,2)DrawText("H", currIdx, currVal - labOff, SansSerif, Bold, 20) COLOURED(0,200,120,220)ENDIFENDIFENDIFpl10LastIdx = currIdxpl10LastPrice = currPricepl10LastVal = currValENDIF// ---------- Pivot Low L=20 ----------L = 20win = 2*L+1hasPL = (barindex >= 2*L) AND (activeValue[L] <= Lowest[win](activeValue))IF hasPL THENcurrIdx = barindex - LcurrPrice = low[L]currVal = activeValue[L]IF pl20LastIdx >= 0 THENregularBull = (currPrice < pl20LastPrice) AND (currVal > pl20LastVal)hiddenBull = (currPrice > pl20LastPrice) AND (currVal < pl20LastVal)IF regularBull THENdivBull = 1ENDIFIF hiddenBull THENhDivBull = 1ENDIFIF regularBull OR hiddenBull THENIF regularBull THENDrawSegment(pl20LastIdx, pl20LastVal, currIdx, currVal) COLOURED(0,255,0,220) STYLE(LINE,2)DrawText("R", currIdx, currVal - labOff, SansSerif, Bold, 20) COLOURED(0,255,0,220)ELSEDrawSegment(pl20LastIdx, pl20LastVal, currIdx, currVal) COLOURED(0,200,120,220) STYLE(DOTTEDLINE,2)DrawText("H", currIdx, currVal - labOff, SansSerif, Bold, 20) COLOURED(0,200,120,220)ENDIFENDIFENDIFpl20LastIdx = currIdxpl20LastPrice = currPricepl20LastVal = currValENDIFENDIF//--------------------// Niveaux OB/OS uniquement utiles en mode Ratio (sinon invisibles via alpha=0)//--------------------obLevel = 70osLevel = 30obAlpha = 0osAlpha = 0IF calcMode = 0 THENobAlpha = 200osAlpha = 200ENDIFRETURN activeValue COLOURED(r,g,b,255) STYLE(LINE,2) AS "Flow/Ratio",activeMA COLOURED(160,160,160,120) STYLE(LINE,1) AS "Signal",midLine COLOURED(120,120,120,160) STYLE(DOTTEDLINE,1) AS "Zero/Mid",obLevel COLOURED(255,0,0,obAlpha) STYLE(DOTTEDLINE,1) AS "OB",osLevel COLOURED(0,255,0,osAlpha) STYLE(DOTTEDLINE,1) AS "OS", effMult AS "Eff x",crossZeroUp AS "ZeroUp",crossZeroDown AS "ZeroDn",crossSigUp AS "SigUp",crossSigDown AS "SigDn",divBull AS "DivBull",divBear AS "DivBear",hDivBull AS "HDivBull",hDivBear AS "HDivBear"2 users thanked author for this post.
-
AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)
