• LIMITED TIME ONLY: Take $40 off VIP with code: BTD40.

9EMA +VWAP Cross

OptionsTrader

New member
Is it possible to alert when the 9EMA crosses VWAP on the 15m time frame within one candle? and make a watchlist script for it?

For example, something on the watchlist that shows green when 9EMA crosses VWAP to the upside and red for the downside. Blank when the cross happened more than 1 candle ago.

Essentially my strategy is waiting to cross on the 15m near support/resistance then getting the same cross on 5m for an entry trigger. Works very well however I'd like to be able to more easily scan for this setup.

Any help is appreciated I've learned a lot from this forum so thank you guys!
 

s1111

Active member
This Might work, haven't used it in a while .
Code:
# VWAP Watchlist
# tomsk
# 1.25.2020

# Watchlist that is painted green when 9 ema crosses above vwap within last 1 bars
# It is painted red when 9 ema crosses below vwap within last 1 bars

input length = 9;

def ema = ExpAverage(close, length);
def vwapValue = reference VWAP();
def crossUp = ema crosses above vwapValue within 1 bars;
def crossDn = ema crosses below vwapValue within 1 bars;
AddLabel(yes, if EMA > VwapValue then "BUY" else "SELL", if EMA < vwapValue then Color.Black else Color.Black);
AssignBackgroundColor(if EMA > VWAPValue  and EMA>EMA[1] then Color.green else if EMA < VWAPValue  and EMA<EMA[1] then Color.red else color.black);
 
Alert(CrossUp, " ", Alert.Bar, Sound.Chimes);
Alert(CrossDn, " ", Alert.Bar, Sound.Bell);

# End VWAP Watchlist
 
Last edited:

OptionsTrader

New member
This Might work, haven't used it in a while .
Code:
# VWAP Watchlist
# tomsk
# 1.25.2020

# Watchlist that is painted green when 9 ema crosses above vwap within last 1 bars
# It is painted red when 9 ema crosses below vwap within last 1 bars

input length = 9;

def ema = ExpAverage(close, length);
def vwapValue = reference VWAP();
def crossUp = ema crosses above vwapValue within 1 bars;
def crossDn = ema crosses below vwapValue within 1 bars;
AddLabel(yes, if EMA > VwapValue then "BUY" else "SELL", if EMA < vwapValue then Color.White else Color.White);
AssignBackgroundColor(if EMA > VWAPValue then color.GREEN else  color.RED);

Alert(CrossUp, " ", Alert.Bar, Sound.Chimes);
Alert(CrossDn, " ", Alert.Bar, Sound.Bell);

# End VWAP Watchlist
Everything has a buy or sell which means it's not showing the within one bar part of it

It should be something like: green if 9 ema crosses > vwap within 1 bar else red if 9 ema cross < vwap within 1 bar else black

I just don't know how to code it
 

Similar threads

Top