314 1 64
Buy Low Sell High
Remove from Favorite Scripts Add to Favorite Scripts
study(title="JV", shorttitle="Buy Sell", overlay=false)
src = close, 
up = rma(max(change(src), 0), 20)
down = rma(-min(change(src), 0), 20)
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))
emaRSI = ema(rsi,10)

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

sDev = 2.0 * stdev(wvf, 20)
midLine = sma(wvf, 20)
lowerBand = midLine - sDev
upperBand = midLine + sDev

rangeHigh = (highest(wvf, 50)) * 0.85
rangeLow = (lowest(wvf, 50)) * 1.01

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

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

obLevel = input(55, "Over Bought Level")
osLevel = input(-53, "Over Sold Level")
 
ap = hlc3 
esa = ema(ap, 10)
d = ema(abs(ap - esa), 10)
ci = (ap - esa) / (0.015 * d)
tci = ema(ci, 21)
 
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<osLevel and wt1>wt2 ? 0.5:0
sell=wt1>obLevel 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)

nope. buy high, sell higher :)
Reply
United States
United Kingdom
India
Deutschland
España
France
Italia
Polska
Brasil
Россия
Türkiye
Indonesia
Malaysia
日本
한국
中国
Home Stock Screener Forex Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Profile Profile Settings Account and Billing Priority Support Ideas Published Followers Following Private Messages Chat Sign Out