AMC Dividend Shift Variance [Joshlo]
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Joshlo

//@version=5
indicator("AMC Dividend Shift Variance", shorttitle="AMC Div Shift", overlay=true)

//PRE SHIFT AMC in TV
tvShift = input.float(1.62779, title="TradingView Shift", group="TradingView Shift")
tvCol = input.color(color.purple, title="Pre Dividend Split Price", group="TradingView Shift")

//AMC DIVIDEND DATE
showDate = input.bool(true, "Show Dividend Date on Chart", group="AMC Dividend Date")
i_startTime = input.time(title="Div Date Open", defval=timestamp("22 Aug 2022 13:30:00"), tooltip="Adjust according to your timezone", group="AMC Dividend Date")
i_endTime = input.time(title="Div Date Open +5mins", defval=timestamp("22 Aug 2022 13:35:00"), tooltip="Adjust according to your timezone", group="AMC Dividend Date")
f_dateFilter = time >= i_startTime and time <= i_endTime
f_preSplit = time < i_startTime
f_postSplit = time > i_endTime


//Alternative Charts Shift
i_wb = input.bool(true, "WeBull Shift", group="Alternative Shifts")
webullShift = input.float(1.49917, title="Webull Shift", group="Alternative Shifts")
wbCol = input.color(color.blue, title="Webull Shift Colour", group="Alternative Shifts")

i_futu = input.bool(true, "Futu Shift", group="Alternative Shifts")
futuShift = input.float(1.61342, title="Futu Shift", group="Alternative Shifts")
futuCol = input.color(color.aqua, title="Futu Shift Colour", group="Alternative Shifts")

i_hood = input.bool(true, "Robinhood Shift", group="Alternative Shifts")
hoodShift = input.float(1.57357, title="Robinhood Shift", group="Alternative Shifts")
hoodCol = input.color(color.lime, title="Robinhood Shift Colour", group="Alternative Shifts")


tv1=plot(f_preSplit ? high*tvShift : na, color=color.new(tvCol, 100), title="AMC Pre Shift High")
tv2=plot(f_preSplit ? low*tvShift : na, color=color.new(tvCol, 100), title="AMC Pre Shift Low")
fill(tv1, tv2, color=color.new(tvCol, 80), title="AMC Pre Shift Range")
plotbar(showDate ? f_dateFilter ? 27.49 : na : na, showDate ? f_dateFilter ? 27.49 : na : na, showDate ? f_dateFilter ? 8.49 : na : na, showDate ? f_dateFilter ? 8.49 : na : na, color=color.new(color.blue,0), title="AMC Dividend Split Date")

wb1=plot(i_wb ? f_preSplit ? (high*tvShift)/webullShift : na : na, color=color.new(wbCol, 100), title="WeBull Pre High")
wb2=plot(f_preSplit ? (low*tvShift)/webullShift : na, color=color.new(wbCol, 100), title="WeBull Shift Low")
fill(wb1, wb2, color=color.new(wbCol, 80), title="WeBull Shift Range")

futu1=plot(i_futu ? f_preSplit ? (high*tvShift)/futuShift : na : na, color=color.new(futuCol, 100), title="Futu Shift High")
futu2=plot(i_futu ? f_preSplit ? (low*tvShift)/futuShift : na : na, color=color.new(futuCol, 100), title="Futu Shift Low")
fill(futu1, futu2, color=color.new(futuCol, 80), title="Futu Shift Range")

hood1=plot(i_hood ? f_preSplit ? (high*tvShift)/hoodShift : na : na, color=color.new(hoodCol, 100), title="Robinhood Shift High")
hood2=plot(i_hood ? f_preSplit ? (low*tvShift)/hoodShift : na : na, color=color.new(hoodCol, 100), title="Robinhood Shift Low")
fill(hood1, hood2, color=color.new(hoodCol, 80), title="Robinhood Shift Range")