CONVERSION INDICADOR TRADINGVIEW
Forums › ProRealTime foro Español › Soporte ProBuilder › CONVERSION INDICADOR TRADINGVIEW
- This topic has 2 replies, 2 voices, and was last updated 7 months ago by Fr7.
-
-
05/08/2024 at 6:42 PM #232503
Solicite, si es posible, convertir el indicador adjunto.
Indicador de regresión logística múltiple
El indicador de Aprendizaje automático: regresión logística múltiple para TradingView es una herramienta versátil que emplea regresión logística múltiple basada en varios indicadores técnicos para generar señales potenciales de compra y venta. Al utilizar indicadores clave como RSI, CCI, DMI, Aroon, EMA y SuperTrend, el indicador pretende proporcionar un enfoque sistemático para la toma de decisiones en los mercados financieros.https://es.tradingview.com/script/YHuROcQY-Machine-Learning-Multiple-Logistic-Regression/
A ver si Iván el moderador lo puede traducir.
Muchas gracias.05/14/2024 at 1:13 PM #232629Buenas!
Aquí tienes el indicador:PRC_Multiple Logistic Regression123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190DEFPARAM DRAWONLASTBARONLY =TRUE//--------------------------------------------------------------////PRC_Multiple Logistic Regression//version = 0//14.05.24//Iván González @ www.prorealcode.com//Sharing ProRealTime knowledge//-------------------------------------------------------------////-----Inputs--------------------------------------------------//length=50 //Z score lengthrsilength=35 //rsiccilength=45 //cc1dmilength=35 //dmiarlength=35 //aroonemalength=30 //exponential averagefactor=3.2 //factor for supertrendatrperiod=2 //atr periodb0=1b1=1//rsib2=4//ccib3=1//dmib4=2//aroonb5=5//emab6=4//supertrendlr=0.08//step of learning//-------------------------------------------------------------////-----INDICATORS----------------------------------------------////-----RSIrsivalue=rsi[rsilength](close)//-----CCIccivalue=cci[ccilength]((high+low+close)/3)//-----DMI and DPIplus=DIplus[dmilength](close)minus=DIminus[dmilength](close)//-----AROONupper=AroonUp[arlength]lower=AroonDown[arlength]//-----EMAsema1=average[emalength,1](close)ema2=average[emalength-10,1](close)//-----SUPERTRENDatr = averagetruerange[atrperiod](close)src=(high+low)/2up = src - factor*atrup1 = up[1]if close[1] > up1 thenup = max(up,up1)elseup = upendifdn = src + factor*atrdn1 = dn[1]if close[1] < dn1 thendn = min(dn,dn1)elsedn = dnendifonce direction = 1if direction = -1 and close > dn1 thendirection = 1elsif direction = 1 and close < up1 thendirection = -1elsedirection = directionendifif direction = 1 thenst = upelsest = dnendif//-------------------------------------------------------------////-----Normalized indicators-----------------------------------////-----Normalized closebasis=average[length](close)zscore=(close-basis)/std[length](close)if zscore > 0 theny=1elsey=-1endif//-----Normalized RSIif rsivalue > 50 thenx1=1elsex1=-1endif//-----Normalized CCIif ccivalue crosses over 100 thenx2=1elsif ccivalue crosses under -100 thenx2=-1endif//-----Normalized DMIif plus > minus thenx3=1elsex3=-1endif//-----Normalized Aroonif upper > lower thenx4=1elsex4=-1endif//-----Normalized emaif ema1 > ema2 thenx5=-1elsex5=1endif//-----Normalized Supertrendx6=direction*(1)//-------------------------------------------------------------////-----MULTIPLE LOGISTIC REGRESSION----------------------------////-----Pre Multiple Logic Regressionp=1/(1+exp(-(b0+b1*x1+b2*x2+b3*x3+b4*x4+b5*x5+b6*x6)))//-----Lossmyloss=(-y)*log(p)-(1-y)*log(1-p)//-----Adjusting model weights using gradient descentb11=b1-lr*(p+myloss)*x1b22=b2-lr*(p+myloss)*x2b33=b3-lr*(p+myloss)*x3b44=b4-lr*(p+myloss)*x4b55=b5-lr*(p+myloss)*x5b66=b6-lr*(p+myloss)*x6//-----Multiple Logic Regression With adjusted weights based on loss functionlreg=1/(1+exp(-(b0+b11*x1+b22*x2+b33*x3+b44*x4+b55*x5+b66*x6)))//-------------------------------------------------------------////-----PLOT----------------------------------------------------////-----Colorif lreg>=0.5 thenr=0g=255elser=255g=0endif//-----SMAsma=average[10](close)//-------------------------------------------------------------////-----SIGNALS-------------------------------------------------//if lreg crosses over 0.5 then$crossupx[z+1]=barindex$crossup[z+1]=lowz=z+1elsif lreg crosses under 0.5 then$crossdnx[t+1]=barindex$crossdn[t+1]=hight=t+1endiffor i=0 to z dodrawtext("▲",$crossupx[i],$crossup[i])coloured("green")nextfor j=0 to t dodrawtext("▼",$crossdnx[j],$crossdn[j])coloured("red")next//-------------------------------------------------------------////-----TABLE---------------------------------------------------////-----Variabledrawtext("Variable",-150,-60)anchor(topRIGHT ,XSHIFT ,YSHIFT )drawtext("RSI",-150,-80)anchor(topRIGHT ,XSHIFT ,YSHIFT )drawtext("CCI",-150,-100)anchor(topRIGHT ,XSHIFT ,YSHIFT )drawtext("DMI",-150,-120)anchor(topRIGHT ,XSHIFT ,YSHIFT )drawtext("AROON",-150,-140)anchor(topRIGHT ,XSHIFT ,YSHIFT )drawtext("EMA",-150,-160)anchor(topRIGHT ,XSHIFT ,YSHIFT )drawtext("SuperT",-150,-180)anchor(topRIGHT ,XSHIFT ,YSHIFT )//-----Valdrawtext("Val",-100,-60)anchor(topRIGHT ,XSHIFT ,YSHIFT )drawtext("#x1#",-100,-80)anchor(topRIGHT ,XSHIFT ,YSHIFT )drawtext("#x2#",-100,-100)anchor(topRIGHT ,XSHIFT ,YSHIFT )drawtext("#x3#",-100,-120)anchor(topRIGHT ,XSHIFT ,YSHIFT )drawtext("#x4#",-100,-140)anchor(topRIGHT ,XSHIFT ,YSHIFT )drawtext("#x5#",-100,-160)anchor(topRIGHT ,XSHIFT ,YSHIFT )drawtext("#x6#",-100,-180)anchor(topRIGHT ,XSHIFT ,YSHIFT )//-----Betadrawtext("Beta",-50,-60)anchor(topRIGHT ,XSHIFT ,YSHIFT )drawtext("#b11#",-50,-80)anchor(topRIGHT ,XSHIFT ,YSHIFT )drawtext("#b22#",-50,-100)anchor(topRIGHT ,XSHIFT ,YSHIFT )drawtext("#b33#",-50,-120)anchor(topRIGHT ,XSHIFT ,YSHIFT )drawtext("#b44#",-50,-140)anchor(topRIGHT ,XSHIFT ,YSHIFT )drawtext("#b55#",-50,-160)anchor(topRIGHT ,XSHIFT ,YSHIFT )drawtext("#b66#",-50,-180)anchor(topRIGHT ,XSHIFT ,YSHIFT )//-----Rectangledrawrectangle(-200,-200,-10,-40)anchor(topRIGHT ,XSHIFT ,YSHIFT )fillcolor("blue",50)//-------------------------------------------------------------//return sma as "SMA"coloured(r,g,0)style(line,3)1 user thanked author for this post.
05/15/2024 at 6:34 PM #232705Muchas gracias Iván!!,eres un crack!!Sólo tengo palabras de agradecimiento por tu trabajo y esfuerzo en este foro. Espero que sea útil para todo el mundo y estoy investigando sobre indicadores basados en I.A., quizás más adelante te mande otros códigos. Un saludo.
-
AuthorPosts
Find exclusive trading pro-tools on