Hi, I'm trying to make a watchlist column for Mobius's GlobeX script that paints green if the pre-market volume is higher than AvgGBx. I can't really figure out how to logically do this because it's pre-market data. I'm super new to coding so I can't wrap my head around how to check for something that isn't during real trading hours. Here's the code for this script:
If anyone can help me figure this out I'd greatly appreciate it.
Code:
# Globex Volume and Average
# Mobius
# From TASC 2017-06 | Daytrading With Night Volume
# 03.11.2018
declare lower;
def daysOnChart = if secondsTillTime(0930) == 0
then daysOnChart[1] + 1
else daysOnChart[1];
def GlobeX = getTime() < regularTradingStart(getYYYYMMDD());
def GxVol = if GlobeX and !GlobeX[1]
then volume
else if GlobeX
then CompoundValue(1, GxVol[1] + volume, volume)
else GxVol[1];
def sumVol = if !GlobeX and GlobeX[1]
then sumVol[1] + GxVol[1]
else sumVol[1];
plot v = if GlobeX
then GxVol
else double.nan;
v.SetPaintingStrategy(PaintingStrategy.Histogram);
plot AvgGbX = HighestALL(if isNaN(close[-1])
then sumVol / daysOnChart
else double.nan);
# End Code Golbex Volume and Avg
If anyone can help me figure this out I'd greatly appreciate it.