Yesterdays Total ETH Volume Compared to Todays ETH volume
Code:
#For Custom Quote Watchlist Column
#Relative Volume Comparisons
#Yesterdays Total ETH Volume Compared to Todays ETH volume
#Mobius
#V01.08.2023
def v = volume;
def c = close;
def x = BarNumber();
def nan = double.nan;
def ETHbar1 = if GetTime() crosses above RegularTradingEnd(getYYYYMMDD())
then x
else ETHbar1[1];
def RTH = GetTime() >= RegularTradingStart(GetYYYYMMDD()) and
GetTime() <= RegularTradingEnd(GetYYYYMMDD());
def vD = if x == ETHbar1 and v > 0
then v
else if x == ETHbar1 and isNaN(v)
then 1
else if !RTH and !isNaN(v)
then compoundValue(1, vD[1] + v, vD[1])
else if !RTH and isNaN(v)
then vD[1] + 1
else if RTH
then vD[1]
else vd[1];
def PrevRTHbar1 = if ETHbar1 != ETHbar1[1]
then ETHbar1[1]
else PrevRTHbar1[1];
def indexBar = ETHbar1 - PrevRTHbar1;
def prevETHVol = if !RTH and RTH[1]
then getValue(v, indexBar)
else if !RTH
then compoundValue(1, prevETHVol[1] + GetValue(v, indexBar), GetValue(v, indexBar))
else prevETHVol[1];
def var = AbsValue((PrevETHVol - vD) / PrevETHVol);
AddLabel(1, AsPercent(var), if var >= 1 then color.green else color.red);
#End Code ETH Volume Comparison
Last edited by a moderator: