Bollinger Band Alert Thinkorswim


0
0

Hello,

I’m trying to set up alerts in Thinkorswim when a 30 minute candle CLOSES either at or above the upper weighted bollinger band or at or below the lower weighted bollinger band. The scripts that I keep trying to use are giving me several false signals while the current candle is still active. I’m looking for just getting the alert when the 30 min candle officially closes and is either above or below the corresponding bollinger band. Any ideas how I can fix this?

Here’s the ThinkScript I am using currently. I’m new to this, so I made it in the condition wizard:

close(“period” = AggregationPeriod.THIRTY_MIN, “priceType” = PriceType.LAST) is greater than or equal to reference BollingerBands(“average type” = “WEIGHTED”).”UpperBand”

Marked as spam
Posted by (Questions: 1, Answers: 1)
Asked on March 6, 2018 8:33 pm
2614 views
0
Private answer

Go Packers! Thanks for providing your code. That helps me understand where are you at. Your solution if very close. Only two items are out of place. You are setting the time frame in the wrong location. The other mistake is that you are not offsetting the condition by one bar. To understand how to configure this for you, I merely reviewed our video titled: Thinkorswim AutoTrade Almost.

Your code should look like this:

close from 1 bars ago crosses above BollingerBands("average type" = "WEIGHTED")."UpperBand" from 1 bars ago

Notice there is no reference to a time frame. That is because the time frame is set at a higher level. I have attached two screenshots to clarify this. The first screenshot shows how the condition is setup. Notice the “Offset:” property is set to +1 for each side. This is what tells the code to look at the previous bar for the signal and not the current bar.

The second screenshot shows how to set the condition to the 30 min time frame.

Attachments:
Marked as spam
Posted by (Questions: 37, Answers: 4087)
Answered on March 6, 2018 9:52 pm
0
Private answer

Fantastic. I just tested this today and it worked for me. I really appreciate the help. I’m wondering if you could help me take this one step further. I watched your video titled Thinkorswim Autotrade Almost and saw in there that you were able to code an alert for bollinger bands AND rsi. I’d like to use that same concept, but with bollinger bands and the Hull MA. Here’s what I’m looking to accomplish:

Send an alert when the close of a 30min candle crosses above the upper bollinger band AND the 125 period Hull MA is trending lower. I will then look to set up another alert when the close crosses below the lower band AND the 125 period Hull MA is trending higher. I hope that makes sense.

The question I have is how do I put in the condition wizard for the Hull MA part of this system? Thanks again!

Marked as spam
Posted by (Questions: 1, Answers: 1)
Answered on March 8, 2018 3:09 pm
0

When responding, please use the comment section of the previous answer rather than entering a new answer. (like this one) That keeps things orderly, because people are able to vote on answers and this can cause them to display out of order. Comments will always stay in order with the answer to which they are applied. 

( at March 8, 2018 6:51 pm)
0
Private answer

In response to additional question asked by Disher on March 8th, 2018.

Attached screenshot shows how to setup the condition for the Hull moving average in decline.

Also included is the code that is generated:

HullMovingAvg("length" = 125) is less than HullMovingAvg("length" = 125) from 1 bars ago

Attachments:
Marked as spam
Posted by (Questions: 37, Answers: 4087)
Answered on March 8, 2018 6:54 pm