Conversion of Pine Script WT Oscillator
Forums › ProRealTime English forum › ProBuilder support › Conversion of Pine Script WT Oscillator
- This topic has 6 replies, 2 voices, and was last updated 3 years ago by Nicolas.
-
-
10/13/2021 at 1:12 PM #179580
Hi guys
I am looking for some assistance in converting a pine script code of a WaveTrend Oscillator into Prorealtime. I have had a go myself, but to be fair have made a complete hash of it.
I have attached the script and an image of the output.
Many thanks in advance for the assistance and happy trading.
Dave
10/13/2021 at 2:34 PM #179588Same indicator as: https://www.prorealcode.com/prorealtime-indicators/wave-trend-oscillator/
but with different colors.
10/13/2021 at 3:03 PM #179590Hi Nicolas
Thanks for getting back to me so quickly, but I had already looked at the oscillator you have suggested, and unfortunately it’s much closer to a rehash of a Stochastic Momentum than it is the Wave Trend Oscillator I am looking for – I have attached a couple of screen shots for you to see.
I appreciate that you are converting code for free, and do not want to take advantage, but If it is not possible to replicate the indicator i am looking for, then please do tell me and I will continue with my Tradingview subscription instead.
Many Thanks
Dave
10/13/2021 at 4:10 PM #17961110/13/2021 at 4:36 PM #179615Ok here it is, I hope you dont mind I did not code color gradient of the curves? Do you need also candle coloring like in the original code, your screenshot is only about the oscillator though ..
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263src = medianprice//WTO PLOT ONEchannellen = 8 //Channel Lengthaveragelen = 6 //Average Lengthwt1malen = 3 //Moving Average Lengthesa = average[channellen,1](src)d = average[channellen,1](abs(src - esa))ci = (src - esa) / (0.015 * d)tci = average[averagelen,1](ci)wt1 = tciwt1ma = average[wt1malen](wt1)//COLOR INPUTS//wt_1_up = input(#ff9800, title="High", inline="wt 1 color", group="Primary Wavetrend Inputs")//wt_1_down = input(#2962ff, title="Low", inline="wt 1 color", group="Primary Wavetrend Inputs")//wt_1_color = color.from_gradient(wt_1, -80, 80, wt_1_down, wt_1_up)//plot(wt_1, color=wt_1_color, title="Primary Wavetrend")//WTO PLOT TWOchannellen2 = 13 //Channel Lengthaveragelen2 = 55 //Average Lengthesa2 = average[channellen2,1](src)d2 = average[channellen2,1](abs(src - esa2))ci2 = (src - esa2) / (0.015 * d2)tci2 = average[averagelen2,1](ci2)wt2 = tci2////MOMENTUM CHANGE & BACKGROUND COLORS//PRIMARY WTO & SECONDARY WTOmomchangelong1 = wt1 crosses over 0momchangeshort1 = wt1 crosses under 0momchangelong2 = wt2 crosses over 0momchangeshort2 = wt2 crosses under 0if momchangelong1 thenbackgroundcolor(0,0,255,85)elsif momchangeshort1 thenbackgroundcolor(255,0,0,85)endifif momchangelong2 thenbackgroundcolor(0,0,255,85)elsif momchangeshort2 thenbackgroundcolor(255,0,0,85)endif//MOVING AVERAGE CROSS SIGNALS ON PRIMARY WAVETRENDif wt1 crosses over wt1ma thendrawtext("●",barindex,-80,dialog,bold,16) coloured(0,0,255)elsif wt1 crosses under wt1ma thendrawtext("●",barindex,80,dialog,bold,16) coloured(255,0,0)endifif islastbarupdate thendrawrectangle(0,60,barindex,80) coloured(239, 83, 80,85) bordercolor(0,0,0,0)drawrectangle(0,-60,barindex,-80) coloured(33, 150, 243,85) bordercolor(0,0,0,0)endifreturn wt1 as "Primary Wavetrend", wt2 as "Secondary Wavetrend", 0 coloured(120, 123, 134) style(dottedline) as "median", 40 coloured(120, 123, 134) style(dottedline) as "40", 20 coloured(120, 123, 134) style(dottedline) as "20", -40 coloured(120, 123, 134) style(dottedline) as "-40", -20 coloured(120, 123, 134) style(dottedline) as "-20", 80 coloured(239, 83, 80) style(dottedline) as "80", 60 coloured(239, 83, 80) style(dottedline) as "60",-80 coloured(33, 150, 243) style(dottedline) as "-80", -60 coloured(33, 150, 243) style(dottedline) as "-60"10/13/2021 at 5:48 PM #179621Hi Nicolas
It is looking very close to being spot on, and is close enough for me to work with – thank you very much.
What code would I need to add to make the different elements editable within the settings pop up of the indicator – for example Channel Length = x (i’ve attached a couple of images for explanation)
Again, many thanks.
10/14/2021 at 8:55 AM #179645I published a more complete version with the settings available in the window, you can download now from the library: Wave Trend Oscillator
-
AuthorPosts
Find exclusive trading pro-tools on