49 0 7
Buy Low (Green)
Sell High (Red)
Remove from Favorite Scripts Add to Favorite Scripts
study(title="JV", shorttitle="Buy Sell", overlay=false)
src = close, 
len = input(20, minval=1, title="RSI Length")
len2 = input(10, minval=1, title="EMA of RSI Length")
up = rma(max(change(src), 0), len)
down = rma(-min(change(src), 0), len)
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))
emaRSI = ema(rsi,len2)


pd = input(22, title="LookBack Period Standard Deviation High")
bbl = input(20, title="Bolinger Band Length")
mult = input(2.0    , minval=1, maxval=5, title="Bollinger Band Standard Devaition Up")
lb = input(50  , title="Look Back Period Percentile High")
ph = input(.85, title="Highest Percentile - 0.90=90%, 0.95=95%, 0.99=99%")
pl = input(1.01, title="Lowest Percentile - 1.10=90%, 1.05=95%, 1.01=99%")

wvf = ((highest(close, pd)-low)/(highest(close, pd)))*100

sDev = mult * stdev(wvf, bbl)
midLine = sma(wvf, bbl)
lowerBand = midLine - sDev
upperBand = midLine + sDev

rangeHigh = (highest(wvf, lb)) * ph
rangeLow = (lowest(wvf, lb)) * pl

col = wvf >= upperBand or wvf >= rangeHigh ? orange : rsi>emaRSI ? green : gray

// plot(wvf, style=histogram, linewidth = 4, color=col)


n1 = input(10, "Channel Length")
n2 = input(21, "Average Length")
obLevel1 = input(60, "Over Bought Level 1")
obLevel2 = input(55, "Over Bought Level 2")
osLevel1 = input(-60, "Over Sold Level 1")
osLevel2 = input(-53, "Over Sold Level 2")
 
ap = hlc3 
esa = ema(ap, n1)
d = ema(abs(ap - esa), n1)
ci = (ap - esa) / (0.015 * d)
tci = ema(ci, n2)
 
wt1 = tci
wt2 = sma(wt1,4)



value = wvf >= upperBand or wvf >= rangeHigh ? -1 : rsi>emaRSI ? 1 : -0.5
// green: value == -1? orange: na

color2 = value == 1 and value[1] ==-1 and value[2] == -1 ? green: na 
color3 = value == 1 and value[2] ==-1 and value[3] == -1 ? green: color2

buy=wt1<osLevel2 and wt1>wt2 ? 0.5:0
sell=wt1>obLevel2 and wt1<wt2 ? -1: value ==-0.5 and value[1]==1 ?  -0.5:0
sellcolor = sell==-1 ? red : orange


plot(value, style=histogram, linewidth = 4, color=color3)
plot(buy, style=histogram, linewidth = 4, color=teal)
plot(sell, style=histogram, linewidth = 4, color=sellcolor)

This script was updated: Buy Sell
Ideas Scripts Chart
United States
United Kingdom
India
España
Italia
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Billing Sign Out