Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // @version=5
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ User Data Log ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
- // This indicator is modified or developed by [DM] D.Martinez
- // Copyright © D.Martinez 2020 to present
- // Title= xx.1 b.01 Ultimate Oscillator Trilogy >[DM]<
- // Release : SEP/08/2021 : First release on TDW
- // Update : SEP/08/2021 : na
- // Update : NOV/11/2021 : Update code to Pine v5, Added New Colors, Added BB
- // Original Autor: # Release Date: # Publication: #
- // Script may be freely distributed under the MIT license
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ User Inputs ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
- indicator(title="Ultimate Oscillator [DM]", shorttitle="UO [DM]", overlay=false)
- inp = input(close)
- /// Inputs ///
- inp_ctm_res = input.timeframe(defval="" , title="Resolution" , group="Source settings" )
- inp_opt_rep = input.bool (defval=true , title="Allow Repainting" , group="Source settings" )
- alrt_opt_01 = input (defval=false , title="Active Alerts " , group="Alerts settings" )
- inp_opt_sqz = input (defval=true , title="Active Squeeze Alerts" , group="Alerts settings" )
- inp_flen_sqz= input.float (defval=1.5,minval=000,maxval=5.0,step=0.01 , title="Squeeze Sensitivity" , group="Signal settings" )
- inp_col_cbar= input.bool (defval=false , title="Allow bar color condition" , group="Signal settings" )
- inp_col_fl1 = input.bool (defval=false , title="Fill Plots" , group="Signal settings" )
- inp_col_fl2 = input.bool (defval=false , title="Fill Bands" , group="Signal settings" )
- inp_col_bkg = input.bool (defval=true , title="Show BackGround" , group="Signal settings" )
- inp_sig_lvl = input.bool (defval=true , title="Show Reference Hlines" , group="Signal settings" )
- inp_col_lvl = input.bool (defval=true , title="Gradient Color Ob Os Lines?", group="Signal settings" )
- inp_opt_otp = input.string (defval="AVG", options = ["ALL","AVG","STD"] , title="Visualize Selected Signals" , group="Signal settings" )
- inp_ilen_11 = input.int (defval=00008, minval=00001, maxval=01595, step=00001, title="UO Fast Short Lenght" , group="UO #01 Lenght settings")
- inp_ilen_12 = input.int (defval=00032, minval=00002, maxval=01595, step=00001, title="UO Fast Long Length" , group="UO #01 Lenght settings")
- inp_ilen_21 = input.int (defval=00021, minval=00001, maxval=01595, step=00001, title="UO Mean Short Lenght" , group="UO #02 Lenght settings")
- inp_ilen_22 = input.int (defval=00144, minval=00002, maxval=01595, step=00001, title="UO Mean Long Length" , group="UO #02 Lenght settings")
- inp_ilen_31 = input.int (defval=00089, minval=00001, maxval=01595, step=00001, title="UO Slow Short Lenght" , group="UO #03 Lenght settings")
- inp_ilen_32 = input.int (defval=00233, minval=00002, maxval=01595, step=00001, title="UO Slow Long Length" , group="UO #03 Lenght settings")
- inp_haxs_ob = input.int (defval=00060, minval=0-100, maxval=10000, step=00001, title="OverBought Line" , group="Axis settings" )
- inp_haxs_os = input.int (defval=00040, minval=0-100, maxval=10000, step=00001, title="OverSell Line" , group="Axis settings" )
- inp_paxs_00 = input.float (defval=00050, minval=0-100, maxval=10000, step=000.1, title="Base Limit for plot" , group="Axis settings" )
- inp_sig_ofs = input.int (defval=00000, minval=00000, maxval=01595, step=00001, title="Offset Plot 01" , group="Source settings" )
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Source ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
- //~~~~~~~~~~~~~~~~~~~~~~~~ Security Function ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
- f_security(_symbol, _res, _src, _inp_opt_rep) =>
- request.security(_symbol, _res, _src[_inp_opt_rep ? 0 : barstate.isrealtime ? 1 : 0])[_inp_opt_rep ? 0 : barstate.isrealtime ? 0 : 1]
- src_hig = f_security(syminfo.tickerid, inp_ctm_res, high, inp_opt_rep)
- src_low = f_security(syminfo.tickerid, inp_ctm_res, low, inp_opt_rep)
- src_cls = f_security(syminfo.tickerid, inp_ctm_res, inp, inp_opt_rep)
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Brain ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
- fx_wuo(i_ilen_01,i_ilen_03,i_hig,i_low,i_cls)=>
- c_ilen_02 = math.round((i_ilen_01 + i_ilen_03) / 2)
- flen_mult = i_ilen_03 / i_ilen_01
- mlen_mult = i_ilen_03 / c_ilen_02
- cal_upbp = i_cls - math.min(i_low, i_cls[1])
- cal_uotr = math.max(i_hig, i_cls[1]) - math.min(i_low, i_cls[1])
- uo_avg_s = math.sum(cal_upbp, i_ilen_01) / math.sum(cal_uotr, i_ilen_01)
- uo_avg_m = math.sum(cal_upbp, c_ilen_02) / math.sum(cal_uotr, c_ilen_02)
- uo_avg_l = math.sum(cal_upbp, i_ilen_03) / math.sum(cal_uotr, i_ilen_03)
- wuosc = 100*( (uo_avg_s*flen_mult) + (uo_avg_m*mlen_mult) + (uo_avg_l*1) ) / (flen_mult+mlen_mult+1)
- sig_wuo_01 = fx_wuo(inp_ilen_11, inp_ilen_12,src_hig, src_low, src_cls)
- sig_wuo_02 = fx_wuo(inp_ilen_21, inp_ilen_22,src_hig, src_low, src_cls)
- sig_wuo_03 = fx_wuo(inp_ilen_31, inp_ilen_32,src_hig, src_low, src_cls)
- fx_wuo_mean(i_fslen,i_mslen,islen,i_flen_1,i_flen_2,i_mlen_1,i_mlen_2,i_slen_1,i_slen_2) =>
- cal_flen = math.avg(i_slen_1,i_slen_2) / math.avg(i_flen_1,i_flen_2)
- cal_mlen = math.avg(i_slen_1,i_slen_2) / math.avg(i_mlen_1,i_mlen_2)
- uoix_sig = ((i_fslen * cal_flen) + (i_mslen * cal_mlen) + islen) / (cal_flen + cal_mlen + 1)
- sig_wuo_0x = fx_wuo_mean(sig_wuo_01,sig_wuo_02,sig_wuo_03,inp_ilen_11,inp_ilen_12,inp_ilen_21,inp_ilen_22,inp_ilen_31,inp_ilen_32)
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BB UO Function ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
- fx_bbwuo(inp_src,inp_flen_01)=>
- basis_sq = ta.sma (inp_src, 21)
- stdev_sq = ta.stdev(inp_src, 21)
- upper_sq = basis_sq + (stdev_sq * math.phi)
- lower_sq = basis_sq - (stdev_sq * math.phi)
- bbw_sq = 13 * ((upper_sq - lower_sq)/(upper_sq + lower_sq))
- squeeze = bbw_sq < inp_flen_01 ? true :na
- [squeeze]
- [otp_squeeze] = fx_bbwuo(sig_wuo_0x,inp_flen_sqz)
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Color Palette ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
- col_bkg_b1 = input.color(defval=color.rgb(000, 000, 000, 000), title="BackGround Black" , group="BackGround color") //confirm //inline
- col_hlvl_f1 = input.color(defval=color.rgb(005, 000, 255, 090), title="Color fill Levels", group="BackGround color") //confirm //inline
- col_sig_h01 = input.color(defval=color.rgb(125, 125, 125, 055), title="Hline color" , group="Hline color") //confirm //inline
- col_osob_00 = input.color(defval=color.rgb(200, 000, 000, 050), title="Hline color" , group="Hline color") //confirm //inline
- col_sig_x01 = input.color(color.new(#00ff8b ,000), title="Avg UO bull strong color" , group="Hline color") //bull_color
- col_sig_x02 = input.color(color.new(#00f3ff ,050), title="Avg UO bull weak color" , group="Hline color") //bull_color
- col_sig_x03 = input.color(color.new(#ff00b3 ,000), title="Avg UO bear strong color" , group="Hline color") //bear_color
- col_sig_x04 = input.color(color.new(#00f3ff ,050), title="Avg UO bear weak color" , group="Hline color") //bear_color
- col_sig_xh1 = input.color(color.new(#0aff00 ,000), title="Hline UO Avg bull strong color" , group="Hline color") //bull_color
- col_sig_xh2 = input.color(color.new(#00caff ,050), title="Hline UO Avg bull weak color" , group="Hline color") //bull_color
- col_sig_xh3 = input.color(color.new(#ff3500 ,000), title="Hline UO Avg bear strong color" , group="Hline color") //bear_color
- col_sig_xh4 = input.color(color.new(#ff7500 ,050), title="Hline UO Avg bear weak color" , group="Hline color") //bear_color
- col_sig_f01 = input.color(color.new(#00f6ff ,000), title="Fast UO bull strong color" , group="Hline color") //bull_color
- col_sig_f02 = input.color(color.new(#00ffde ,050), title="Fast UO bull weak color" , group="Hline color") //bull_color
- col_sig_f03 = input.color(color.new(#9f00ff ,000), title="Fast UO bear strong color" , group="Hline color") //bear_color
- col_sig_f04 = input.color(color.new(#2962ff ,050), title="Fast UO bear weak color" , group="Hline color") //bear_color
- col_sig_m01 = input.color(color.new(#f2ff00 ,000), title="Mean UO bull strong color" , group="Hline color") //bull_color
- col_sig_m02 = input.color(color.new(#ffcc00 ,050), title="Mean UO bull weak color" , group="Hline color") //bull_color
- col_sig_m03 = input.color(color.new(#ff8c00 ,000), title="Mean UO bear strong color" , group="Hline color") //bear_color
- col_sig_m04 = input.color(color.new(#ffb700 ,050), title="Mean UO bear weak color" , group="Hline color") //bear_color
- col_sig_s01 = input.color(color.new(#ff00f3 ,000), title="Slow UO bull strong color" , group="Hline color") //bull_color
- col_sig_s02 = input.color(color.new(#cb00ff ,050), title="Slow UO bull weak color" , group="Hline color") //bull_color
- col_sig_s03 = input.color(color.new(#a100ff ,000), title="Slow UO bear strong color" , group="Hline color") //bear_color
- col_sig_s04 = input.color(color.new(#b600ff ,050), title="Slow UO bear weak color" , group="Hline color") //bear_color
- //~~~~~~~~~~~~~~~~~~~~~~~~~~ Color Function ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
- fc_gradientRelativePro(_source, _min, _max, _c_bullStrong, _c_bullWeak, _c_bearStrong, _c_bearWeak) =>
- var float _center = _min + (_max - _min) / 2
- color _return = _source >= _center ?
- color.from_gradient(_source, _center, _max , _c_bullWeak , _c_bullStrong) :
- color.from_gradient(_source, _min , _center, _c_bearStrong, _c_bearWeak )
- col_uos_xs = fc_gradientRelativePro(sig_wuo_0x, 035, 065, col_sig_x01, col_sig_x02, col_sig_x03, col_sig_x04)
- col_uos_hs = fc_gradientRelativePro(sig_wuo_0x, 035, 065, col_sig_xh1, col_sig_xh2, col_sig_xh3, col_sig_xh4)
- col_uos_fs = fc_gradientRelativePro(sig_wuo_01, 030, 070, col_sig_f01, col_sig_f02, col_sig_f03, col_sig_f04)
- col_uos_ms = fc_gradientRelativePro(sig_wuo_02, 035, 065, col_sig_m01, col_sig_m02, col_sig_m03, col_sig_m04)
- col_uos_ss = fc_gradientRelativePro(sig_wuo_03, 040, 060, col_sig_s01, col_sig_s02, col_sig_s03, col_sig_s04)
- col_os_ob = fc_gradientRelativePro(sig_wuo_0x, 035, 065, col_sig_x01, col_sig_x02, col_sig_x03, col_sig_x04)
- col_bkg_grd = otp_squeeze ? fc_gradientRelativePro(sig_wuo_0x, 035, 065, color.new(#0aff00 ,090), color.new(#00caff ,090), color.new(#ff3500 ,090), color.new(#ff7500 ,090)) : col_bkg_b1
- //~~~~~~~~~~~~~~~~~~~~~~~~~~ Color Condition ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
- osb_col_swh = inp_col_lvl ? col_uos_hs : col_osob_00
- col_bar_swh = inp_col_cbar ? col_uos_hs : na
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signal Switch ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
- fx_switch_signal(inp_opt_otp, i_sig_wuo_0x, i_sig_wuo_01, i_sig_wuo_02, i_sig_wuo_03)=>
- wuo_0 = inp_opt_otp == "ALL" ? i_sig_wuo_0x : inp_opt_otp == "AVG" ? i_sig_wuo_0x : inp_opt_otp == "STD" ? na : 0.0
- wuo_f = inp_opt_otp == "ALL" ? i_sig_wuo_01 : inp_opt_otp == "AVG" ? na : inp_opt_otp == "STD" ? i_sig_wuo_01 : 0.0
- wuo_m = inp_opt_otp == "ALL" ? i_sig_wuo_02 : inp_opt_otp == "AVG" ? na : inp_opt_otp == "STD" ? i_sig_wuo_02 : 0.0
- wuo_s = inp_opt_otp == "ALL" ? i_sig_wuo_03 : inp_opt_otp == "AVG" ? na : inp_opt_otp == "STD" ? i_sig_wuo_03 : 0.0
- [wuo_0,wuo_f,wuo_m,wuo_s]
- [wuo_0,wuo_f,wuo_m,wuo_s] = fx_switch_signal(inp_opt_otp, sig_wuo_0x, sig_wuo_01, sig_wuo_02, sig_wuo_03)
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Plots ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
- plt_h0 = plot(series=50.0 , title="Ghost" , color= osb_col_swh, linewidth=1, style=plot.style_line, offset=inp_sig_ofs , editable=true, display=display.none)
- plt_sx = plot(series=wuo_0 , title="UO Avg Speed" , color= col_uos_xs , linewidth=1, style=plot.style_line, histbase=inp_paxs_00, offset=inp_sig_ofs, editable=true, display=display.all)
- plt_s1 = plot(series=wuo_f , title="UO Fast Speed", color= col_uos_fs , linewidth=1, style=plot.style_line, histbase=inp_paxs_00, offset=inp_sig_ofs, editable=true, display=display.all)
- plt_s2 = plot(series=wuo_m , title="UO Mean Speed", color= col_uos_ms , linewidth=1, style=plot.style_line, histbase=inp_paxs_00, offset=inp_sig_ofs, editable=true, display=display.all)
- plt_s3 = plot(series=wuo_s , title="UO Slow Speed", color= col_uos_ss , linewidth=1, style=plot.style_line, histbase=inp_paxs_00, offset=inp_sig_ofs, editable=true, display=display.all)
- plt_h2 = plot(series=inp_sig_lvl ? 50 : inp_haxs_ob, title="Over Bought" , color= osb_col_swh, linewidth=1, style=plot.style_line , offset=inp_sig_ofs, editable=true, display=display.all)
- plt_h1 = plot(series=inp_sig_lvl ? na : inp_haxs_os, title="Over Sell" , color= osb_col_swh, linewidth=1, style=plot.style_line , offset=inp_sig_ofs, editable=true, display=display.all)
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ H-Lines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
- hline(price=inp_sig_lvl ? inp_haxs_ob :50 , color=inp_sig_lvl ? col_sig_h01 : na, linestyle=hline.style_dashed, linewidth=1, editable=true, title="Hline_01")
- hline(price=inp_sig_lvl ? 70 :50 , color=inp_sig_lvl ? col_sig_h01 : na, linestyle=hline.style_dashed, linewidth=1, editable=true, title="Hline_01")
- hline(price=inp_sig_lvl ? 30 :50 , color=inp_sig_lvl ? col_sig_h01 : na, linestyle=hline.style_dashed, linewidth=1, editable=true, title="Hline_01")
- hline(price=inp_sig_lvl ? inp_haxs_os :50 , color=inp_sig_lvl ? col_sig_h01 : na, linestyle=hline.style_dashed, linewidth=1, editable=true, title="Hline_01")
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fill Plots ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
- fill(plot1=plt_h0, plot2=plt_sx, color=inp_col_fl1 ? (wuo_0 > 50.0 ? color.new(color.lime,090) : color.new(color.red,090)) : na, editable=false, fillgaps=true, title="Fill UO Average Signal")
- fill(plot1=plt_h0, plot2=plt_s3, color=inp_col_fl1 ? (wuo_s > 50.0 ? color.new(color.lime,090) : color.new(color.red,090)) : na, editable=false, fillgaps=true, title="Fill UO Fast Signal" )
- fill(plot1=plt_s3, plot2=plt_s2, color=inp_col_fl1 ? (wuo_m > wuo_s ? color.new(color.lime,090) : color.new(color.red,090)) : na, editable=false, fillgaps=true, title="Fill UO Medium Signal" )
- fill(plot1=plt_s2, plot2=plt_s1, color=inp_col_fl1 ? (wuo_f > wuo_m ? color.new(color.lime,090) : color.new(color.red,090)) : na, editable=false, fillgaps=true, title="Fill UO Slow Signal" )
- fill(plot1=plt_h2, plot2=plt_h1, color=inp_col_fl2 ? col_hlvl_f1 : na , editable=false, fillgaps=true, title="Fill H-Levels" )
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BackGround ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
- bgcolor(color=inp_col_bkg ? (inp_opt_sqz ? col_bkg_grd : col_bkg_b1) : na, offset=inp_sig_ofs , editable=true , title="Background Test_01" )
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bar color ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
- barcolor(color=col_bar_swh , offset=inp_sig_ofs , editable=false , title="Bar color" )
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Alerts ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
- //~~~~~~~~~~~~~~~~~~~~~~~~ Alert Conditions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
- alrt_cnd_bull = ta.crossover (sig_wuo_0x, 50)
- alrt_cnd_bull_sqz = (otp_squeeze == true) and (sig_wuo_0x > 50) and (sig_wuo_0x > sig_wuo_0x[1])
- alrt_cnd_bear = ta.crossunder(sig_wuo_0x, 50)
- alrt_cnd_bear_sqz = (otp_squeeze == true) and (sig_wuo_0x < 50) and (sig_wuo_0x < sig_wuo_0x[1])
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Post ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
- if alrt_opt_01 and alrt_cnd_bull
- alert("Symbol = (" + syminfo.tickerid + ") TimeFrame = (" + timeframe.period + ") Current Price (" + str.tostring(close) + ") Williams Average Crossover Half Level.", alert.freq_once_per_bar_close)
- if alrt_opt_01 and alrt_cnd_bull_sqz
- alert("Symbol = (" + syminfo.tickerid + ") TimeFrame = (" + timeframe.period + ") Current Price (" + str.tostring(close) + ") Williams Average Crosses Have Squeeze Zone!!! And Is Over Half Level.", alert.freq_once_per_bar_close)
- if alrt_opt_01 and alrt_cnd_bear
- alert("Symbol = (" + syminfo.tickerid + ") TimeFrame = (" + timeframe.period + ") Current Price (" + str.tostring(close) + ") Williams Average Crosses Crossunder Half Level.", alert.freq_once_per_bar_close)
- if alrt_opt_01 and alrt_cnd_bear_sqz
- alert("Symbol = (" + syminfo.tickerid + ") TimeFrame = (" + timeframe.period + ") Current Price (" + str.tostring(close) + ") Williams Average Have Squeeze Zone!!! And Is Under Half Level.", alert.freq_once_per_bar_close)
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ End Of The Code ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
- // NOTES:
- // 1.1 Before calculating the Ultimate Oscillator, two variable need to be defined; Buying Pressure and True Range.
- // Buying Pressure (BP) = Close - Minimum (Lowest between Current Low or Previous Close)
- // True Range (TR) = Maximum (Highest between Current High or Previous Close) - Minimum (Lowest between Current Low or Previous Close)
- // 1.2. The Ultimate Oscillator then uses these figures over three time periods:
- // Average7 = (7 Period BP Sum) / (7 Period TR Sum)
- // Average14 = (14 Period BP Sum) / (14 Period TR Sum)
- // Average28 = (28 Period BP Sum) / (28 Period TR Sum)
- // 1.3. The final Ultimate Oscillator calculations can now be made:
- // UO = 100 x [(4 x Average7)+(2 x Average14)+Average28]/(4+2+1)
- // 2. pi = 2 * asin(1)
- // 3. gauss= (34.13+34.13) + (13.59+13.59) + (2.14+2.14) + (0.13+0.13)
- // 4. time frames= ((365/7)*5)/12
- //
- ////////////////////////////////////////////////////////////////////////////////////////////////
- //----------------------------------------------------------------------0005UR1-DUD3LL40000---//
- //-----------------------------------------------------------------------00000000000000000----//
- //--------------'Y888888bo..-------:-----:-------..od888888Y'-------------012131815131210-----//
- //---8UTT3RFLY-----88JH0N8888b..----:----:----.d880LL1N63R8---------------012131815131210-----//
- //------5H4RK------88888Y'```Y8b.----'-'´---.d8Y'´´`Y888888---------------012131815131210-----//
- //-----CR48-------Y88888``.db.__.Yb.-¡'¡.'--.dY.´´.db.´8888Y--------------012131815131210-----//
- //---84T----------`888``Y88Y````8bd__(d)__bd88Y´´888´--8888---------------012131815131210-----//
- //--H4RM0N1C5-------888b``_' ````````(.)_´´´´´´'´´.d8888------------------012133815131210-----//
- //------------------Y88888bd8g.'`````(.)´´´´´.´´'.g8bd888Y----------------812131815131210-----//
- //---------------------'Y'88_.8.'JH0N-3LH3R5''8._.8._88'Y'----------------812131815131210-----//
- //--------------------.!__.8'_.db_.(.)':'..b.´8b8_'8.__!.-----------------812131815131210-----//
- //------------------------d88``'``.8_(.)_8.´´'´´88b__---------------------812131815131210-----//
- //----------------------d888b``.g8._.()._.8g.´´d888b_---------------------812131815131210-----//
- //---------------------:888888888Y'------'Y888888888:---------------------812131815131210-----//
- //---------------------'!_8888888´--------`8888888_!'---------------------812131815131210-----//
- //-----------------------'8Y--`'Y----------Y'´--Y8'-----------------------812131815131210-----//
- //----------------------'Y-----------------------Y'-----------------------812131815131210-----//
- //-----------------------------------------------------------------------00000000000000000----//
- //----------------------------------------------------------------------00000F180N4CC100000--0-//
- ////////////////////////////////////////////////////////////////////////////////////////////////
- ////8888888888----8888888------8888888--------\\1.618====\\\|///=============I=I====I=I=II==////
- ////88888888888---88888888----88888888--------//1.272====6=0=0=9============I===I==I=I=I=I==////
- ////8888----8888--8888-8888--8888-8888-------//1.000========!========I=====I=====II======I==////
- ////8888-----8888-8888--88888888--8888------//0.786========~~~======I=I===I==============II=////
- ////8888-----8888-8888---888888---8888-----//0.618=I====I==========I===I=I================I=////
- ////8888----8888--8888------------8888----//0.500===I==I=I=II=I===I=====I====3LL10T=W4V3==II////
- ////88888888888---8888------------8888---//0.382=====II===I==I=I=I==========================////
- ////8888888888----8888------------8888--//0.236=================I===========================////
- ////////////////////////////////////////////////////////////////////////////////////////////////
- //
- /// MIT License Terms https://opensource.org/licenses/mit-license.php ///
- //Permission is hereby granted, free of charge, to any person obtaining a copy of
- //this software and associated documentation files (the "Software"), to deal in
- //the Software without restriction, including without limitation the rights to
- //use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
- //of the Software, and to permit persons to whom the Software is furnished to do
- //so, subject to the following conditions:
- //
- //The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
- //
- //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
- //FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
- //COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- //IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- //CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
Advertisement
Add Comment
Please, Sign In to add comment