Share market aasan hai
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © bsbrn0111

//@version=4
study(title = "share market aasan hai", shorttitle = " SARLA-CPR", overlay=true)

trackprice_bool = input(true, "trackprice")

daily_open = security(syminfo.tickerid, "D", open[0])
daily_high = security(syminfo.tickerid, "D", high[0])
daily_low = security(syminfo.tickerid, "D", low[0])
daily_close = security(syminfo.tickerid, "D", close[0])
prev_day_high = security(syminfo.tickerid, "D", high[0])
prev_day_low = security(syminfo.tickerid, "D", low[0])

daily_pivot = (daily_high + daily_low + daily_close)/3
daily_bc = (daily_high + daily_low)/2
daily_tc = 2 * daily_pivot - daily_bc
daily_r1 = 2 * daily_pivot - daily_low
daily_r2 = daily_pivot + daily_high - daily_low
daily_r3 = daily_r1 + daily_high - daily_low
daily_r4 = daily_r3 + daily_r2 - daily_r1
daily_s1 = 2 * daily_pivot - daily_high
daily_s2 = daily_pivot - daily_high + daily_low
daily_s3 = daily_s1 - daily_high + daily_low
daily_s4 = daily_s3 + daily_s2 - daily_s1

plot(daily_pivot, "daily_pivot", color.purple, linewidth = 2, style = plot.style_circles, trackprice = trackprice_bool)
plot(daily_bc, "daily_bc", color.purple, linewidth = 2, style = plot.style_circles, trackprice = trackprice_bool)
plot(daily_tc, "daily_tc", color.purple, linewidth = 2, style = plot.style_circles, trackprice = trackprice_bool)
plot(prev_day_high, "prev_day_high", color.black, linewidth = 2, style = plot.style_line, trackprice = trackprice_bool)
plot(prev_day_low, "prev_day_low", color.black, linewidth = 2, style = plot.style_line, trackprice = trackprice_bool)

plot(daily_r1, "daily_r1", color.green, linewidth = 2, style = plot.style_line, trackprice = trackprice_bool)
plot(daily_r2, "daily_r2", color.green, linewidth = 2, style = plot.style_line, trackprice = trackprice_bool)
plot(daily_r3, "daily_r3", color.green, linewidth = 2, style = plot.style_line, trackprice = trackprice_bool)
plot(daily_r4, "daily_r4", color.green, linewidth = 2, style = plot.style_line, trackprice = trackprice_bool)

plot(daily_s1, "daily_s1", color.red, linewidth = 2, style = plot.style_line, trackprice = trackprice_bool)
plot(daily_s2, "daily_s2", color.red, linewidth = 2, style = plot.style_line, trackprice = trackprice_bool)
plot(daily_s3, "daily_s3", color.red, linewidth = 2, style = plot.style_line, trackprice = trackprice_bool)
plot(daily_s4, "daily_s4", color.red, linewidth = 2, style = plot.style_line, trackprice = trackprice_bool)

