Bollinger Bands and Stochastic Scalping Indicator for ThinkorSwim

BenTen

Administrative
Staff member
Staff
VIP
Lifetime
If you like to trade or scalp on the shorter time frame such as the 2m, 5m, and 15m, this indicator is for you. The Scalper indicator generates buy and sell signals based on the Bollinger Bands, Stochastic Full, RSI, MFI, and IMI (Intraday Momentum Index).

4ZfMTA9.png

ShjgpsP.png


thinkScript Code

Rich (BB code):
# Scalper
# Drew Griffith

#hint: Intraday Day mean reversion strategy. Used on 2min charts.

declare upper;

input price = close;
input BBlength = 12;
input FSOkperiod = 10;
input FSOdperiod = 6;
input FSOslowingperiod = 6;
input FSOob = 80;
input FSOos = 20;
input RSIlength = 12;
input RSIob = 70;
input RSIos = 30;
input MFILength = 12;
input MFIob = 80;
input MFIos = 20;
input IMILength = 12;
input IMIob = 70;
input IMIos = 30;

def BBupper = BollingerBands(length = BBlength).UpperBand;
def BBlower = BollingerBands(length = BBlength).LowerBand;

# StochasticFull
def FSO = StochasticFull("k period" = FSOkperiod, "d period" = FSOdperiod, "slowing_period" = FSOslowingperiod);

def RSI = RSI(length = RSIlength);

def MFI = MoneyFlowIndex(length = MFILength);

def IMI = IntradayMomentumIndex(length = IMILength);

plot bullish = close <= BBlower and RSI <= RSIos and FSO <= FSOos and MFI <= MFIos and IMI <= IMIob;

plot bearish = close >= BBupper and RSI >= RSIob and FSO >= FSOob and MFI >= MFIob and IMI >= IMIos;

#plot RATING = if bullish then 1 else if bearish then .5 else 0;

bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
bullish.AssignValueColor(Color.GREEN);

bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
bearish.AssignValueColor(Color.RED);

Shareable Link

https://tos.mx/AkH2ok
Credit:

Video Tutorial

 
Last edited:

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Ben, I looked arrows on other indicator not TTM_Scalper. But after untick "Show Plot" for RATING able to see the candle NOT arrow.



I have noticed in Indicator Bullish and Bearish tab "color: This plot's colors are dynamically set" I am not sure this is default because usually we see some color!
 
Last edited by a moderator:
@San The indicator don't often give you signals and the arrow's colors are set to default (down = red and up = green). This indicator will work on intra-day only. So from 1m to 15m max.

 
Last edited:
Hello BenTen...first thank you for posting this script. I am having the same issue as San. Everytime i change the symbol, the chart shrinks

 
Last edited:
@jan_angel Please see my reply above regarding the “Show Plot” option for RATING. In addition, you can also left click on the chart and unselect Fit Studies.

 
Last edited:


Thank you! I have noticed if the trigger happens very early in the trading day, it could signal a reverse in the opposite direction for the rest of the trading day.

Also, i noticed if you wait for a double red or green bar in the signal direction, you can better "guesstimate" the reversal long term.

Just early observations. I am trying to find a good baseline / confirmation indicator to help support triggers.
 
Hi Ben I feel like a kid in a candy store with all of these indicators, I'm new to trading and to this site. Anywho I copied and pasted the short link of the scalper into TOS. I tried it in on demand and Scalper gives the green arrows but not the red arrows. I only get the red arrows in pre market. Thanks in advance.
 
@VM23 Welcome, glad you are enjoying the forum. Posters add so much, so often, I feel like a kid in a candy store, every day :) .
Unfortunately, TOS paper trading has some particularities. Which for the most part, have no workarounds. If you want more detail, you will have to call TOS customer support. Please come back and share what they had to say.
 
Last edited:
Hi Ben- thanks for sharing the script with everyone in an open forum. Much appreciated!

Quick question on the code and I've a feeling that I am wrong but let me ask anyways. Was wondering if the last variable IMI should be swapped between the bullish and bearish plots? I meant shouldn't the bullish logic require IMI to be <= IMIos for confirmation while the bearish IMI >=IMIob?

plot bullish = close <= BBlower and RSI <= RSIos and FSO <= FSOos and MFI <= MFIos and IMI <= IMIob;

plot bearish = close >= BBupper and RSI >= RSIob and FSO >= FSOob and MFI >= MFIob and IMI >= IMIos;

Thanks Ben- Bud
 
Hi Ben- thanks for sharing the script with everyone in an open forum. Much appreciated!

Quick question on the code and I've a feeling that I am wrong but let me ask anyways. Was wondering if the last variable IMI should be swapped between the bullish and bearish plots? I meant shouldn't the bullish logic require IMI to be <= IMIos for confirmation while the bearish IMI >=IMIob?

plot bullish = close <= BBlower and RSI <= RSIos and FSO <= FSOos and MFI <= MFIos and IMI <= IMIob;

plot bearish = close >= BBupper and RSI >= RSIob and FSO >= FSOob and MFI >= MFIob and IMI >= IMIos;

Thanks Ben- Bud
Try it. and come back and let us know your conclusions.
 
Hi Ben & other experienced members.... I was wondering if you have a line of code for text or audible alerts when either a red or green arrow is painted. Would be helpful otherwise we have to keep staring at the chart(s). Also, would be nice to enter a conditional entry order on red and/or green arrows. Anyone doing this? If yes, how is it working out? Thanks!
 
Hi Ben & other experienced members.... I was wondering if you have a line of code for text or audible alerts when either a red or green arrow is painted. Would be helpful otherwise we have to keep staring at the chart(s). Also, would be nice to enter a conditional entry order on red and/or green arrows. Anyone doing this? If yes, how is it working out? Thanks!
There are Three Types of Alerts:
There are alerts written into studies. They only alert when the chart w/ the study is open on your screen
They cannot be sent to phone/email. They cannot have custom sounds.
Add these to the bottom of your script:
Code:
Alert(bullish , "bullish ", Alert.Bar, Sound.Chimes);
Alert(bearish , "bearish", Alert.Bar, Sound.Chimes);

There are alerts created on a chart for one specific stock that you want to alert on.
right-click on chart.
click on create alert
cut&paste your script
(can only have one plot so comment out either bullish or bearish by putting a hashtag # in front of the statement)

There are scanned watchlist alerts which alert whenever the results of the scan changes.
These alerts can be 3min delayed. They can have custom sounds, they can be sent to phone/email, if you have notifications turned on in the app setup.
open Scan Hacker
cut&paste your script
(can only have one plot so comment out either bullish or bearish by putting a hashtag # in front of the statement)
click on the menu icon above the results and click on alerts


To create a conditonal order, follow the instructions for alerts created on a chart . Conditional Orders use the same widget as chart alerts.
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
383 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

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.

How do I get started?

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.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top