Scan for EMA VWAP cross over


Category:
0
0

Hi Pete.  Can you help me with creating a scan in TOS that will show stocks that has an EMA(9)crossover VWAP.  I would like to have the scan to show stocks with EMA crossing above or below the VWAP.

Marked as spam
Posted by (Questions: 19, Answers: 18)
Asked on December 14, 2018 11:51 am
2266 views
0
Private answer

You posted this under the Watchlist topic but requested a scan. So this solution is for a scan and the question has been moved to the Stock Scanners topic.

def data = reference VWAP()."VWAP";
def ema = ExpAverage(close, 9);
def crossingAbove = ema[1] < data[1] and ema > data;
def crossingBelow = ema[1] > data[1] and ema < data;
# scan for crossing above
plot scan = crossingAbove;
# scan for crossing below
#plot scan = crossingBelow;

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on December 15, 2018 10:05 am
0

Hi Pete. I’m getting an error when I attempt to load the code in TOS scan. Below are the details:
No such function: ExponentialMovingAverage at 2:11
No such function: ExponentialMovingAverage at 2:11
Identifier Already Used: scan at 8:6
No such function: ExponentialMovingAverage at 2:11
Incompatible parameter: close at 2:5
No such function: ExponentialMovingAverage at 2:11
Incompatible parameter: 9 at 2:5
Already assigned: scan at 8:6
No such function: ExponentialMovingAverage at 2:11
No such function: ExponentialMovingAverage at 2:11
Identifier Already Used: scan at 8:6
No such function: ExponentialMovingAverage at 2:11
Incompatible parameter: close at 2:5
No such function: ExponentialMovingAverage at 2:11
Incompatible parameter: 9 at 2:5
Already assigned: scan at 8:6

( at December 15, 2018 1:49 pm)
0

Sorry, did that from memory and missed something. I just updated the code in my answer. Try it now.

( at December 15, 2018 4:18 pm)
0

Sorry, there are two scan signals at the bottom of the code. I forgot to add a “#” comment mark in front of one of them to turn it off. I updated my answer to correct this. You can only run one scan signal at a time. Move the “#” mark to switch between them.

( at December 15, 2018 5:06 pm)
0

Thank you very much!

( at December 15, 2018 5:06 pm)
0
Hi, I tried loading this into the scanner and it returned results which all had negative net gain for the day with the exception of a few. I checked the various stocks which did cross the vwap that day and found that the scan didnt pick them up. I am an intra day trader and would like to see when stocks with certain criteria cross the VWAP as close to real time as possible.
( at May 4, 2020 11:49 am)
0
This scan contains nothing whatsoever that requires it to find stocks that have a net gain or a net loss. When using intraday time frames you need to make sure you charts are set correctly. The chart setting named "Start aggregation at market open" must be unchecked. Otherwise your charts will never match any scan results.
( at May 4, 2020 4:41 pm)