Blast-Off Momentum For ThinkOrSwim

mbarcala

Active member
This study is an alternative experimental interpretation of the Blast Off Indicator by Larry Williams.
This formula takes positive and negative magnitudes rather than the absolute value. The result is then smoothed with an EMA, and twice smoothed to provide a signal line.

1iQRONk.png


I would like to have this converted
Original link: https://www.tradingview.com/script/fhjAA1Dq-Blast-Off-Momentum-DW/
 
Last edited by a moderator:
I would like to change another piece of pine script to TOS. I convert few lines but I have others part that I can't understand, never done pine script in the pass.
Original link: https://www.tradingview.com/script/fhjAA1Dq-Blast-Off-Momentum-DW/

you may add lower study below

CSS:
#study(title="Blast Off Momentum [DW]", shorttitle="BOM [DW]", overlay=false)
#//by Donovan Wall
#//This study is an alternative experimental interpretation of the Blast Off Indicator by Larry Williams.
#//This formula takes positive and negative magnitudes rather than the absolute value. The result is then smoothed with an ema, and twice smoothed to provide a signal line.
# Converted by Sam4Cok@Samer800    - 05/2023
declare lower;
input ColorBars = yes;
input ShowTriggerCandle = no;
input Period = 34;         # "Period"
input SignalPeriod = 9;    # "Signal Period"
input Threshold = 10;      # "Threshold Distance"

def na = Double.NaN;
def last = isNaN(close);
#//Definitions

#//Blast Off Momentum
    def ocrng = close - open;
    def hlrng = high - low;
    def bo    = ocrng/hlrng*100;
    def BOM   = ExpAverage(bo, Period);
    def SIG   = ExpAverage(BOM, SignalPeriod);

#//Thresholds
def uth = Threshold;
def lth = -Threshold;

#//Color
def col = if (bom > 0) and (bom < uth) then 1 else
          if (bom < 0) and (bom > lth) then -1 else
          if (bom > uth) then 2 else if (bom < lth) then -2 else 0;

#//Plots
#//Signal Line
plot sigLine = sig;    # "Signal Line"
sigLine.SetDefaultColor(Color.YELLOW);

#//BOM
plot bomplot = bom;    # "BOM"
bomplot.SetPaintingStrategy(PaintingStrategy.SQUARED_HISTOGRAM);
bomplot.AssignValueColor(if col==2 then Color.GREEN else
                         if col==1 then Color.DARK_GREEN else
                         if col==-1 then Color.DARK_RED else
                         if col==-2 then Color.RED else Color.GRAY);
#//Thresholds
plot uthplot  = if last then na else uth;    # "Upper Threshold"
plot centplot = if last then na else 0;      # "Center Line"
plot lthplot  = if last then na else lth;    # "Lower Threshold"
uthplot.SetDefaultColor(Color.GREEN);
centplot.SetDefaultColor(Color.DARK_GRAY);
lthplot.SetDefaultColor(Color.RED);
uthplot.SetStyle(Curve.SHORT_DASH);
lthplot.SetStyle(Curve.SHORT_DASH);

#-- Trigger Candle
def up = ShowTriggerCandle and col==2 and col[1]!=2;
def dn = ShowTriggerCandle and col==-2 and col[1]!=-2;
AssignPriceColor(if up then Color.CYAN else
                 if dn then Color.MAGENTA else Color.CURRENT);

#//Bar Color
AssignPriceColor(if !ColorBars then Color.CURRENT else
                 if up then Color.CYAN else
                 if col==2 then Color.GREEN else
                 if col==1 then Color.DARK_GREEN else
                 if col==-1 then Color.DARK_RED else
                 if dn then Color.MAGENTA else
                 if col==-2 then Color.RED else Color.GRAY);

#-- END of CODE
 
Last edited by a moderator:
you may add lower study below

CSS:
#study(title="Blast Off Momentum [DW]", shorttitle="BOM [DW]", overlay=false)
#//by Donovan Wall
#//This study is an alternative experimental interpretation of the Blast Off Indicator by Larry Williams.
#//This formula takes positive and negative magnitudes rather than the absolute value. The result is then smoothed with an ema, and twice smoothed to provide a signal line.
# Converted by Sam4Cok@Samer800    - 05/2023
declare lower;
input ColorBars = yes;
input ShowTriggerCandle = no;
input Period = 34;         # "Period"
input SignalPeriod = 9;    # "Signal Period"
input Threshold = 10;      # "Threshold Distance"

def na = Double.NaN;
def last = isNaN(close);
#//Definitions

#//Blast Off Momentum
    def ocrng = close - open;
    def hlrng = high - low;
    def bo    = ocrng/hlrng*100;
    def BOM   = ExpAverage(bo, Period);
    def SIG   = ExpAverage(BOM, SignalPeriod);

#//Thresholds
def uth = Threshold;
def lth = -Threshold;

#//Color
def col = if (bom > 0) and (bom < uth) then 1 else
          if (bom < 0) and (bom > lth) then -1 else
          if (bom > uth) then 2 else if (bom < lth) then -2 else 0;

#//Plots
#//Signal Line
plot sigLine = sig;    # "Signal Line"
sigLine.SetDefaultColor(Color.YELLOW);

#//BOM
plot bomplot = bom;    # "BOM"
bomplot.SetPaintingStrategy(PaintingStrategy.SQUARED_HISTOGRAM);
bomplot.AssignValueColor(if col==2 then Color.GREEN else
                         if col==1 then Color.DARK_GREEN else
                         if col==-1 then Color.DARK_RED else
                         if col==-2 then Color.RED else Color.GRAY);
#//Thresholds
plot uthplot  = if last then na else uth;    # "Upper Threshold"
plot centplot = if last then na else 0;      # "Center Line"
plot lthplot  = if last then na else lth;    # "Lower Threshold"
uthplot.SetDefaultColor(Color.GREEN);
centplot.SetDefaultColor(Color.DARK_GRAY);
lthplot.SetDefaultColor(Color.RED);
uthplot.SetStyle(Curve.SHORT_DASH);
lthplot.SetStyle(Curve.SHORT_DASH);

#-- Trigger Candle
def up = ShowTriggerCandle and col==2 and col[1]!=2;
def dn = ShowTriggerCandle and col==-2 and col[1]!=-2;
AssignPriceColor(if up then Color.CYAN else
                 if dn then Color.MAGENTA else Color.CURRENT);

#//Bar Color
AssignPriceColor(if !ColorBars then Color.CURRENT else
                 if up then Color.CYAN else
                 if col==2 then Color.GREEN else
                 if col==1 then Color.DARK_GREEN else
                 if col==-1 then Color.DARK_RED else
                 if dn then Color.MAGENTA else
                 if col==-2 then Color.RED else Color.GRAY);

#-- END of CODE
i compared the TV indicator and TOS indicator....the result aren't the same. Can you please check again @samer800 Thank you!
 

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

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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