VWAP Volume Breakout Indicator for ThinkorSwim

P

paca26

New member
Ah I can see the scan results after setting "within 500" bars instead of 1. I guess since it's after hours now, setting to 500 looked back at bars 2500 mins ago.
Let me try the scan tomorrow morning during trading hours!
 
P

paca26

New member
@BenTen the backtest results for this strategy have been great for me. I wanted to setup a conditional "buy" order based on these indicators so that TOS automatically buys and sell when the alerts fires.
I was able to click on the gear icon on a draft order and setup conditions but I could not figure out how to sell/exit automatically? Do you have any insights there?

I actually want to setup an OCO bracket order which buys when bull indicator is true. The "take profit" order should be EntryPrice() + 3%. Stop loss should either be when bear indicator is true or EntryPrice() - 6%.
Do you know if such an OCO order can be placed automatically on the study?

Appreciate your help!
 
G

godfreym

New member
I still cannot get the alerts to go off. The indicator is out there. I have a couple watchlists. Any idea why i would not alert on the arrows from a particular watchlist? This such a useful tool but you have to be on a stock to see the arrow. I would love if someone could show me how to set up the alert on a watchlist to sound off when a bull/bear arrow is placed on the chart. Anyone?
 
BenTen

BenTen

Administrative
Staff
VIP
@godfreym No, this type of alerts will only work if you're currently looking at the chart.

If you want to get alerted for multiple stocks, you need to create a scanner > save the watchlist as a scanner > select the option "Alerts when scan results change..."

 
G

godfreym

New member
Yea I did just duplicate an existing WL.
Wouldn't that alert then give me a notification on everything?
I can give it a shot

@BenTen What do you think are the best charts to use this one with? 1 day 15 minute, 20 day 1 hr, etc?
 
BenTen

BenTen

Administrative
Staff
VIP
@godfreym I don't use this in my trading. You should go through each timeframe and see which one works best for you.
 
UsDollarClub

UsDollarClub

New member
Hi, can someone help with a custom indicator and use it on scanner for the following conditions.

1. Alert when stock bounces off vwap and the first candlestick is closed above vwap

2. Alert when stock bounces off vwap and the first candlestick is closed below vwap

3. Alert when stock crosses vwap and the first candlestick is closed above vwap

4. Alert when stock crosses vwap and the first candlestick is closed below vwap

* All these only should be sent as alert when Volume Avg (10) is experiencing at least 25%

* To the end of each indicator, I need Fibonacci EXTENSION auto plotted so I know target take profits.

- The Fibonacci extension values are the 100%, 138.2% ,161.8% and 261.8%
 
rad14733

rad14733

Well-known member
VIP
@UsDollarClub How do you suggest calculating "bounces off VWAP"...??? Kinda tough to code getting close and then reversing... Sounds like you want a lot of custom coding... Have you tried to do any of that yourself...??? We're willing to help those willing to help themselves but as a rule don't just write entire studies upon request... We all have our own coding to do...
 
UsDollarClub

UsDollarClub

New member
I am not a coder myself, what is possible for you on the request? let me know
 
BenTen

BenTen

Administrative
Staff
VIP
@UsDollarClub A lot of the requests you posted can be done by using the condition wizard in ThinkorSwim. No coding experience needed.

Example: Alert when stock crosses vwap and the first candlestick is closed above vwap

 
G

GreaseMonkey

New member
Hi, I am new here and trying to learn. I am trying to make a script to add a label on a chart only when a candle body is straddling the daily VWAP.
Here is what I have so far. I think it is using the VWAP of the current candle. I need it to use the daily VWAP but cant figure it out. If anyone can help me out I would greatly appreciate it.

# current candle straddling Daily VWAP

def cross = (high > vwap and low < vwap);

AddLabel
(yes, ".........................VWAP ALERT.............................."
+ if cross then "" else "0",
if cross then CreateColor(135, 135, 255) else CreateColor(32, 32, 32));
 
BenTen

BenTen

Administrative
Staff
VIP
VWAP does not change when you switch between different timeframes. It does not behave like an SMA or EMA. Just want to get that out of the way.

Now...are you trying to highlight any candle that crosses either above or below the VWAP line? Is that what you're trying to achieve?
 
G

GreaseMonkey

New member
What I want is to have a label pop up at the top of the chart when a candle is straddling / engulfing the VWAP value. The code I came up with in my opening post does put the label up on top of the chart but that's all it does so far. I can play with the "def cross = (high > vwap and low < vwap);" and get the label to show or not but that's all I have so far. It is displayed all the time it does not toggle on and off when a candle is straddling or not.
 
Last edited:
BenTen

BenTen

Administrative
Staff
VIP
@GreaseMonkey Can you provide some screenshots of the candle "straddling" the VWAP?
 
G

GreaseMonkey

New member
Simply when a candle builds and it's high goes above the VWAP line and it's low goes below the VWAP line the code should put the label on the chart. If the next candle builds and is completely above or below the VWAP the label will not be put on the chart.




OK the line in the middle of the chart is the VWAP. If the candle high is above it and the low is below it it should put that purple VWAP Alert label on the chart. Currently the label is there most of the time. Once in a while it will go away then come rite back.
 
Last edited:
R

RichSprinkles

New member
@BenTen

First of all, love the indicator and have been using it for a while now. Thanks very much for it. I have a question on it as to why it triggers sometimes but not others? See example below. It's pretty common for it to not trigger when conditions have been met and I'm just wondering if you know why and if that could potentially be fixed. The only adjustment I've made to your code in my application is changing the arrow from cyan to orange and adding the alerts.
 
BenTen

BenTen

Administrative
Staff
VIP
@RichSprinkles Please use imgur.com to post your screenshot. I don't see any from your message.
 
R

RichSprinkles

New member
@BenTen

Odd, it disappeared... Hopefully it shows now. Thanks!

 
BenTen

BenTen

Administrative
Staff
VIP
@RichSprinkles Thank you. I'll look into it. Do you have any other example of this sort of case where the signal isn't there when it should?
 
R

RichSprinkles

New member
@BenTen I could throw examples at you all day, it's a pretty common occurrence. I can post some more if you like but if you just take a random chart you should it notice it too. I even see a few examples/close ones on your example charts where you posted the code.

In general, choosing the right ticker and building a strategy around the indicator works well. And I've known it doesn't trigger all the time and I thought that was built in somehow. But after using it for a few months and getting better at understanding thinkscript, I went into the code and think it's really just VWAP:VolumeAvg cross signals with no "extra" descriptors to rule out crosses with acceptable volume trigger. So I just wanted to ask you if you knew what was going on with it.
 

Similar threads

Top