Average crossover pre-market watchlist column?

P

Piper2808t

Member
2019 Donor
VIP
hello looking for a column when avexp crosses up premarket high or crosses down pre market low during rth thanks
 
T

tomsk

Well-known member
VIP
@Piper2808t Here's a watchlist column that displays a label when avgExp(21) crosses up Pre Market high during RTH
The code for pre market low can easily be replicated, but change the condition to look for a lower low during the pre market
Test this during premarket before tomorrow's session, make sure you run this on say a 5 min chart

Code:
# Pre Market High Watchlist
# tomsk
# 11.18.2019

# Watchlist column that displays a label when avgExp(21) crosses up Pre Market high during RTH

def avg = ExpAverage(close, 21);

def PreMarket = GetDay() == GetLastDay() and
                GetTime() < RegularTradingStart(getYYYYMMDD());

def RTH = GetTime() >= RegularTradingStart(getYYYYMMDD()) and
          GetTime() <= RegularTradingEnd(getYYYYMMDD());

def PreMarketHigh = if PreMarket and !PreMarket[1] then high
                    else if PreMarket and high > PreMarketHigh[1] then high
                    else if !PreMarket then PreMarketHigh[1]
                    else PreMarketHigh[1];

AddLabel(1, if RTH and avg crosses above PreMarketHigh then "Cross PM High" else " ", Color.White);
# End Code
 
Last edited:

Similar threads

Top