CONVERSION INDICADOR TRADINGVIEW:”Oscilador de estructura de mercado “
Forums › ProRealTime foro Español › Soporte ProBuilder › CONVERSION INDICADOR TRADINGVIEW:”Oscilador de estructura de mercado “
- This topic has 1 reply, 2 voices, and was last updated 1 month ago by Iván.
-
-
10/05/2024 at 8:47 PM #238529
Solicito, si es posible, convertir el indicador adjunto:
El indicador Market Structure Oscillator analiza y sintetiza los cambios y rupturas de la estructura del mercado a corto, mediano y largo plazo, visualizando el resultado como osciladores y representaciones gráficas de las estructuras del mercado en tiempo real en el gráfico de precios principal.
La presentación del oscilador de las estructuras del mercado detectadas ayuda a los operadores a visualizar el impulso y la fuerza de la tendencia, identificando posibles reversiones de la tendencia y brindando diferentes perspectivas para mejorar el análisis de las estructuras clásicas del mercado.
https://www.tradingview.com/script/K47z5Kmf-Market-Structure-Oscillator-LuxAlgo/
A ver si Iván el moderador tiene un hueco libre y lo puede traducir.
Muchas gracias.10/17/2024 at 11:00 AM #239135Buenas! Aquí lo tienes:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273//--------------------------------------------------------////PRC_Market Structure Oscillator//version = 0//17.10.2024//Iván González @ www.prorealcode.com//Sharing ProRealTime knowledge//--------------------------------------------------------////--------------------Inputs------------------------------////--------------------------------------------------------//msOscShow=1cycleOpt=1msDataK1=0 //short term oscillatormsDataK2=0 //intermediate term oscillatormsDataK3=0 //long term oscillatorNormSmooth=4cycSmooth=7msWeightk1=1msWeightk2=3msWeightk3=2//--------------------------------------------------------////----------Calculations - Oscillator---------------------////--------------------------------------------------------//if msOscShow or msDataK1 or msDataK2 or msDataK3 thenoscTop=100upperband=85midline=50lowerband=15oscBtm=0elseoscTop=undefinedendif//StValue1 = ShortMarketStructurebull=0bear=0if high[2]<high[1] and high[1]>=high thenstHighprevPrice=stHighMidPricestHighMidPrice=stHighLastPricestHighLastPrice=high[1]stHighprevIndex=stHighMidIndexstHighMidIndex=stHighLastIndexstHighLastIndex=barindex[1]stHighIsCrossed=0endifif close>stHighLastPrice and stHighIsCrossed=0 thenstHighIsCrossed=1bull=1endifif low[2]>low[1] and low[1]<=low thenstLowprevPrice=stLowMidPricestLowMidPrice=stLowLastPricestLowLastPrice=low[1]stLowprevIndex=stLowMidIndexstLowMidIndex=stLowLastIndexstLowLastIndex=barindex[1]stLowIsCrossed=0endifif close<stLowLastPrice and stLowIsCrossed=0 thenstLowIsCrossed=1bear=1endifonce os=0once mimax=closeonce mimin=closeif bull thenos=1elsif bear thenos=-1endifif os>os[1] thenmimax=closemimin=miminelsif os<os[1] thenmimax=mimaxmimin=closeelsemimax=max(close,mimax)mimin=min(close,mimin)endifStValue1=100*average[NormSmooth]((close-mimin)/(mimax-mimin))//StValue2 = MarketStructure (itHigh,itLow,stHigh,stLow)bull2=0bear2=0cSwingHigh=stHighprevPrice<stHighMidPrice and stHighMidPrice>=stHighLastPriceif cSwingHigh and cSwingHigh<>cSwingHigh[1] thenitHighprevPrice=itHighMidPriceitHighMidPrice=itHighLastPriceitHighLastPrice=stHighMidPriceitHighprevIndex=itHighMidIndexitHighMidIndex=itHighLastIndexitHighLastIndex=stHighMidIndexitHighIsCrossed=0endifif close>itHighLastPrice and itHighIsCrossed=0 thenitHighIsCrossed=1bull2=1endifcSwingLow=stLowprevPrice>stLowMidPrice and stLowMidPrice<=stLowLastPriceif cSwingLow and cSwingLow<>cSwingLow[1] thenitLowprevPrice=itLowMidPriceitLowMidPrice=itLowLastPriceitLowLastPrice=stLowMidPriceitLowprevIndex=itLowMidIndexitLowMidIndex=itLowLastIndexitLowLastIndex=stLowMidIndexitLowIsCrossed=0endifif close<itLowLastPrice and itLowIsCrossed=0 thenitLowIsCrossed=1bear2=1endifonce os2=0once mimax2=closeonce mimin2=closeif bull2 thenos2=1elsif bear2 thenos2=-1endifif os2>os2[1] thenmimax2=closemimin2=mimin2elsif os2<os2[1] thenmimax2=mimax2mimin2=closeelsemimax2=max(close,mimax2)mimin2=min(close,mimin2)endifStValue2=100*average[NormSmooth]((close-mimin2)/(mimax2-mimin2))//StValue3 = MarketStructure (ltHigh,ltLow,itHigh,itLow)bull3=0bear3=0cSwingHigh3=itHighprevPrice<itHighMidPrice and itHighMidPrice>=itHighLastPriceif cSwingHigh3 and cSwingHigh3<>cSwingHigh3[1] thenltHighprevPrice=ltHighMidPriceltHighMidPrice=ltHighLastPriceltHighLastPrice=itHighMidPriceltHighprevIndex=ltHighMidIndexltHighMidIndex=ltHighLastIndexltHighLastIndex=itHighMidIndexltHighIsCrossed=0endifif close>ltHighLastPrice and ltHighIsCrossed=0 thenltHighIsCrossed=1bull3=1endifcSwingLow3=itLowprevPrice>itLowMidPrice and itLowMidPrice<=itLowLastPriceif cSwingLow3 and cSwingLow3<>cSwingLow3[1] thenltLowprevPrice=ltLowMidPriceltLowMidPrice=ltLowLastPriceltLowLastPrice=itLowMidPriceltLowprevIndex=ltLowMidIndexltLowMidIndex=ltLowLastIndexltLowLastIndex=itLowMidIndexltLowIsCrossed=0endifif close<ltLowLastPrice and ltLowIsCrossed=0 thenltLowIsCrossed=1bear3=1endifonce os3=0once mimax3=closeonce mimin3=closeif bull3 thenos3=1elsif bear3 thenos3=-1endifif os3>os3[1] thenmimax3=closemimin3=mimin3elsif os3<os3[1] thenmimax3=mimax3mimin3=closeelsemimax3=max(close,mimax3)mimin3=min(close,mimin3)endifStValue3=100*average[NormSmooth]((close-mimin3)/(mimax3-mimin3))//--------------------------------------------------------////-----Oscillator line------------------------------------////--------------------------------------------------------//msOsc=(msWeightk1*StValue1+msWeightk2*StValue2+msWeightk3*StValue3)/(msWeightk1+msWeightk2+msWeightk3)//--------------------------------------------------------////-----Oscillator Histogram-------------------------------////--------------------------------------------------------//if cycleOpt thencyclefast=msOsc-average[cycSmooth,1](msOsc)+50elsecyclefast=50endifif cyclefast>50 thendrawcandle(50,50,50,cyclefast)coloured(49,121,245)elsif cyclefast<50 thendrawcandle(50,50,50,cyclefast)coloured(255,167,38)endif//--------------------------------------------------------////-----Short-Intermediate-Long Term Oscillator------------////--------------------------------------------------------//if msDataK1 thenosc1=StValue1elseosc1=undefinedendifif msDataK2 thenosc2=StValue2elseosc2=undefinedendifif msDataK3 thenosc3=StValue3elseosc3=undefinedendif//--------------------------------------------------------//colorbetween(oscTop,upperband,255,167,38,100)colorbetween(oscBtm,lowerband,49,121,245,100)//--------------------------------------------------------//return oscTop as "Osc Top" coloured("grey",0),oscBtm as "Osc Bot" coloured("grey",0), upperband as "Overbought Level" coloured("grey",0), lowerband as "Oversold Level" coloured("grey",0), midline as "Equilibrium Level" coloured("black",100)style(dottedline), msOsc coloured("BLUE")style(line,2),osc1 as "Short Term" coloured("grey"),osc2 as "Intermediate Term" coloured("grey"),osc3 as "Long Term" coloured("grey") -
AuthorPosts
Find exclusive trading pro-tools on