TradingView
SeaSide420
9 Th03 2019 06:14

RSI TSI 

Bitcoin / DollarBitfinex

Mô tả

RSI & TSI combination, with Hull MA for a center Line.
Order entry with either RSI TSI or Hull MA
Experimental strategy for possible use as bot
Plots named for use with alerts
Bình luận
SeaSide420
//@version=3
study("RSI TSI", overlay=false)
kehh=input(title="Hull MA Length",type=integer,defval=50)
length1 = input( title="RSI Long Length",type=integer,defval=14 )
length2 = input( title="RSI Short Length",type=integer,defval=12 )
long = input(title="TSI Long Length", type=integer,defval=35)
short = input(title="TSI Short Length", type=integer,defval=35)
signal = input(title="TSI Signal Length", type=integer,defval=13)
overSold = input( 20 )
overBought = input( 80 )
price = input( close )
p=price
FromMonth = input(defval = 9, title = "From Month", minval = 1, maxval = 12)
FromDay = input(defval = 1, title = "From Day", minval = 1, maxval = 31)
FromYear = input(defval = 2018, title = "From Year", minval = 2017)
ToMonth = input(defval = 1, title = "To Month", minval = 1, maxval = 12)
ToDay = input(defval = 1, title = "To Day", minval = 1, maxval = 31)
ToYear = input(defval = 9999, title = "To Year", minval = 2017)
start = timestamp(FromYear, FromMonth, FromDay, 00, 00)
finish = timestamp(ToYear, ToMonth, ToDay, 23, 59)
window() => time >= start and time <= finish ? true : false
vrsi = rsi(p, length1)
vrsif = rsi(p, length2)
c=vrsi<vrsif?green:red
d=plot(vrsi, style = line, color=black, linewidth = 2, title='vrsi1')
e=plot(vrsif, style = line, color=black, linewidth = 2, title='vrsi2')
fill(d,e,color=c, transp=0, title='rsi cloud')
a2ma=2*wma(p,round(kehh/2))
ama=wma(p,kehh)
adiff=a2ma-ama
sqn=round(sqrt(kehh))
a2ma1=2*wma(p[1],round(kehh/2))
ama1=wma(p[1],kehh)
adiff1=a2ma1-ama1
sqn1=round(sqrt(kehh))
a1=wma(adiff,sqn)
a2=wma(adiff1,sqn)
cc=a1<p?green:red
dd=plot(a1-(p-51), style = line, color=black, linewidth = 1, title='HMA1')
ee=plot(a2-(p-49), style = line, color=black, linewidth = 1, title='HMA2')
double_smooth(src, long, short) =>
fist_smooth = ema(src, long)
ema(fist_smooth, short)
pc = change(price)
double_smoothed_pc = double_smooth(pc, long, short)
double_smoothed_abs_pc = double_smooth(abs(pc), long, short)
tsi_value = 100 * (double_smoothed_pc / double_smoothed_abs_pc)+50
keh = tsi_value>overSold?lime:orange
teh = ema(tsi_value, signal)>overBought?orange:red
meh = ema(tsi_value, signal)>tsi_value?red:lime
plot(tsi_value, color=keh, linewidth=2, title='TSI value')
plot(ema(tsi_value, signal), color=teh, linewidth=2, title='TSI signal')
plot(cross(tsi_value, ema(tsi_value, signal)) ? tsi_value : na, style = circles, color=meh, linewidth = 3, title='TSI cross')
fill(dd,ee,color=cc, transp=0, title='HMA cloud')
plot(overBought, style = line, color=cc, linewidth = 1, title='overBought')
plot(overSold, style = line, color=cc, linewidth = 1, title='overSold')
//if (tsi_value>tsi_value[1] and a1>a2)
// strategy.entry("Long", strategy.long, comment="Long", when=window())
//if (tsi_value<tsi_value[1] and a1<a2)
// strategy.entry("Short", strategy.short, comment="Short", when=window())
//if (vrsi>vrsi[1] and a1>a2)
// strategy.entry("Long", strategy.long, comment="Long", when=window())
//if (vrsi<vrsi[1] and a1<a2)
//
Mona_Trading
@SeaSide420 Thank you for your your superb scrip!!!
Could you kindly add "Level line = 50"?
And - if possible - could you give RSI-line like a line with the same thickness?
SeaSide420
@Mona_Trading, add to the script:
plot(50, style = line, color=cc, linewidth = 1, title='50')
and RSI line thickness... try making RSI length 1 less and/or RSI length 2 more
or else edit:
vrsi = rsi(p, length1)
vrsif = rsi(p, length2)
c=vrsi<vrsif?green:red
d=plot(vrsi, style = line, color=black, linewidth = 2, title='vrsi1')
e=plot(vrsif, style = line, color=black, linewidth = 2, title='vrsi2')
fill(d,e,color=c, transp=0, title='rsi cloud')

congrats on becoming pinescript programmer lolz
Mona_Trading
@SeaSide420,
Oh, You have immersed me in an amazing world of codes)))!
So, I never give up and try to add the script!
Thank You!))
Feelax
line 42: mismatched input 'fist_smooth' expecting 'end of line without line continuation'
SeaSide420
@Feelax, see in this screenshot, you need to add spaces in before that line. i.gyazo.com/86de03b5decbe83579c13ad28f8b6089.png
rkdsharemarket
sir , why you remove this ??
tiamo3733
Thank you for your kind script.
SeaSide420
@tiamo3733, your welcome. i hope it brings you epik win
tiamo3733
@SeaSide420, Thank your comment. I like your idea. I want to come up with a good idea like you.
Thêm nữa