Blast Off Indicator for ThinkorSwim

BenTen

BenTen

Administrative
Staff
VIP
Description of Indicator:
  • This measures the day's open / close vs then high lows of the day (range)
  • When the open /close is less than 20% of the range, then it's likely that the following day will have a big jump.
  • The Thought Process is Simply When (Open - Close) is Less Than 20% Of The Range…Shows Indecision and Breakout is Probable.
  • Which way? Use whatever indicator you want to figure out if the market is oversold or overbought.

You should use this indicator on the daily chart. A pink candle represent a "blast off" candle. Expect a big move the next day. For day traders, you can also use this on the lower timeframes to look for indecision candles.



thinkScript Code

Code:
# Blast Off Indicator
# Should use on the Daily chart
# Assembled by BenTen at useThinkScript.com
# Converted from https://www.tradingview.com/script/V9Mi6eOO-CM-Blast-Off-V1-Alerts-Ready/

input trig = 20;
input paintbar = yes;

def val = absValue(close - open);
def range = high - low;
def blastOffVal = (val / range) * 100;
def trigger = trig;
def alert1 = blastOffVal < trig;
def col = blastOffVal < trig;

assignPriceColor(if paintbar and blastOffVal<trig then Color.MAGENTA else Color.Current);

# Plot Arrow
plot arrow = col;
arrow.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
arrow.SetDefaultColor(Color.CYAN);
arrow.SetLineWeight(1);

Shareable Link: https://tos.mx/3DOXHdO

Fancy Version

As suggested by @john3

Code:
# Blast Off Indicator
# Should use on the Daily chart
# Assembled by BenTen at useThinkScript.com
# Converted from https://www.tradingview.com/script/V9Mi6eOO-CM-Blast-Off-V1-Alerts-Ready/

# Modified version: added line to high and low of blast off candle.

input trig = 20;

def val = absValue(close - open);
def range = high - low;
def blastOffVal = (val / range) * 100;
def trigger = trig;
def alert1 = blastOffVal < trig;
def col = blastOffVal < trig;

def blast_candle = blastOffVal < trig;

def b_high = if blast_candle then high else b_high[1];
def b_low = if blast_candle then low  else b_low[1];

plot hh = b_high;
plot ll = b_low;

hh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
ll.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
hh.SetDefaultColor(Color.YELLOW);
ll.SetDefaultColor(Color.YELLOW);

assignPriceColor(if blastOffVal<trig then Color.MAGENTA else Color.WHITE);

 
Last edited:
J007RMC

J007RMC

Well-known member
2019 Donor
VIP
Ben this is interesting. Blastoff on 5 min chart is showing yellow candles that appear to forecast up and down stock movement in TOS dark mode in spy but random candles
 
BenTen

BenTen

Administrative
Staff
VIP
@J007RMC Not sure how you get yellow candles. I'm seeing pink and white here on my chart. Also SPY on the 5m as well.



For testing purposes, I would create a new chart without any other indicators.
 
J

john3

Active member
2019 Donor
I don't know who originally created this indicator, but if I am not mistaken it has been frequently mentioned by Linda Raschke and Larry Connors. It might be in their famous Street Smarts book, but I'm not 100% sure. I believe it is meant to be used on a Daily chart. That said, on an intraday chart, it does a great job at highlighting spinning top/doji-like candles.

I think it would be useful to have an option to plot a box around those candles (high/low). The breakout in either way seems tradeable as either a trend continuation or a reversal.
 
K

kvnknpp1

New member
Have I missed a ToS.mx link?
Thx, new to the group. Howdy all!
 
K

kvnknpp1

New member
First time I've seen a tos.mx link with 7 characters. I used the fancy version with yellow lines and remarked out the last line changing candles to magenta and white. Will see how it does over the next few days. Thx BenTen
 
C

CarlG

New member
VIP
I noticed that if you used the momentum study in conjunction with the Blast Off Study, then you could get better sense of which direction the stock was going to move. Follow the direction of the momentum. Rising momentum gave bullish trades and falling momentum gave bearish trades.
 
H

HighBredCloud

Well-known member
VIP
@BenTen Do you think the purple candles can somehow be incorporated into the CSA Nube (RSI Laguerre, SuperTrend) which uses the dark gray and red candlesticks? That way you can see which way the trend is going by having the purple candles appear in the SuprerTrend?

NOTE IF this is possible and someone can do this...I would request the purple candles to be changed to white candles...I think that combo would go along well with the SuperTrend candles.

Also tagging @netarchitech and @horserider in this:

Below is the SuperTrend code I referenced:

Code:
CSA Nube (RSI Laguerre, SuperTrend)
# Nube
# 8.28.2016

# When RSI Laguerre is combined with SuperTrend, if this study plots a
# line and ST changes that bar or the next one, then it seems to be a
# decent entry.
#
# After making this observation, I'm tentatively going to scrap the momentum
# study (VACD) and just use the Laguerre RSI to decide trend and the
# Supertrend for entry. I think something along the lines of attaching that
# to RSI will be enough to decide direction and then just flag the switchover
# between up and down in ST

# RSI in Laguerre Time Self Adjusting With Fractal Energy
# Mobius
# V02.07.2014
# V03.06.15.2016
# Both Fractal Energy and RSI are plotted. RSI in cyan and FE in yellow. Look for trend exhaustion in the FE and a reversal of RSI or Price compression in FE and an RSI reversal.

#Inputs:
input nFE = 13;#hint nFE: length for Fractal Energy calculation.
input Overbought = 0.80;
input Oversold = 0.20;
Input Label = Yes;
# Variables:
def o;
def h;
def l;
def c;
def CU1;
def CU2;
def CU;
def CD1;
def CD2;
def CD;
def L0;
def L1;
def L2;
def L3;
def RSI;
def OS;
def OB;

# Calculations
o = (open + close[1]) / 2;
h = Max(high, close[1]);
l = Min(low, close[1]);
c = (o + h + l + close) / 4;
def gamma = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nFE) /
        (Highest(high, nFE) - Lowest(low, nFE)))
            / Log(nFE);

L0 = (1 – gamma) * c + gamma * L0[1];
L1 = -gamma * L0 + L0[1] + gamma * L1[1];
L2 = -gamma * L1 + L1[1] + gamma * L2[1];
L3 = -gamma * L2 + L2[1] + gamma * L3[1];
if L0 >= L1
then {
    CU1 = L0 - L1;
    CD1 = 0;
} else {
    CD1 = L1 - L0;
    CU1 = 0;
}
if L1 >= L2
then {
    CU2 = CU1 + L1 - L2;
    CD2 = CD1;
} else {
    CD2 = CD1 + L2 - L1;
    CU2 = CU1;
}
if L2 >= L3
then {
    CU = CU2 + L2 - L3;
    CD = CD2;
} else {
    CU = CU2;
    CD = CD2 + L3 - L2;
}

RSI = if CU + CD <> 0 then CU / (CU + CD) else 0;
OS = if IsNaN(close) then Double.NaN else Oversold;
OB = if IsNaN(close) then Double.NaN else Overbought;


# Mobius
# SuperTrend
# Chat Room Request
# V03.10.2015

input AtrMult = 1.0;
input nATR = 4;
input AvgType = AverageType.HULL;
input PaintBars = no;

def ATR = MovingAverage(AvgType, TrueRange(high, close, low), nATR);
def UP = HL2 + (AtrMult * ATR);
def DN = HL2 + (-AtrMult * ATR);
def ST = if close < ST[1] then UP else DN;
def SuperTrend = ST;

AssignPriceColor(if PaintBars and close < ST
                then GetColor(5)
                else if PaintBars and close > ST
                     then GetColor(7)
                     else Color.CURRENT);

# End Code SuperTrend

def UT = sum(RSI>OB,20);
def DT = sum(RSI<OS,20);

plot Buy = if UT>DT and close > ST and close[1] < ST[1] then close else Double.Nan;
Buy.SetDefaultColor(GetColor(7));
Buy.SetPaintingStrategy(PaintingStrategy.VALUES_BELOW);

plot Sell = if UT<DT and close < ST and close[1] > ST[1] then close else Double.Nan;
Sell.SetDefaultColor(GetColor(5));
Sell.SetPaintingStrategy(PaintingStrategy.VALUES_ABOVE);

AddLabel(Label, "Trend: " + if UT>DT then "Up" else if UT<DT then "Down" else "None", if UT>DT then GetColor(1) else if UT<DT then GetColor(5) else GetColor(3));

# End Study
 
Last edited:
horserider

horserider

Well-known member
VIP
@HighBredCloud Sorry count me out on this one.
 
mc01439

mc01439

Well-known member
2019 Donor
VIP
@BenTen Do you think the purple candles can somehow be incorporated into the CSA Nube (RSI Laguerre, SuperTrend) which uses the dark gray and red candlesticks? That way you can see which way the trend is going by having the purple candles appear in the SuprerTrend?

NOTE IF this is possible and someone can do this...I would request the purple candles to be changed to white candles...I think that combo would go along well with the SuperTrend candles.

Also tagging @netarchitech and @horserider in this:

Below is the SuperTrend code I referenced:

Code:
CSA Nube (RSI Laguerre, SuperTrend)
# Nube
# 8.28.2016

# When RSI Laguerre is combined with SuperTrend, if this study plots a
# line and ST changes that bar or the next one, then it seems to be a
# decent entry.
#
# After making this observation, I'm tentatively going to scrap the momentum
# study (VACD) and just use the Laguerre RSI to decide trend and the
# Supertrend for entry. I think something along the lines of attaching that
# to RSI will be enough to decide direction and then just flag the switchover
# between up and down in ST

# RSI in Laguerre Time Self Adjusting With Fractal Energy
# Mobius
# V02.07.2014
# V03.06.15.2016
# Both Fractal Energy and RSI are plotted. RSI in cyan and FE in yellow. Look for trend exhaustion in the FE and a reversal of RSI or Price compression in FE and an RSI reversal.

#Inputs:
input nFE = 13;#hint nFE: length for Fractal Energy calculation.
input Overbought = 0.80;
input Oversold = 0.20;
Input Label = Yes;
# Variables:
def o;
def h;
def l;
def c;
def CU1;
def CU2;
def CU;
def CD1;
def CD2;
def CD;
def L0;
def L1;
def L2;
def L3;
def RSI;
def OS;
def OB;

# Calculations
o = (open + close[1]) / 2;
h = Max(high, close[1]);
l = Min(low, close[1]);
c = (o + h + l + close) / 4;
def gamma = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nFE) /
        (Highest(high, nFE) - Lowest(low, nFE)))
            / Log(nFE);

L0 = (1 – gamma) * c + gamma * L0[1];
L1 = -gamma * L0 + L0[1] + gamma * L1[1];
L2 = -gamma * L1 + L1[1] + gamma * L2[1];
L3 = -gamma * L2 + L2[1] + gamma * L3[1];
if L0 >= L1
then {
    CU1 = L0 - L1;
    CD1 = 0;
} else {
    CD1 = L1 - L0;
    CU1 = 0;
}
if L1 >= L2
then {
    CU2 = CU1 + L1 - L2;
    CD2 = CD1;
} else {
    CD2 = CD1 + L2 - L1;
    CU2 = CU1;
}
if L2 >= L3
then {
    CU = CU2 + L2 - L3;
    CD = CD2;
} else {
    CU = CU2;
    CD = CD2 + L3 - L2;
}

RSI = if CU + CD <> 0 then CU / (CU + CD) else 0;
OS = if IsNaN(close) then Double.NaN else Oversold;
OB = if IsNaN(close) then Double.NaN else Overbought;


# Mobius
# SuperTrend
# Chat Room Request
# V03.10.2015

input AtrMult = 1.0;
input nATR = 4;
input AvgType = AverageType.HULL;
input PaintBars = no;

def ATR = MovingAverage(AvgType, TrueRange(high, close, low), nATR);
def UP = HL2 + (AtrMult * ATR);
def DN = HL2 + (-AtrMult * ATR);
def ST = if close < ST[1] then UP else DN;
def SuperTrend = ST;

AssignPriceColor(if PaintBars and close < ST
                then GetColor(5)
                else if PaintBars and close > ST
                     then GetColor(7)
                     else Color.CURRENT);

# End Code SuperTrend

def UT = sum(RSI>OB,20);
def DT = sum(RSI<OS,20);

plot Buy = if UT>DT and close > ST and close[1] < ST[1] then close else Double.Nan;
Buy.SetDefaultColor(GetColor(7));
Buy.SetPaintingStrategy(PaintingStrategy.VALUES_BELOW);

plot Sell = if UT<DT and close < ST and close[1] > ST[1] then close else Double.Nan;
Sell.SetDefaultColor(GetColor(5));
Sell.SetPaintingStrategy(PaintingStrategy.VALUES_ABOVE);

AddLabel(Label, "Trend: " + if UT>DT then "Up" else if UT<DT then "Down" else "None", if UT>DT then GetColor(1) else if UT<DT then GetColor(5) else GetColor(3));

# End Study
@HighBredCloud

Try this - https://tos.mx/ogOAM6v
 
netarchitech

netarchitech

Well-known member
VIP
@HighBredCloud Not sure what you are looking for...Below is a sample for your review...Please advise...



Code:
# filename: _CandleColoring_test_

# Blast Off Indicator
# Should use on the Daily chart
# Assembled by BenTen at useThinkScript.com
# Converted from https://www.tradingview.com/script/V9Mi6eOO-CM-Blast-Off-V1-Alerts-Ready/

# Modified version: added line to high and low of blast off candle.

input PaintBars = no;
input trig = 20;

def val = absValue(close - open);
def range = high - low;
def blastOffVal = (val / range) * 100;
def trigger = trig;
def alert1 = blastOffVal < trig;
def col = blastOffVal < trig;

def blast_candle = blastOffVal < trig;

#def b_high = if blast_candle then high else b_high[1];
#def b_low = if blast_candle then low  else b_low[1];

#plot hh = b_high;
#plot ll = b_low;

#hh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
#ll.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
#hh.SetDefaultColor(Color.YELLOW);
#ll.SetDefaultColor(Color.YELLOW);

# Mobius
# SuperTrend
# Chat Room Request
# V03.10.2015

input AtrMult = 1.0;
input nATR = 4;
input AvgType = AverageType.HULL;


def ATR = MovingAverage(AvgType, TrueRange(high, close, low), nATR);
def UP = HL2 + (AtrMult * ATR);
def DN = HL2 + (-AtrMult * ATR);
def ST = if close < ST[1] then UP else DN;
def SuperTrend = ST;

AssignPriceColor(if PaintBars and close < ST and blastOffVal < trig
                then Color.WHITE
                else if PaintBars and close > ST
                     then Color.DARK_GRAY
                     else Color.DARK_GRAY);
 
H

HighBredCloud

Well-known member
VIP
@netarchitech I was looking to see if it is possible to incorporate the "blast off candles" ONLY (originally the purple candles found in the Blast Off indicator) ,now the white candles in your most current code posted, to the RSI Laguerre, SuperTrend that I posted in post #12. I think you used the regular SuperTrend by Mobius if I am not mistaken as I don't see the RSI Laguerre part anywhere in the code.

My reason behind this request is that even though the RSI Laguerre SuperTrend paints the bars...the candlesticks in the trend are still somewhat inaccurate as some candles in the defined trend are either going up or down even though the trend painted the candles the same color. I am hoping that by adding the "Blast Off" candles only to the RSI Laguerre SuperTrend...one could make the decision sooner to get in or out of the trade before the trend color reverses on the candles themselves. I hope this makes sense.

EDIT: Please see the code provided by @mc01439 I think that is a good starting point as everything seems to be in place other than the white candles in his code need to be changed to either dark grey for uptrend and red for the down trend and the purple "blast off" candles in the code he provided would need to be white.
 
Last edited:
H

HighBredCloud

Well-known member
VIP
@HighBredCloud

Try this - https://tos.mx/ogOAM6v

@mc01439 This is a bit confusing...as the original candles in the RSI Laguerre SuperTrend are dark grey for uptrend and red for downtrend. Using the same colors I wanted to see IF it was possible to incorporate the "blast off" candles only and make them white in the RSI Laguerre SuperTrend.
 
H

HighBredCloud

Well-known member
VIP
@mc01439 I looked over the code again...so basically can the white candles in that code be made to either dark grey uptrend or red for down trend and then make the purple candles white? Because IF that could be done...then this is what I am looking [email protected] what do you think about the code that @mc01439 provided? Is that something you can build off from?

What is the blue arrow suppose to be for? to indicate the "blast off" purple candle?
 

Similar threads

Top