Best Swing Trading Indicators for ThinkorSwim

Montana101x

New member
I am new here and a ThinkorSwim user. My goal is to become a Pro Swing Trader particularly on mid or small good Caps. I found quite few indicators on site while researching but they are customized for other platforms. I know but take it easy on me and I am on process of learning and growing.

I found so many awesome indicators but only have their images. There’s one indicator and I hope someone can code this it would be awesome. It’s MACD with SMA and works awesome for swing trading... find attached blew and let help each other....

What's the best way to scan stocks for swing trading that are close to hitting their bottom?

vJAkCIf.png


Here is the CODE and hope everyone enjoys, modify it and improve and make it share it here with us.

4ZoEA9h.png


Rich (BB code):
declare lower;

input length = 9;
input colorNormLength = 14;
input price = close;
input signalLength = 3;

def tr = ExpAverage(ExpAverage(ExpAverage(Log(price), length), length), length);

plot TRIX = (tr - tr[1]) * 10000;
plot Signal = ExpAverage(TRIX, signalLength);
plot ZeroLine = 0;

def normVal = FastKCustom(AbsValue(TRIX), colorNormLength);

TRIX.SetDefaultColor(GetColor(8));
TRIX.AssignValueColor(CreateColor(255, (240 - (100 - (if TRIX > 0 then normVal else (-normVal))) * 175 / 200), 0));
ZeroLine.SetDefaultColor(GetColor(5));
Signal.setDefaultColor(GetColor(3));
TRIX.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
 
Last edited:

Darknight11

New member
VIP
I am developing a swing trading strategy that puts together 3 studies. TTM Trend, Parabolic SAR, and Mobius's Trend Pivots. For a buy entry: Pretty much I wait for the price to go into the green pivot line area (I will call it the area of support) and then I wait for a bounce back off of it. The bounce back has to be a blue hollow candle that is shown by the TTM Trend and the Parabolic SAR has to have switched from bearish (over the bar) to bullish (under the bar) I am looking to scan something along those lines. would anyone be able to help me code this scanner? I pretty much have no idea how to code this type of stuff on thinkscript.
 

purehess1

New member
that's a loaded question for sure...im still very new and find a new strategy every week. The key is to find one that fits you. Look these ones up on this site: supertrend, plus the scanner or ttm squeeze set up for 1 to four hours
 

rad14733

Well-known member
VIP
The TRIX indicator is actually a common Triple Exponential indicator and is, in fact, included in TOS's standard study library... The first 15 lines of the code posted above is verbatim code from the TOS indicator, with the remaining lines being modified for plotting purposes, plus the addition of the Histogram by someone on the site linked above by request...
 

murkr

Member
VIP
I really love TA and indicators but can only dedicate 1 hour a day to trading and going over charts. For that reason, I like to trade on the daily 1D chart. If you also trade the 1D, what indicators would you recommend? Right now I'm using Supertrend, DMI, and BlackFlag indicator on the 1D. I hear a lot of good things about trading options at the 45DTE mark but right now I'm just trading /MES on 1D chart.
 

Let the Bulls Run

New member
VIP
There's a lot of bright minds in this forum along with the willingness to help others. I have a question for you experienced swing traders. I'm wanting to know what you're using for a swing trading strategy, primarily trading off the daily chart. I'm not referring to a stock scanner or a watch list. Let's say you already have a handful of blue chip tech stocks, example - AAPL, BABA, GOOG, NVDA, TSLA, MSFT, and we could even throw in SPY & QQQ. The main objective of this strategy would to obviously be holding these stocks when the market is good, and be out of them when the market is in a downtrend. To get this conversation started, I've posted a daily chart below of the NASDAQ 100 showing a strategy. The strategy is fairly simple; when the RSI is >50 you want to be in, when the RSI is <50 you want to be out. Does anyone have a more optimized strategy? If, so, please post a chart image and or a shareable chart link or source code. Thanks in advance.

jttAO00.jpg
 
Last edited:
Thanks for sharing this one. @BenTen Do you have a Scan Link that you can share for stocks meeting this criteria (greater than .2 on the RSI Laguerre Study) ? I tried adding in that as a custom study filter but I am getting zero results. I suspect it is due to I have crosses above 0.2 and the input gamma 0.8. See image below.

zGfnXlN.png
 

samoya

Active member
VIP
I am new to the forum and I its really amazing what incredible work people in the group are sharing. Its mind blowing.

Let me share a simple but effective strategy I am using for a while.

I saw the strategy some years ago, but I don't know where.

I attached a picture, so its it easier to follow.

I use Q Stick, which is a momentum indicator and rarely used but effective with a SMA9 on a Daily chart.

And I use Heikin Aski candles together with a MACD and Heikin Ashi Diff indicator on a 78m chart.

http://tos.mx/hnrfGMM
http://tos.mx/lxai79q

I use a Daily chart and a 78m chart. Why 78m? Because there are 6,5 trading hours or 390 minutes. 390/78 = 5 bars

Long:
Q Stick crosses above Zero line on Daily chart (left)
Close must be > SMA9 on Daily chart (left)
Heikin Ashi Diff > 0 on 78m chart (right)
MACD > 0 on 78m chart (right)

Target and SL: I use ATR as my target and SL (1:3), but maybe the community has some other ideas.
I tried to implement the QQE and stay in the trade as long as both lines are positiv (for long trades) or negative (for short trades).

I think its easy to follow and the charts are clean with clear entry and exit points.
I like clear entry and exit rules, so there is no guessing.

I would like to ask the community what is their opinion and how can we improve that simple strategy.
Thank you.

DGF6jha.png
 

Tradervic

Member
VIP
I am new to the forum and I its really amazing what incredible work people in the group are sharing. Its mind blowing.

Let me share a simple but effective strategy I am using for a while.

I saw the strategy some years ago, but I don't know where.

I attached a picture, so its it easier to follow.

I use Q Stick, which is a momentum indicator and rarely used but effective with a SMA9 on a Daily chart.

And I use Heikin Aski candles together with a MACD and Heikin Ashi Diff indicator on a 78m chart.

http://tos.mx/hnrfGMM
http://tos.mx/lxai79q

I use a Daily chart and a 78m chart. Why 78m? Because there are 6,5 trading hours or 390 minutes. 390/78 = 5 bars

Long:
Q Stick crosses above Zero line on Daily chart (left)
Close must be > SMA9 on Daily chart (left)
Heikin Ashi Diff > 0 on 78m chart (right)
MACD > 0 on 78m chart (right)

Target and SL: I use ATR as my target and SL (1:3), but maybe the community has some other ideas.
I tried to implement the QQE and stay in the trade as long as both lines are positiv (for long trades) or negative (for short trades).

I think its easy to follow and the charts are clean with clear entry and exit points.
I like clear entry and exit rules, so there is no guessing.

I would like to ask the community what is their opinion and how can we improve that simple strategy.
Thank you.

DGF6jha.png
so this is just a long only strategy?
 

Kaz

New member
I have search and watched a lot of youtube video and this was the best strategy i found. This code help indicates when to buy and sell a position whenever the two simple moving average(9,20) crosses. Is there a better way to increase P/L for swing trades?

Code:
#MovingAverage crosses buy and exit points

input shortMAlength = 9;
input longMAlength = 20;

def shortMA = simpleMovingAvg(Length = shortMAlength);
def longMA = SimpleMovingAvg(Length = longMAlength);

def buy = shortMA[1] < longMA[1]and shortMA > longMA;
def sell = shortMA < longMA;

addOrder(OrderType.BUY_TO_OPEN, buy, name = "CrossoverBuy", tickColor = Color.GRAY, arrowColor = Color.GRAY);
addOrder(OrderType.SELL_TO_CLOSE, sell, name = "CrossoverExit", tickColor = Color.GREEN, arrowColor = Color.GREEN);
 

MerryDay

Well-known member
VIP
@Kaz Moving Averages is probably one of the most popular strategies used by retail investors. However, it is important to understand some of the weaknesses of moving averages. As traders gain experience, there is a tendency to use another trigger for their strategy and moving averages to confirm trend.

Lastly it is important to understand the limits of technical indicators. All strategies should take these limits into consideration.
v8xSpsl.png

Reviewing ALL the links in the post: Basic Elements For A Good Strategy will help round out a strategy for you.
 
Last edited:

Kaz

New member
Thanks for the quick reply @MerryDay . I look to combine the RSI and MACD to this strategy but always have trouble generating the code. Can someone help me create a scanner that will find stocks that has all of these factors(rsi low, macd, crossover, and candle closes above ema9) on a daily? if all factors are true on the daily chart then look to enter and exit trades on a hourly time frame.
 
Last edited:

Trader2021

New member
VIP
This indicator was designed to trade the S&P 500 (SPY) on a weekly chart. Developer Waylock created it and AlphaInvestor added weekly aggregation.

I modified the script a bit so that you can use it to day trade and swing trade $SPY on the lower timeframe.

From backtesting, the buy and sell signals worked really well. You may want to take a second look and see if this is something that may fit your trading style. I also added alerts in the code so that ThinkorSwim will let you know when there is a new bullish or bearish signal.

kbCFwQt.png

b5reLvA.png

wPI1xTz.png


Day Trading Version

Code:
# Original name: Big_Hand_Arrows_On_Study_w_Agg

# Script by Waylock

# AlphaInvestor - 05/12/2017 - force to weekly aggregation

# Modified by BenTen to work on lower timeframe. Alerts added.

declare lower;

input agg = AggregationPeriod.FIFTEEN_MIN;

input fastLength = 19;

input slowLength = 39;

def c = close(period = agg);

plot Value = ExpAverage(c, fastLength) - ExpAverage(c, slowLength);

def Value_color = if Value > 0 then yes else no;

Value.DefineColor( "ValueUp", Color.GREEN );

Value.DefineColor( "ValueDn", Color.RED );

Value.AssignValueColor( if Value_color then Value.Color( "ValueUp" ) else Value.Color( "ValueDn" ) );

plot ZeroLine = 0;

Value.SetDefaultColor(Color.CYAN);

ZeroLine.SetDefaultColor(Color.YELLOW);

ZeroLine.HideTitle();

ZeroLine.HideBubble();

def xUndr = Value[1] < 0 and Value > 0;

def xOver = Value[1] > 0 and Value < 0;

plot ArrowUp = if xUndr then xOver else Double.NaN;

ArrowUp.SetPaintingStrategy(PaintingStrategy.ARROW_UP);

ArrowUp.SetDefaultColor(Color.YELLOW);

ArrowUp.SetLineWeight(5);

ArrowUp.HideTitle();

ArrowUp.HideBubble();

plot ArrowDn = if xOver then xUndr else Double.NaN;

ArrowDn.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);

ArrowDn.SetDefaultColor(Color.YELLOW);

ArrowDn.SetLineWeight(5);

ArrowDn.HideTitle();

ArrowDn.HideBubble();

def data = Value;

# Alerts
Alert(ArrowUp, " ", Alert.Bar, Sound.Chimes);
Alert(ArrowDn, " ", Alert.Bar, Sound.Bell);

# End Study

Shareable Link: https://tos.mx/wJd6hZ

Swing Trading Version

oZs7YnY.png


Code:
# Original name: Big_Hand_Arrows_On_Study_w_Agg

# Script by Waylock

# AlphaInvestor - 05/12/2017 - force to weekly aggregation

# Modified by BenTen to work on lower timeframe. Alerts added.

declare lower;

input agg = AggregationPeriod.HOUR;

input fastLength = 19;

input slowLength = 39;

def c = close(period = agg);

plot Value = ExpAverage(c, fastLength) - ExpAverage(c, slowLength);

def Value_color = if Value > 0 then yes else no;

Value.DefineColor( "ValueUp", Color.GREEN );

Value.DefineColor( "ValueDn", Color.RED );

Value.AssignValueColor( if Value_color then Value.Color( "ValueUp" ) else Value.Color( "ValueDn" ) );

plot ZeroLine = 0;

Value.SetDefaultColor(Color.CYAN);

ZeroLine.SetDefaultColor(Color.YELLOW);

ZeroLine.HideTitle();

ZeroLine.HideBubble();

def xUndr = Value[1] < 0 and Value > 0;

def xOver = Value[1] > 0 and Value < 0;

plot ArrowUp = if xUndr then xOver else Double.NaN;

ArrowUp.SetPaintingStrategy(PaintingStrategy.ARROW_UP);

ArrowUp.SetDefaultColor(Color.YELLOW);

ArrowUp.SetLineWeight(5);

ArrowUp.HideTitle();

ArrowUp.HideBubble();

plot ArrowDn = if xOver then xUndr else Double.NaN;

ArrowDn.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);

ArrowDn.SetDefaultColor(Color.YELLOW);

ArrowDn.SetLineWeight(5);

ArrowDn.HideTitle();

ArrowDn.HideBubble();

def data = Value;

# Alerts
Alert(ArrowUp, " ", Alert.Bar, Sound.Chimes);
Alert(ArrowDn, " ", Alert.Bar, Sound.Bell);

# End Study

Shareable Link: https://tos.mx/VevVxf
Hi Ben, I am planning to test the Day trade and swing trade version of this SPY strategy.
For Swing Trade version do we have to use only Hourly charts or can we use this for 4hr or Daily charts ?
If yes, what should we change to use it for 4hr or Daily ?
 

Similar threads

Top