Indicator Matrix Series From Pinescript to Pro real time
Forums › ProRealTime English forum › ProBuilder support › Indicator Matrix Series From Pinescript to Pro real time
- This topic has 3 replies, 3 voices, and was last updated 1 year ago by robertogozzi.
-
-
04/13/2023 at 10:38 PM #213255
Hi i tried to translate an indicator from Pinescript to ProBuilder, I think i mixed up something :p anyone wants to help?
Here the original code in pinescript
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455study("Matrix Series",shorttitle="MS",precision=1)Smoother=input(5)nn = Smoother//--Sup/Res DetailSupResPeriod = input(50)SupResPercentage =input(100)PricePeriod = input(16)ob = input(200,title="Overbought")os = input(-200,title="Oversold")OBOS= input(type=bool,defval=false,title="Show OB/OS")dynamic=input(true,title="Dynamic zones")ys1 = ( high + low + close * 2 ) / 4rk3 = ema( ys1, nn )rk4 = stdev(ys1, nn)rk5 = (ys1 - rk3 ) * 200 / rk4rk6 = ema( rk5, nn )up = ema(rk6, nn )down = ema( up, nn )Oo = iff( up < down, up, down )Hh = OoLl = iff( up < down, down, up )Cc = Llvcolor= Oo > Cc ? red : up > down? green:redplotcandle(Oo,Hh,Ll,Cc,color=vcolor)//-------S/R Zones------Lookback = SupResPeriodPerCent = SupResPercentagePds = PricePeriodC3 = cci(close,Pds )Osc = C3Value1 = OscValue2 = highest( Value1, Lookback )Value3 = lowest( Value1, Lookback )Value4 = Value2 - Value3Value5 = Value4 * ( PerCent / 100 )ResistanceLine = Value3 + Value5SupportLine = Value2 - Value5plot(dynamic?ResistanceLine:na,color=green,transp=0)plot(dynamic?SupportLine:na,color=red,transp=0)//--Overbought/Oversold/Warning DetailUPshape = up > ob and up>down ? highest(up,1) + 20:up > ob and up<down?highest(down,1) + 20:naDOWNshape = down < os and up>down ? lowest(down,1) - 20:down < os and up<down?lowest(up,1) - 20 :naplot(UPshape,style=cross,color=aqua,linewidth=2,transp=0)plot(DOWNshape,style=cross,color=aqua,linewidth=2,transp=0)x1=OBOS?ob:falsex2=OBOS?os:falsehline(x1)hline(x2)//http://www.wisestocktrader.com/indicators/2739-flower-indicatorand here my translation :p
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102// Conversion from Pine ScriptSmoother = 5nn = easier// Details Sup/ResSupResPeriod = 50SupResPercentage = 100PricePeriod = 16ob = 200os = -200OBOS = 0dynamic = 1ys1 = (high + low + close * 2) / 4rk3 = ExponentialAverage[nn](ys1)rk4 = std[nn](ys1)rk5 = (ys1 - rk3) * 200 / rk4rk6 = ExponentialAverage[nn](rk5)su = ExponentialAverage[nn](rk6)down = ExponentialAverage[nn](on)If up < down thenOo = onLl = downelsif up > down thenOo = belowLl = onendifHh = OoCc = Ll// Support and resistance zonesLookback = SupResPeriodPercentage = SupResPercentagePds = PricePeriodC3 = CCI[PricePeriod](close)Osc = C3Value1 = OscValue2 = highest[Lookback](Value1)Value3 = Lowest[Lookback](Value1)Value4 = Value2 - Value3Value5 = Value4 * (percentage / 100)ResistanceLine = value 3 + value 5SupportLine = Value2 - Value5If up > ob E up > down thenUPshape = Maximum[1](up) + 20elsif up > ob and up < down thenUPshape = highest[1](down) + 20otherUPforma = -1endifIf down < os And up > down thenDOWNforma = lowest[1](down) - 20elsif down < os And up < down thenDOWNforma = lowest[1](up) - 20otherDOWNform = -1endifIf OBOS thenx1 = obotherx1 = -1endifIf OBOS thenx2 = osotherx2 = -1endif// Draw support and resistance lines if 'dynamic' is trueIF dynamic THENDRAWLINE(barindex, ResistanceLine, barindex, ResistanceLine) COLOURED(0, 255, 0)DRAWLINE(barindex, SupportLine, barindex, SupportLine) COLOURED(255, 0, 0)ENDIF// Draw ob/os lines if 'OBOS' is trueIF OBOS THENDRAWLINE(barindex, x1, barindex, x1) COLOURED(0, 0, 0, 50)DRAWLINE(barindex, x2, barindex, x2) COLOURED(0, 0, 0, 50)ENDIF// Draw an "X" above the overbought zone if 'UPshape' is different from -1IF UPshape <> -1 THENDRAWTEXT("X", barindex[1], UPshape) COLOURED(0, 255, 255, 0) // Add barindex[1] to correctly position the "X"ENDIF// Draw an "X" under the oversold if 'DOWNshape' is different from -1IF DOWNshape <> -1 THENDRAWTEXT("X", barindex[1], DOWNshape) COLOURED(0, 255, 255, 0) // Add barindex[1] to correctly position the "X"ENDIF// Use this row to return candles and colorRETURN Oo AS "Oo", Hh AS "Hh", Ll AS "Ll", Cc AS "Cc"04/13/2023 at 10:40 PM #21325604/14/2023 at 9:26 AM #213275Matrix Series indicator is available here since 2016: https://www.prorealcode.com/prorealtime-indicators/matrix-series-flower-indicator/
Thanks for posting conversion tryout, I’m sure you enjoyed doing this! Don’t hesitate to post more and help others asking for code conversion 😉
1 user thanked author for this post.
04/14/2023 at 11:34 AM #213284Do not embed documents and/or pictures in your text, or the loading of the pages will slow down. Use only “Select File” to attach them, instead. Thank you 🙂
-
AuthorPosts
Find exclusive trading pro-tools on