does TOS have a ticker showing % of stocks within SP500 or nasdaq 100 above vwap?
or is it possible to make such an indicator?
I am not aware of a ticker, but you could try scans for those. Here is an example of SP500 above VWAP
does TOS have a ticker showing % of stocks within SP500 or nasdaq 100 above vwap?
or is it possible to make such an indicator?
def VWAPW = reference VWAP("time frame" = "WEEK");I am attempting to set up a watchlist column that would visually show if the stock has stacked VWAPs (Weekly VWAP greater or equal to Monthly VWAP). For some reason, all I am getting is a "loading". Any input would help!
Here is what I have so far:
plot VWAPW = VWAP(period = AggregationPeriod.WEEK);
plot VWAPM = VWAP(period = AggregationPeriod.MONTH);
def bullish = VWAPW is greater than or equal to VWAPM;
def bearish = VWAPW is less than VWAPM;
AddLabel(bullish, “Bullish VWAP⇧”, color.black);
AddLabel(bearish, “Bearish VWAP⇩”, color.black);
AddLabel(!bullish and !bearish, " ", color.black);
AssignBackgroundColor (if bullish then color.green else if bearish then color.red else color.black);
Moved your question here. In this thread, you will find 18 pages of VWAP crosses: scans, watchlists, labels, with many formatting options.How to create a scan query and watchlist for 9EMA crossing over VWAP? Please help.
Hello Nads, I was looking for this also. Not sure how to do this from reading above posts. Were you able to make the complete code?Thank you, I do have this on my chart and it works great, but I want to know if there was a way to be
notified/alert when the VWAP crossover the 9EMA
Hello Nads, I was looking for this also. Not sure how to do this from reading above posts. Were you able to make the complete code?
For VWAP I am using this & is Anchored to beginning of the trading day. Looking for Alert, when 9 EMA Crosses VWAP.
#yakBro intraday anchoredVWAP excluding extended hours volume 2019
declare hide_on_daily;
def anchorTime = 0930;
def anchorEnd = 1700;
input ShowTodayOnly = yes;
def Today = if GetDay() == GetLastDay() then 1 else 0;
def postAnchorTime = if SecondsFromTime(anchorTime) >= 0 then 1 else 0;
def endAchorTime = if SecondsTillTime(anchorEnd) >= 0 then 1 else 0;
#plot anchorVWAP for intraday
def volumeSum = compoundValue(1, if postAnchorTime and endAchorTime then volumeSum[1] + volume else 0, volume);
def volumeVwapSum = compoundValue(1, if postAnchorTime and endAchorTime then volumeVwapSum[1] + volume * vwap else 0, volume * vwap);
plot anchorVWAP = if ShowTodayOnly and !Today then Double.NaN else if anchorTime then volumeVwapSum / volumeSum else Double.NaN;
anchorVWAP.setStyle(Curve.Firm);
anchorVWAP.setDefaultColor(Color.light_ORANGE);
anchorVWAP.setlineWeight(2);
Ruby:#yakBro intraday anchoredVWAP excluding extended hours volume 2019 declare hide_on_daily; def anchorTime = 0930; def anchorEnd = 1700; input ShowTodayOnly = yes; def Today = if GetDay() == GetLastDay() then 1 else 0; def postAnchorTime = if SecondsFromTime(anchorTime) >= 0 then 1 else 0; def endAchorTime = if SecondsTillTime(anchorEnd) >= 0 then 1 else 0; #plot anchorVWAP for intraday def volumeSum = compoundValue(1, if postAnchorTime and endAchorTime then volumeSum[1] + volume else 0, volume); def volumeVwapSum = compoundValue(1, if postAnchorTime and endAchorTime then volumeVwapSum[1] + volume * vwap else 0, volume * vwap); plot anchorVWAP = if ShowTodayOnly and !Today then Double.NaN else if anchorTime then volumeVwapSum / volumeSum else Double.NaN; anchorVWAP.setStyle(Curve.Firm); anchorVWAP.setDefaultColor(Color.light_ORANGE); anchorVWAP.setlineWeight(2); plot ema9 = expaverage(close, 9); def cross = vwap crosses ema9; alert(cross, if vwap crosses above ema9 then "OVER" else "UNDER", alert.bar, sound.Ding);
@SleepyZ, Thank YouThis uses the code you posted and portions of the snippets posted above to create the alert.
In the image is the alerts showing in the message center.
A sound alert also was made each of the times shown in the message center.
what did you change the 9 EMA in the code to be pls?@BenTen Like a charm. Thank you sir!
what did you change the 9 EMA in the code to be pls?
# EMA crossing above Upper VWAP Band Watchlist Column
input lengthMA = 9;
Are you looking for a bullish crossover? If so, I think maybe what you're asking for is when VWAP crosses above the 5EMA. If so, this is what I came up with. If this is not what you meant, let me know.@BenTen @horserider any chance you can do me a quick indicator that posts signal arrows on the chart when the 5EMA crosses VWAP? Couldn't find anything like it. Thanks in advance!
def bullish = reference VWAP()."VWAP" crosses above MovAvgExponential("length" = 5)."AvgExp";
plot upArrow = bullish;
upArrow.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
upArrow.SetDefaultColor(CreateColor(145, 210, 144));
The following will limit the plot of arrows when yes to the number of x arrows:In regards to this script I posted, is there any way to modify it so it will only display an arrow for the most recent crossover? Or possibly within a certain number of bars (for example, only display an arrow if it occurs within the last 5 bars)? I messed around with some basic things I thought might work, but couldn't figure it out.
Code:#Example_cond_limit_plot input limit_arrow_plot = yes; input show_x_arrows = 1; input show_within_bars = 1; def bullish = reference VWAP()."VWAP" crosses above MovAvgExponential("length" = 5)."AvgExp" within show_within_bars bars; def dataCount = CompoundValue(1, if IsNaN(dataCount[1]) then 0 else if bullish then dataCount[1] + 1 else dataCount[1], 0); plot upArrow = if limit_arrow_plot and HighestAll(dataCount) - dataCount <= show_x_arrows - 1 then bullish else if !limit_arrow_plot then bullish else Double.NaN; upArrow.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP); upArrow.SetDefaultColor(CreateColor(145, 210, 144)); upArrow.SetLineWeight(4); ;
Thank you! Works perfectly. I was able to apply this to a few other studies and it cleaned things up nicelyThe following will limit the plot of arrows when yes to the number of x arrows:
input limit_arrow_plot = yes;
input show_x_arrows = 1;
The following set to 1 will plot the arrow on the cross. If set higher it will move the arrow to the right from the cross by that increase:
input show_within_bars = 1;
def vwap = reference vwap("time frame" = "DAY","num dev dn" = -1,"num dev up" = 1);
def upperband = reference vwap("time frame" = "DAY","num dev dn" = -1,"num dev up" = 1).UpperBand;
def lowerband = reference vwap("time frame" = "DAY","num dev dn" = -1,"num dev up" = 1).LowerBand;
AddLabel(1, vwap, Color.WHITE);
AssignBackgroundColor(if close >vwap and close < upperband then Color.GREEN else if close >vwap and close > upperband then Color.DARK_GREEN else if close < vwap and close > lowerband then Color.RED else if close < vwap and close < lowerband then Color.DARK_RED else Color.BLACK);
good day @sleepZ,
i used your script
https://usethinkscript.com/threads/...r-pocs-for-thinkorswim.8153/page-6#post-72446
to do the same thing for vwap but it looks like it doesn't work properly
here is the code i hope you can guide me to fix it
Code:def vwap = reference vwap("time frame" = "DAY","num dev dn" = -1,"num dev up" = 1); def upperband = reference vwap("time frame" = "DAY","num dev dn" = -1,"num dev up" = 1).UpperBand; def lowerband = reference vwap("time frame" = "DAY","num dev dn" = -1,"num dev up" = 1).LowerBand; AddLabel(1, vwap, Color.WHITE); AssignBackgroundColor(if close >vwap and close < upperband then Color.GREEN else if close >vwap and close > upperband then Color.DARK_GREEN else if close < vwap and close > lowerband then Color.RED else if close < vwap and close < lowerband then Color.DARK_RED else Color.BLACK);
the calculations are correct im having problems with the coloring its always dark green or red and not the tow other optionsWhat problem are you having? It is a watchlist and looks okay on my testing your code.
the calculations are correct im having problems with the coloring its always dark green or red and not the tow other options
You didn't provide enough information to say where you went astray.@BenTen I copied the orignal link today and noticed the vwap values in the watchlist were not even close to accurate. It's such a simple script that I can't find any reason for it. I tried it with ext hours both on and off. Any suggestions?
Join useThinkScript to post your question to a community of 21,000+ developers and traders.
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
RSI (or MACD) with VWAP & MA & div for ThinkOrSwim | Indicators | 11 | ||
J | High/Low Anchored VWAP For ThinkOrSwim | Indicators | 16 | |
Opening Range Indicator with Measured Moves and VWAP For ThinkOrSwim | Indicators | 43 | ||
RSI-VWAP Indicator for ThinkorSwim | Indicators | 68 | ||
Squeeze Clouds based on SMA and VWAP | Indicators | 7 |
Start a new thread and receive assistance from our community.
useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.
We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.
If you are new, or just looking for guidance, here are some helpful links to get you started.