Join useThinkScript to post your question to a community of 21,000+ developers and traders.
You can adjust the time frame in the setting of the watchlist.Regarding the Watchlist and the 60 - 80 What time frame is that on?
Okay, thanks I'll see if I can find that and adjust it.You can adjust the time frame in the setting of the watchlist.
please help develop this trading view indicator into tos..
https://www.tradingview.com/script/Rvl0takd-SharkWaveTrend/
@chewie76, would you care to share shareable link for TOS for this study.Yes. I created one. See below.
Code:#study(title = 'SharkWaveTrend', shorttitle = 'SharkWaveTrend') # Converted by Sam4Cok@Samer800 - 12/2023 input colorBars = no; input vwapShow = no;#(true, title = 'Show Fast WT', type = input.bool) input wtChannelLen = 5;#, title = 'WT Channel Length', type = input.integer) input wtAverageLen = 5;#, title = 'WT Average Length', type = input.integer) input wtMASource = hlc3;#, title = 'WT MA Source', type = input.source) input wtMaLen = 2;#, title = 'WT MA Length', type = input.integer) input obLevel = 53;#, title = 'WT Overbought Level 1', type = input.integer) input osLevel = -53;#, title = 'WT Oversold Level 1', type = input.integer) input wtShowDiv = yes;#(true, title = 'Show WT Regular Divergences', type = input.bool) input wtShowHiddenDiv = no;#(false, title = 'Show WT Hidden Divergences', type = input.bool) input showHiddenDiv_nl = yes;#(true, title = 'Not apply OB/OS Limits on Hidden Divergences', type = input.bool) input wtDivOBLevel = 45;#, title = 'WT Bearish Divergence min', type = input.integer) input wtDivOSLevel = -65;#, title = 'WT Bullish Divergence min', type = input.integer) input wtDivOBLevel_addshow = yes;#(true, title = 'Show 2nd WT Regular Divergences', type = input.bool) input wtDivOBLevel_add = 15;#, title = 'WT 2nd Bearish Divergence', type = input.integer) input wtDivOSLevel_add = -40;#, title = 'WT 2nd Bullish Divergence 15 min', type = input.integer) input rsiMFIShow = no;#(true, title = 'Show MFI', type = input.bool) input rsiMFIperiod = 60;#,title = 'MFI Period', type = input.integer) input rsiMFIMultiplier = 150;#, title = 'MFI Area multiplier', type = input.float) input rsiMFIPosY = 2.5;#, title = 'MFI Area Y Pos', type = input.float) input showRsiLine = no; #(false, title = 'Show RSI', type = input.bool) input rsiSRC = close;#(close, title = 'RSI Source', type = input.source) input rsiLen = 12;#, title = 'RSI Length', type = input.integer) #input rsiOversold = 30;#, title = 'RSI Oversold', minval = 50, maxval = 100, type = input.integer) #input rsiOverbought = 60;#, title = 'RSI Overbought', minval = 0, maxval = 50, type = input.integer) input rsiShowDiv = yes;#(false, title = 'Show RSI Regular Divergences', type = input.bool) input rsiShowHiddenDiv = no;#(false, title = 'Show RSI Hidden Divergences', type = input.bool) input rsiDivOBLevel = 60;#, title = 'RSI Bearish Divergence min', type = input.integer) input rsiDivOSLevel = 30;#, title = 'RSI Bullish Divergence min', type = input.integer) input stochShow = no;#(true, title = 'Show Stochastic RSI', type = input.bool) input stochUseLog = yes;#(true, title=' Use Log?', type = input.bool) input stochAvg = no;#(false, title='Use Average of both K & D', type = input.bool) input stochSRC = close;#(close, title = 'Stochastic RSI Source', type = input.source) input stochLen = 14;#, title = 'Stochastic RSI Length', type = input.integer) input stochRsiLen = 14;#, title = 'RSI Length ', type = input.integer) input stochKSmooth = 3;#, title = 'Stochastic RSI K Smooth', type = input.integer) input stochDSmooth = 3;#, title = 'Stochastic RSI D Smooth', type = input.integer) input stochShowDiv = yes;#(false, title = 'Show Stoch Regular Divergences', type = input.bool) input stochShowHiddenDiv = no;#(false, title = 'Show Stoch Hidden Divergences', type = input.bool) input rsiLengthInput = 12;#, minval=1, title="RSI Length", group="Shark") input rsiSourceInput = close;#, "Source", group="Shark") input length2 = 30;#, minval=1, group="Shark") input src = close;#, title="Source", group="Shark") input mult = 2.0;#, minval=0.001, maxval=50, title="StdDev", group="Shark") input offset = 0;#, "Offset", minval = -500, maxval = 500, group="Shark") input HighlightBreaches = yes;#, title="Highlight Oversold/Overbought", group="Shark") input bApply25and75 = no;#, title="Apply 25/75 RSI rule", group="Shark") def na = Double.NaN; def last = IsNaN(close); def pos = Double.POSITIVE_INFINITY; def neg = Double.NEGATIVE_INFINITY; DefineGlobalColor("intense_red", Color.RED);#CreateColor(255, 35, 35)); DefineGlobalColor("regular_red", Color.DARK_RED);#CreateColor(255, 82, 82)); DefineGlobalColor("intense_green", Color.GREEN);#CreateColor(0, 230, 118)); DefineGlobalColor("regular_green", Color.DARK_GREEN);#CreateColor(76, 175, 80)); #DefineGlobalColor("wt1", CreateColor(217,205,205)); DefineGlobalColor("wt1", Color.WHITE); DefineGlobalColor("wt2", CreateColor(51, 102, 255)); #DefineGlobalColor("wt2", CreateColor(29, 63, 97)); #// } FUNCTIONS #f_findDivs(src, topLimit, botLimit, useLimits) => script f_findDivs { input src = close; input topLimit = 70; input botLimit = 30; input useLimits = yes; def na = Double.NaN; def topfractal = src[4] < src[2] and src[3] < src[2] and src[2] > src[1] and src[2] > src[0]; def botfractal = src[4] > src[2] and src[3] > src[2] and src[2] < src[1] and src[2] < src[0]; def top_fractal = if IsNaN(topfractal) then 0 else topfractal; def bot_fractal = if IsNaN(botfractal) then 0 else botfractal; def fractalize = if top_fractal then 1 else if bot_fractal then -1 else 0; def fractalTop = if fractalize > 0 and (if useLimits then src[2] >= topLimit else yes) then src[2] else na; def fractalBot = if fractalize < 0 and (if useLimits then src[2] <= botLimit else yes) then src[2] else na; def TopCond = if !IsNaN(fractalTop) and fractalTop then fractalTop else 0; def BotCond = if !IsNaN(fractalBot) and fractalBot then fractalBot else 0; def highPrev0; def highPrev1; def highPrice0; def highPrice1; if TopCond { highPrev1 = highPrev0[1]; highPrev0 = src[2]; highPrice1 = highPrice0[1]; highPrice0 = high[2]; } else { highPrev1 = highPrev1[1]; highPrev0 = highPrev0[1]; highPrice1 = highPrice1[1]; highPrice0 = highPrice0[1]; } def highPrev = highPrev1[2];#if highPrev1 != highPrev1[1] then highPrev1[1] else highPrev[1]; def highPrice = highPrice1[2];#if highPrice1 != highPrice1[1] then highPrice1[1] else highPrice[1]; def lowPrev0; def lowPrev1; def lowPrice0; def lowPrice1; if BotCond { lowPrev1 = lowPrev0[1]; lowPrev0 = src[2]; lowPrice1 = lowPrice0[1]; lowPrice0 = low[2]; } else { lowPrev1 = lowPrev1[1]; lowPrev0 = lowPrev0[1]; lowPrice1 = lowPrice1[1]; lowPrice0 = lowPrice0[1]; } def lowPrev = lowPrev1[2];#if lowPrev1 != lowPrev1[1] then lowPrev1[1] else lowPrev[1]; def lowPrice = lowPrice1[2];#if lowPrice1 != lowPrice1[1] then lowPrice1[1] else lowPrice[1]; def bearSignal = TopCond and high[2] > highPrice and src[2] < highPrev; def bullSignal = BotCond and low[2] < lowPrice and src[2] > lowPrev; def bearDivHidden = TopCond and high[2] < highPrice and src[2] > highPrev; def bullDivHidden = BotCond and low[2] > lowPrice and src[2] < lowPrev; plot top = if IsNaN(TopCond) then 0 else TopCond;#fractalTop; plot bot = if IsNaN(BotCond) then 0 else BotCond;#fractalBot; plot lowP = lowPrev; plot sigBear = if IsNaN(bearSignal) then 0 else bearSignal; plot sigBull = if IsNaN(bullSignal) then 0 else bullSignal; plot hidBear = if IsNaN(bearDivHidden) then 0 else bearDivHidden; plot hidBull = if IsNaN(bullDivHidden) then 0 else bullDivHidden; } #// Stochastic RSI script f_stochrsi { input _src = close; input _stochlen = 14; input _rsilen = 14; input _smoothk = 3; input _smoothd = 3; input _log = yes; input _avg = no; def src = if _log then Log(_src) else _src; def rsi = RSI(Price = src, Length = _rsilen); def stoch = 100 * (rsi - Lowest(rsi, _stochlen)) / (Highest(rsi, _stochlen) - Lowest(rsi, _stochlen)); def kk = Average(stoch, _smoothk); def d1 = Average(kk, _smoothd); def avg_1 = (kk + d1) / 2; def k = if _avg then avg_1 else kk; plot stochK = k; plot stochD = d1; } #/ RSI+MFI script f_rsimfi { input _period = 60; input _multiplier = 150; input rsiMFIPosY = 2.5; def c = close; def o = open; def h = high; def l = low; def dif = (c - o) / (h - l); def diff = if !IsNaN(dif) then dif else 0; def rsimfi = Average(diff * _multiplier, _period) - rsiMFIPosY; plot f_rsimfi = rsimfi; } #// WaveTrend script f_wavetrend { #def wt1 = f_wavetrend(wtMASource, wtChannelLen, wtAverageLen, wtMALen, obLevel, osLevel).wt_1; input wtMASource = close; input wtChannelLen = 9; input wtAverageLen = 12; input wtMALen = 3; input obLevel = 53; input osLevel = -53; def tfsrc = wtMASource; def esa = ExpAverage(tfsrc, wtChannelLen); def de = ExpAverage(AbsValue(tfsrc - esa), wtChannelLen); def ci = (tfsrc - esa) / (0.015 * de); def wt1 = ExpAverage(ci, wtAverageLen); def wt2 = Average(wt1, wtMALen); def wtVwap = wt1 - wt2; def wtOversold = wt2 <= osLevel; def wtOverbought = wt2 >= obLevel; def wtCross = Crosses(wt1, wt2, CrossingDirection.ANY); def wtCrossUp = (wt2 - wt1) <= 0; def wtCrossDown = (wt2 - wt1) >= 0; def wtCrosslast = Crosses(wt1[2], wt2[2], CrossingDirection.ANY); def wtCrossUplast = (wt2[2] - wt1[2]) <= 0; def wtCrossDownlast = (wt2[2] - wt1[2]) >= 0; plot wt_1 = wt1; def wt_2 = wt2; def wt_OS = wtOversold; def wt_OB = wtOverbought; def wt_cross = wtCross; def wt_CrossUp = wtCrossUp; def wt_CrossDn = wtCrossDown; def wt_Vwap = wtVwap; } #// CALCULATE INDICATORS { #// RSI def rsi = RSI(Price = rsiSRC, Length = rsiLen); #// RSI + MFI Area def rsiMFI = f_rsimfi(rsiMFIperiod, rsiMFIMultiplier, rsiMFIPosY); #// Calculates WaveTrend def wt1 = f_wavetrend(wtMASource, wtChannelLen, wtAverageLen, wtMALen, obLevel, osLevel).wt_1; def wt2 = f_wavetrend(wtMASource, wtChannelLen, wtAverageLen, wtMALen, obLevel, osLevel).wt_2; def wtOversold = f_wavetrend(wtMASource, wtChannelLen, wtAverageLen, wtMALen, obLevel, osLevel).wt_OS; def wtOverbought = f_wavetrend(wtMASource, wtChannelLen, wtAverageLen, wtMALen, obLevel, osLevel).wt_OB; def wtCross = f_wavetrend(wtMASource, wtChannelLen, wtAverageLen, wtMALen, obLevel, osLevel).wt_cross; def wtCrossUp = f_wavetrend(wtMASource, wtChannelLen, wtAverageLen, wtMALen, obLevel, osLevel).wt_CrossUp; def wtCrossDown = f_wavetrend(wtMASource, wtChannelLen, wtAverageLen, wtMALen, obLevel, osLevel).wt_CrossDn; def wtVwap = f_wavetrend(wtMASource, wtChannelLen, wtAverageLen, wtMALen, obLevel, osLevel).wt_Vwap; def shark0 = wt1 > 45 and wt1 <60; def nshark0 = wt1 < -45 and wt1 > -60; def shark1 = wt1 > 60 and wt1 < 80; def shark2 = wt1 > 80; def nshark1 = wt1 < -60 and wt1 > -80; def nshark2 = wt1 < -80; def crossup = wt1 crosses above wt2 and wt1 < -20; def crossdn = wt1 crosses below wt2 and wt1 > 20; #//KDJ indicator def Length = 14; def ll = Lowest(low, Length); def hh = Highest(high, Length); def rsv = (close - ll) / (hh - ll) * 100; script xsa { input src = close; input len = 0; input wei = 0; def sumf; def ma; def out; sumf = CompoundValue(1, sumf[1] - src[len] + src, src); ma = if IsNaN(src[len]) then Double.NaN else sumf / len; out = if IsNaN(out[1]) then ma else (src * wei + out[1] * (len - wei)) / len; plot return = out; } def k_ = xsa(rsv, 3, 1); def d_ = xsa(k_, 3, 1); def k = if k_ then k_ else na; def d = if d_ then d_ else na; def crossUp1 = Crosses(k, d, CrossingDirection.ABOVE); def crossDn1 = Crosses(d, k, CrossingDirection.BELOW); def buysig = if d < 25 and crossUp1 then -103 else na; def selsig = if d > 75 and crossDn1 then 103 else na; #//plot buy and sell signal def ple = buysig;#,color=color.green, linewidth=1,style=plot.style_area, transp=0) def pse = selsig;#,color=color.red, linewidth=2,style=plot.style_line, transp=0) #ple.SetDefaultColor(Color.cyan); #ple.SetPaintingStrategy(PaintingStrategy.POINTS); #ple.setlineWeight(5); #pse.SetDefaultColor(Color.magenta); #pse.SetPaintingStrategy(PaintingStrategy.POINTS); #pse.setlineWeight(5); AddLabel(yes, if buysig then "LB" else if crossup then "UP" else if selsig then "LS" else if crossdn then "DOWN" else if shark1 then "sell" else if shark2 then "XSELL" else if nshark1 then "buy" else if nshark2 then "XBUY" else " ", if shark1 or crossdn then color.white else if NSHARK1 or shark2 or crossup then color.blue else Color.BLACK); AssignBACKGROUNDColor( if shark0 then color.dark_red else if shark1 then color.red else if nshark0 then color.dark_green else if nshark1 then color.green else if nshark2 then color.cyan else if shark2 then color.magenta else color.black);
@chewie76, would you care to share shareable link for TOS for this study.
When i copied the code and created new study in TOS it doesn't work. I am probably doing something wrong but i shareable link always works. Big thanks.
Start a new thread and receive assistance from our community.
useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.
We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.
If you are new, or just looking for guidance, here are some helpful links to get you started.