BTC Gravity Oscillator
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © nickolassteel

//@version=5
indicator(title='BTC Gravity Oscillator', format=format.price, precision=1)


//Variables
BTC = request.security('BTCUSD', 'W', close)


//COG
BTCcog = ((ta.cog(BTC, 20)) + 12) * (10/6)
fx = math.pow(math.e, -1 * ((bar_index - 250)* 0.01)) + 6.8
BTCadj = (BTCcog / fx) * 10


//Graph
c_grad = color.from_gradient(BTCadj, 0, 10, color.rgb(0, 500, 0, 25), color.rgb(500, 0, 0, 0))
plot(BTCadj, linewidth=2, color=c_grad)
hline(5)


