# 10 Consecutive Bars Above VWAP Scan

Category:
0
0

1. I am new to TOS and looking to scan 10 consecutive bars above VWAP eastern time zone, 5min, extended.

_____________________________________________________________

2. Also for a different scan, I am looking to scan 10 bars after the high of day during extended hours and intraday (not within 10 bars but excactly at the 10th bar).   Thank you very much!

Marked as spam
Posted by (Questions: 1, Answers: 0)
Asked on July 9, 2024 3:28 pm
9 views
 ▲ 0 ▼ ✔ Private answer Question #1 has already been posted so that portion of your request is already available here: https://www.hahn-tech.com/ans/scan-for-specified-consecutive-closes-above-or-below-vwap/ However that solution requires a bit of effort to modify the code from a watchlist column and add another line of code. So I decided to approve your question and provide the full solution here: ```input numDevDn = -2.0; input numDevUp = 2.0; input timeFrame = {default DAY, WEEK, MONTH}; def vwapValue = reference VWAP(numDevDn, numDevUp, timeFrame).VWAP; def crossAbove = close[1] < vwapValue[1] and close > vwapValue; def crossBelow = close[1] > vwapValue[1] and close < vwapValue; rec countBarsAbove = if crossAbove then 1 else if close > vwapValue then countBarsAbove[1] + 1 else 0; rec countBarsBelow = if crossBelow then -1 else if close < vwapValue then countBarsBelow[1] - 1 else 0; # use the following to scan for consecutive bars above VWAP plot scan = countBarsAbove > 10; # use the following to scan for consecutive bars below VWAP # plot scan = countBarsBelow < -10;``` I cannot provide a solution for question #2 because I do not fully understand what you are requesting. Keep in mind that questions posted in this Q&A Forum are intended to be those which would serve the interests of the vast majority of our viewers. This is not a place to request specific solutions which serve the interests of a single individual. It seems that question #2 probably does not fit within the goals of this forum. Marked as spam Posted by Pete Hahn (Questions: 37, Answers: 4097) Answered on July 9, 2024 3:37 pm