Repaints Best Swing Trading Indicators for ThinkorSwim

Repaints
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.
 

New Indicator: Buy the Dip

Check out our Buy the Dip indicator and see how it can help you find profitable swing trading ideas. Scanner, watchlist columns, and add-ons are included.

Download the indicator

@murkr Mark (@markos) recently shared his Algo study w/ Laguerre Polynomials

Green=going up! Buy >.2 w Upwards arrowSMA/Sell <.8

Link to study http://tos.mx/Mf9yucF

oT4qI2M.png
 
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
 
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
 
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);
 
@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:
Hi Ben, I have been testing this swing trade version of SPY Strategy above. It is working out really good so far even for stocks other than SPY, Great work !!!. I would really Appreciate if you can please help us to get scan code. I am not still good at coding. tried to code , but did not even get close. Can you please help with scanner ? The reason being i would like to use this as a general scanner for all stocks rather than just SPY.
 
Last edited:
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
@BenTen can you please help me make this swing trading code work for Day timeframe please
 
Code:
#  Exponential Moving Average Crossing
#  EMA Lenght is automatically adjusted depending on the Aggregation Period
#  06/2021 By Bezna$
#  https://tos.mx/A5BNtUi
#  Use in 5 min, 15 min, 1 hour and Daily charts

input ShowLabel = Yes;
input Show_Bubbles = yes;

def price = close; def Agg = GetAggregationPeriod(); def L1; def L2;

if Agg == 300000 {L1 = 9; L2 = 86;} #5 min
else if Agg == 900000 {L1 = 9; L2 = 39;} # 15 min
else if Agg == 3600000 {L1 = 8; L2 = 120;} #1 hour
else if Agg == 86400000 {L1 = 4; L2 = 32;} #1 day
else {L1 = 10; L2 = 30;} #Everything else

plot Bull_Line = ExpAverage(data = price, length = L1);
Bull_Line.SetDefaultColor(GetColor(6));
Bull_Line.SetLineWeight(1);

plot Bear_Line = ExpAverage(data = price, length = L2);
Bear_Line.SetDefaultColor(GetColor(5));
Bear_Line.SetLineWeight(1);

AddCloud(Bull_Line, Bear_Line, Color.dark_green, Color.DARK_RED);

def Bullish = Bull_Line > Bear_Line;
def Bearish = Bear_Line >= Bull_Line;

AddLabel(ShowLabel, if Bullish then " Bullish Trend " else " Bearish Trend ",
if Bullish then Color.GREEN else Color.RED);

plot Buy = Bull_Line crosses above Bear_Line;
Buy.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
Buy.SetDefaultColor(GetColor(1));
Buy.SetLineWeight(4);

plot Sell = Bear_Line crosses above Bull_Line;
Sell.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
Sell.SetDefaultColor(GetColor(1));
Sell.SetLineWeight(4);

Alert(Sell or Buy , if Buy then Concat(" Buy Signal: " , close)
else Concat(" Sell Signal: ", close), Alert.BAR, Sound.Ding);

AddChartBubble( Show_Bubbles and (Buy or Sell), close, Concat( "$", Round(close, 2 )),
if Buy then Color.GREEN else Color.RED, yes);
 
I wanted to share an indicator I've been toying with for quite some time. It uses the TrendQuality indicator built into TOS as its base. It's currently optimized for the 1 hour chart using aggregation periods 1 hour and 3 days - I use it for swing trading. 1 = LONG, 0 = HOLD, -1 = SHORT.

Code:
#########
# SETUP #
#########

declare lower;

input fastLength = 7;
input slowLength = 15;
input trendLength = 4;
input noiseLength = 250;
input correctionFactor = 2;

assert(trendLength > 0, "'trend length' must be positive: " + trendLength);
assert(correctionFactor > 0, "'correction factor' must be positive: " + correctionFactor);

def smf = 2 / (1 + trendLength);

########
# LOGIC #
########

def reversal = sign(ExpAverage(close(period = AggregationPeriod.HOUR), fastLength) - ExpAverage(close(period = AggregationPeriod.HOUR), slowLength));

def cpc = if isNaN(reversal[1]) then 0 else if reversal[1] != reversal then 0 else cpc[1] + close(period = AggregationPeriod.THREE_DAYS) - close(period = AggregationPeriod.THREE_DAYS)[1];

def trend = if isNaN(reversal[1]) then 0 else if reversal[1] != reversal then 0 else trend[1] * (1 - smf) + cpc * smf;

def noise;
def diff = AbsValue(cpc - trend);

noise = correctionFactor * Average(diff, noiseLength);

def TQ = if noise == 0 then 0 else trend / noise;

########
# TRADE #
########

plot swing = if TQ > 0 then 1 else if TQ < 0 then -1 else 0;

swing.AssignValueColor( if TQ > 0 then Color.GREEN else if TQ < 0 then Color.RED else Color.Yellow);
Actually really dig this, made some tweaks;
Code:
#########
# SETUP #
#########

declare lower;
input fastLength = 7;
input slowLength = 15;
input trendLength = 4;
input noiseLength = 250;
input correctionFactor = 2;
input TIME = AggregationPeriod.HOUR;
input TIME2 = AggregationPeriod.THREE_DAYS;

assert(trendLength > 0, "'trend length' must be positive: " + trendLength);
assert(correctionFactor > 0, "'correction factor' must be positive: " + correctionFactor);

def smf = 2 / (1 + trendLength);

########
# LOGIC #
########

def reversal = sign(ExpAverage(close(period = TIME), fastLength) - ExpAverage(close(period = TIME), slowLength));

def cpc = if isNaN(reversal[1]) then 0 else if reversal[1] != reversal then 0 else cpc[1] + close(period = TIME2) - close(period = TIME2)[1];

def trend = if isNaN(reversal[1]) then 0 else if reversal[1] != reversal then 0 else trend[1] * (1 - smf) + cpc * smf;

def noise;
def diff = AbsValue(cpc - trend);

noise = correctionFactor * Average(diff, noiseLength);

def TQ = if noise == 0 then 0 else trend / noise;

########
# TRADE #
########

plot swing = if TQ > 0 then 1 else if TQ < 0 then -1 else 0;
swing.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);

swing.AssignValueColor( if TQ > 0 then Color.GREEN else if TQ < 0 then Color.RED else Color.Yellow);

###PAINT###

input PaintBars = Yes;
AssignPriceColor (if !PaintBars then Color.CURRENT else if TQ > 0 then Color.GREEN else if  TQ < 0 then Color.RED else Color.gray);
 
Actually really dig this, made some tweaks;
Code:
#########
# SETUP #
#########

declare lower;
input fastLength = 7;
input slowLength = 15;
input trendLength = 4;
input noiseLength = 250;
input correctionFactor = 2;
input TIME = AggregationPeriod.HOUR;
input TIME2 = AggregationPeriod.THREE_DAYS;

assert(trendLength > 0, "'trend length' must be positive: " + trendLength);
assert(correctionFactor > 0, "'correction factor' must be positive: " + correctionFactor);

def smf = 2 / (1 + trendLength);

########
# LOGIC #
########

def reversal = sign(ExpAverage(close(period = TIME), fastLength) - ExpAverage(close(period = TIME), slowLength));

def cpc = if isNaN(reversal[1]) then 0 else if reversal[1] != reversal then 0 else cpc[1] + close(period = TIME2) - close(period = TIME2)[1];

def trend = if isNaN(reversal[1]) then 0 else if reversal[1] != reversal then 0 else trend[1] * (1 - smf) + cpc * smf;

def noise;
def diff = AbsValue(cpc - trend);

noise = correctionFactor * Average(diff, noiseLength);

def TQ = if noise == 0 then 0 else trend / noise;

########
# TRADE #
########

plot swing = if TQ > 0 then 1 else if TQ < 0 then -1 else 0;
swing.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);

swing.AssignValueColor( if TQ > 0 then Color.GREEN else if TQ < 0 then Color.RED else Color.Yellow);

###PAINT###

input PaintBars = Yes;
AssignPriceColor (if !PaintBars then Color.CURRENT else if TQ > 0 then Color.GREEN else if  TQ < 0 then Color.RED else Color.gray);
Hi Woodman78. This is an awesome indicator. Do you know offhand if it re-paints? Either way thanks!
 
Actually really dig this, made some tweaks;
Code:
#########
# SETUP #
#########

declare lower;
input fastLength = 7;
input slowLength = 15;
input trendLength = 4;
input noiseLength = 250;
input correctionFactor = 2;
input TIME = AggregationPeriod.HOUR;
input TIME2 = AggregationPeriod.THREE_DAYS;

assert(trendLength > 0, "'trend length' must be positive: " + trendLength);
assert(correctionFactor > 0, "'correction factor' must be positive: " + correctionFactor);

def smf = 2 / (1 + trendLength);

########
# LOGIC #
########

def reversal = sign(ExpAverage(close(period = TIME), fastLength) - ExpAverage(close(period = TIME), slowLength));

def cpc = if isNaN(reversal[1]) then 0 else if reversal[1] != reversal then 0 else cpc[1] + close(period = TIME2) - close(period = TIME2)[1];

def trend = if isNaN(reversal[1]) then 0 else if reversal[1] != reversal then 0 else trend[1] * (1 - smf) + cpc * smf;

def noise;
def diff = AbsValue(cpc - trend);

noise = correctionFactor * Average(diff, noiseLength);

def TQ = if noise == 0 then 0 else trend / noise;

########
# TRADE #
########

plot swing = if TQ > 0 then 1 else if TQ < 0 then -1 else 0;
swing.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);

swing.AssignValueColor( if TQ > 0 then Color.GREEN else if TQ < 0 then Color.RED else Color.Yellow);

###PAINT###

input PaintBars = Yes;
AssignPriceColor (if !PaintBars then Color.CURRENT else if TQ > 0 then Color.GREEN else if  TQ < 0 then Color.RED else Color.gray);
Im a noob at coding but understand trading, this is very simple and elegant IMO. Ive found myself just watching candles lately and drawing in support and resistance lines. Which is what I started doing years ago...I think the indicators are somewhat of a distraction. But this I like.
 
I'm attempting to identify stocks with good upward momentum (from a day/swing trading perspective) in vain. I have tried using ThinkScript to check for Parabolic SAR in conjunction with either MACD or Stochastics. I'm swing trading weekly options using fib retracements and when the stock price pulls away from the monthly VWAP. Perhaps, my criteria is not sound enough. I would appreciate suggestions.
Start with high volume equities. Like the spy, qqq, etc. Those trade endlessly and don't burn up like other equities. Go through the watchlist of sp500, Russel, Dow, and then start at a year out on the chart. Look for the trend, look for cup formations. Its all about the moving averages. Most indicators are garbage. Then when you find that, here is the secret....level two quotes. Go through level 2 quotes at the bell. They have premarket then 30 minutes in to decide where the stock is going. Thats based on the dark pools, who's buying or selling what.
Info you and I dont have. But Level 2 quotes help you determine where its going. So mark down the low bid and high bid from the same exchange use an exchange that controls the market like IDK... GSCO those bastards hit their mark all the time. Then put a price line on your screen. One for the low bid one for the high bid. It will change slightly during the day, but the open or first 30 minutes is critical. Then they typically will hit that mark 1-3 days after depending on direction but by that time you know the direction. Then place bets. Watch the candles watch resistance. KEEP IT SIMPLE most indicators are designed to take you down the wrong road. Best one yet is Robert Payne the edge below: Remember set it up according to the directions.

# (1) Trend Signal -- UP or DN
# The short-term trend is based upon the 8 period moving average in accordance with "The Market Maker's Edge". If the current stock price is above the 8MA, then the trend is up and UP will be displayed in green. If the current stock price is below the 8MA, then the trend is down and DN will be displayed in red.

# (2) Net Signal -- NS
# The net change in stock price. If the current price is greater than yesterday's closing price, then NS will be displayed in green. If the current price is less than yesterday's close, then NS will be displayed in red.

# (3) Open Signal -- OS
# The dominant direction of today's movement. If the current price is greater than today's opening price, then OS will be displayed in green. If the current price is less than today's opening price, then OS will be displayed in red.

# (4) High / Low Signal -- H/L
# This shows daily momentum by determining whether the stock is trading above or below yesterday's high or low price. If the current price is above yesterday's high, then H/L will be displayed in green. If the current price is below yesterday's low, then H/L will be displayed in red. If the current price is between yesterday's high and low, then H/L will be displayed in gray.

# (5) Out of Bounds
# This only displays when the stock is outside of the bollinger bands. For example, in the second image above, it may be seen that NFLX is $1.82 outside of the top bollinger band on the 55 min chart and $1.43 outside of the top bollinger band on the 34 min chart. The price will be displayed in white.

# This code may be applied to any chart Daily and below. For me, I like to have all the indicators in agreement across the 55, 34, 21, and 13. It is nice if the 233 and Daily agree, but is not necessary for me.
#The Edge
#Robert Payne

#Plot 8 period moving average
plot MA8 = Average(close, 8);
MA8.SetDefaultColor(Color.YELLOW);
MA8.SetLineWeight(2);

#Trend Signal
def TrendUp = if close > MA8 then 1 else Double.NaN;
def TrendDn = if close < MA8 then 1 else Double.NaN;
AddLabel(TrendUp, "UP", Color.GREEN);
AddLabel(TrendDn, "DN", Color.RED);

#Net Signal
def NSup = if close - close(period = "day" )[1] > 0 then 1 else Double.NaN;
def NSdn = if close - close(period = "day" )[1] <= 0 then 1 else Double.NaN;
AddLabel(NSup, "NS", Color.GREEN);
AddLabel(NSdn, "NS", Color.RED);

#Open Signal
def OSup = if close - open(period = "day" ) > 0 then 1 else Double.NaN;
def OSdn = if close - open(period = "day" ) < 0 then 1 else Double.NaN;
AddLabel(OSup, "OS", Color.GREEN);
AddLabel(OSdn, "OS", Color.RED);

#High / Low Signal
def Higher = if close > high(period = "day" )[1] then 1 else Double.NaN;
def Lower = if close < low(period = "day" )[1] then 1 else Double.NaN;
def Neutral = if close <= high(period="day" )[1] and close >= low(period="day" )[1] then 1 else Double.NaN;
AddLabel(Higher, "H/L", Color.GREEN);
AddLabel(Lower, "H/L", Color.RED);
AddLabel(Neutral, "H/L", Color.GRAY);

#Out of Bounds
def sDev = StDev(close, 21);
def MidLine = Average(close, 21);
def UpperBand = MidLine + 2 * sDev;
def LowerBand = MidLine - 2 * sDev;
def CloseAbove = if close > UpperBand then 1 else Double.NaN;
def CloseBelow = if close < LowerBand then 1 else Double.NaN;
AddLabel(CloseAbove, round(close - UpperBand,2), Color.WHITE);
AddLabel(CloseBelow, round(close - LowerBand,2), Color.WHITE);
 
Actually really dig this, made some tweaks;
Code:
#########
# SETUP #
#########

declare lower;
input fastLength = 7;
input slowLength = 15;
input trendLength = 4;
input noiseLength = 250;
input correctionFactor = 2;
input TIME = AggregationPeriod.HOUR;
input TIME2 = AggregationPeriod.THREE_DAYS;

assert(trendLength > 0, "'trend length' must be positive: " + trendLength);
assert(correctionFactor > 0, "'correction factor' must be positive: " + correctionFactor);

def smf = 2 / (1 + trendLength);

########
# LOGIC #
########

def reversal = sign(ExpAverage(close(period = TIME), fastLength) - ExpAverage(close(period = TIME), slowLength));

def cpc = if isNaN(reversal[1]) then 0 else if reversal[1] != reversal then 0 else cpc[1] + close(period = TIME2) - close(period = TIME2)[1];

def trend = if isNaN(reversal[1]) then 0 else if reversal[1] != reversal then 0 else trend[1] * (1 - smf) + cpc * smf;

def noise;
def diff = AbsValue(cpc - trend);

noise = correctionFactor * Average(diff, noiseLength);

def TQ = if noise == 0 then 0 else trend / noise;

########
# TRADE #
########

plot swing = if TQ > 0 then 1 else if TQ < 0 then -1 else 0;
swing.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);

swing.AssignValueColor( if TQ > 0 then Color.GREEN else if TQ < 0 then Color.RED else Color.Yellow);

###PAINT###

input PaintBars = Yes;
AssignPriceColor (if !PaintBars then Color.CURRENT else if TQ > 0 then Color.GREEN else if  TQ < 0 then Color.RED else Color.gray);
Very interesting strategy, ty for sharing @Woodman78. Could you share what your entry/exit trigger is? Are you looking at the gray bar as trigger perhaps? Also curious how you scan to catch the runs, I pulled up a bunch of random stock and the run started days/weeks ago lol
 
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
I LOVE this indicator. One question, not necessarily about this indicator specifically, but more in general. Is there a command statement for TOS where when an arrow plots, it stays(for the entire length of the timeframed candle it originally plotted on), even when the conditions are no longer being met?
 
I LOVE this indicator. One question, not necessarily about this indicator specifically, but more in general. Is there a command statement for TOS where when an arrow plots, it stays(for the entire length of the timeframed candle it originally plotted on), even when the conditions are no longer being met?
No there is no "command statement". ThinkScript uses code with if-then-else statements.
Provide COMPLETE description of what changes you are looking for. Explain
condition 1 is what and then what you want to happen? If condition 1 does not happen then what else?
condition 2 is what and then what you want to happen? If condition 2 does not happen then what else?
etc... etc...

From what I have observed, posts without a visual documentation seldom get responses.
Unsure of how to upload screenshots to the forum,
Here are directions.
And here are some Cool Tips For Creating The Perfect Post.
 

Volatility Trading Range

VTR is a momentum indicator that shows if a stock is overbought or oversold based on its Weekly and Monthly average volatility trading range.

Download the indicator

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
254 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