convertire l’indicateur trader xo de tradingview
Forums › ProRealTime forum Français › Support ProBuilder › convertire l’indicateur trader xo de tradingview
- This topic has 1 reply, 2 voices, and was last updated 5 days ago by
Iván.
Viewing 2 posts - 1 through 2 (of 2 total)
-
-
04/09/2025 at 7:20 PM #245768
Bonjour,
pouvez vous traduire cette indicateur ci dessous svp :
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091// Paramètresindicator(“[@btc_charlie] Trader XO Macro Trend Scanner”, shorttitle=”XO Trend”, overlay=true)// Variablessrc = close // Source (type de prix)i_fastEMA = 12 // Fast EMAi_slowEMA = 25 // Slow EMAi_defEMA = 25 // Consolidated EMA// Calcul des EMAsv_fastEMA = ExponentialAverage(src, i_fastEMA)v_slowEMA = ExponentialAverage(src, i_slowEMA)v_biasEMA = ExponentialAverage(src, i_defEMA)// Définir la couleur des EMAsemaColor = (v_fastEMA > v_slowEMA) ? Green : (v_fastEMA < v_slowEMA) ? Red : Orange // Affichage des EMAs if (i_fastEMA > 0) thenPlot(v_fastEMA, “Fast EMA”, emaColor)if (i_slowEMA > 0) thenPlot(v_slowEMA, “Slow EMA”, emaColor)if (i_defEMA > 0) thenPlot(v_biasEMA, “Consolidated EMA”, emaColor)// Condition d’achat et de ventebuyCondition = (v_fastEMA > v_slowEMA)sellCondition = (v_fastEMA < v_slowEMA)// Logique pour comptabiliser les signauxcountBuy = 0countSell = 0if (buyCondition) thencountBuy = countBuy + 1countSell = 0 endifif (sellCondition) thencountSell = countSell + 1countBuy = 0endif// Signaux d'achat et de ventebuySignal = (countBuy < 2) AND (countBuy > 0) AND (countSell < 1) AND buyCondition AND NOT buyCondition[1]sellSignal = (countSell > 0) AND (countSell < 2) AND (countBuy < 1) AND sellCondition AND NOT sellCondition[1]// Colorier les barresif (buySignal) thenSetBarColor(Green)endifif (sellSignal) thenSetBarColor(Red)endif// Affichage des formes pour les signaux Bull/Bearif (buySignal) thenPlotArrowUp("Bull", color=Green)endifif (sellSignal) thenPlotArrowDown("Bear", color=Red)endif// AlertesAlertWhen(crossover(v_fastEMA, v_slowEMA), "Bullish EMA Cross", "Bullish EMA crossover")AlertWhen(crossunder(v_fastEMA, v_slowEMA), "Bearish EMA Cross", "Bearish EMA crossover")// Stochastic RSIsmoothK = 3smoothD = 3lengthRSI = 14lengthStoch = 14rsi1 = RSI(src, lengthRSI)k = SimpleAverage(Stochastic(rsi1, rsi1, rsi1, lengthStoch), smoothK)d = SimpleAverage(k, smoothD)// Bandes du Stoch RSIbandno0 = 80bandno1 = 20bandno2 = 50// Alertes Stoch RSIcrossupAlert = (crossover(k, d)) AND (k < bandno2 OR d < bandno2)crossdownAlert = (crossunder(k, d)) AND (k > bandno2 OR d > bandno2)crossupOSAlert = (crossover(k, d)) AND (k < bandno1 OR d < bandno1)crossdownOBAlert = (crossunder(k, d)) AND (k > bandno0 OR d > bandno0)// Couleur de fond pour les alertesif (crossupAlert) thenSetBackgroundColor(Green)endifif (crossdownAlert) thenSetBackgroundColor(Red)endifif (crossupOSAlert) thenSetBackgroundColor(Orange)endifif (crossdownOBAlert) thenSetBackgroundColor(Black)endif// Alertes de croisementAlertWhen(crossupAlert OR crossdownAlert, “Stoch RSI Crossover”, “Stoch RSI crossover”)04/10/2025 at 8:56 AM #2457741234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192//------------------------------------------------////PRC_Macro trend scanner//version = 0//10.04.2025//Iván González @ www.prorealcode.com//Sharing ProRealTime knowledge//------------------------------------------------//// Inputs//------------------------------------------------//src=closeifastema=12islowema=25idefema=50smoothK = 3smoothD = 3lengthRSI = 14lengthStoch = 14OS=20OB=80MD=50//------------------------------------------------//// Calculations//------------------------------------------------//// Moving averagesvfastema=average[ifastema,1](src)vslowema=average[islowema,1](src)vbiasema=average[idefema,1](src)// Stochastic Rsirsi1=rsi[lengthRSI](src)maxrsi=highest[lengthStoch](rsi1)minrsi=lowest[lengthStoch](rsi1)osc=(rsi1-minrsi)/(maxrsi-minrsi)*100k=average[smoothK](osc)d=average[smoothD](k)//------------------------------------------------//// Color//------------------------------------------------//if vfastema>vslowema thenr=0g=255b=0elsif vfastema<vslowema thenr=255g=0b=0elser=124g=124b=124endif//------------------------------------------------//// Signals//------------------------------------------------//buySignal = vfastema crosses over vslowemasellSignal = vfastema crosses under vslowemadrawcandle(open,high,low,close)coloured(r,g,b)if buySignal thendrawarrowup(barindex,low)coloured("green")elsif sellsignal thendrawarrowdown(barindex,high)coloured("red")endif//------------------------------------------------//// Stochastic RSI Alerts//------------------------------------------------//crossupAlert = (k crosses over d) AND (k < MD OR d < MD)crossdownAlert = (k crosses under d) AND (k > MD OR d > MD)crossupOSalert=k crosses over d and (k<OS or d<OS)crossdownOBalert=k crosses under d and (k>OB or d>OB)//------------------------------------------------//// Background//------------------------------------------------//if crossupAlert thenBackgroundColor("Green",30)endifif (crossdownAlert) thenBackgroundColor("Red",30)endifif (crossupOSAlert) thenBackgroundColor("Orange",30)endifif (crossdownOBAlert) thenBackgroundColor("Black",30)endif//------------------------------------------------//return vfastema as "Fast EMA" coloured(r,g,b),vslowema as "Slow EMA"coloured(r,g,b),vbiasema as "Consolidates EMA"coloured(r,g,b)1 user thanked author for this post.
-
AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)
Find exclusive trading pro-tools on
Similar topics: