Beep Boop Indicator for ThinkorSwim

@andre.muhammad I'm glad this indicator is helpful to you.

In order to scan for changes, you can create a custom filter and look for value changes for hist plot. Since the values are 0.1 and 0.09, you can look for value crossing below and above the valid values. I can also add value change indicators to make it a pretty much yes/no scan.

But, for now, you can do the following for bullish:
EqSqKj6.png


and for bearish:
zgpuL1v.png


Results for bullish on daily:

kxOT4Wj.png
 
Here is a version that paints the price bars, if anyone is interested. @mashume's chart looks good.

Code:
# Beep Boop
# Converted from TradingView
# v1 - 20210115 barbaros
# v2 - 20210117 barbaros - Added filter to show only in long term direction
# v3 - 20210122 barbaros - Added price bar painting

declare lower;
declare zerobase;

input FastLength = 12;       # Fast Length
input SlowLength = 26;       # Slow Length
input EMATrend = 50;         # EMA Trend
input EMAFilter = no;        # Only show in the direction of the trend
input EMAFilterPeriod = 200; # EMA Filter Trend Period
input Source = close;        # Source
input SignalLength = 9;      # Signal Smoothing, minval = 1, maxval = 50
input SMASource = no;        # Simple MA(Oscillator)
input SMASignal = no;        # Simple MA(Signal Line)
input ShowLabel = yes;       # Show indicator label
input PaintBars = no;       # Paints the price bars

def fast_ma = if SMASource then SimpleMovingAvg(Source, FastLength) else MovAvgExponential(Source, FastLength);
def slow_ma = if SMASource then SimpleMovingAvg(Source, SlowLength) else MovAvgExponential(Source, SlowLength);
def macd = fast_ma - slow_ma;
def signal = if SMASignal then SimpleMovingAvg(macd, SignalLength) else MovAvgExponential(macd, SignalLength);
def histVal = macd - signal;
def fastMA = MovAvgExponential(Source, EMATrend);
def longtermMA = MovAvgExponential(Source, EMAFilterPeriod);

plot hist = if histVal > 0 and (!EMAFilter or low > longtermMA) then 0.1
            else if histVal < 0  and (!EMAFilter or high < longtermMA) then 0.09
            else if EMAFilter then Double.NaN else histVal;


hist.defineColor("col_grow_above", CreateColor(38, 166, 154));
hist.defineColor("col_grow_below", CreateColor(255, 0, 0));
hist.defineColor("col_fall_above", CreateColor(255, 255, 255));
hist.defineColor("col_fall_below", CreateColor(255, 255, 255));
hist.defineColor("col_macd", CreateColor(0, 148, 255));
hist.defineColor("col_signal", CreateColor(255, 106, 0));

hist.setPaintingStrategy(PaintingStrategy.HISTOGRAM);
hist.assignValueColor(if hist == 0.1 then
                        if (hist == 0.1) and (close > fastMA) and (open > fastMA) and (low > fastMA) then
                            hist.Color("col_grow_above")
                        else
                            hist.Color("col_fall_above")
                      else
                        if (hist == 0.09) and (close < fastMA) and (open < fastMA) and (high < fastMA) then
                            hist.Color("col_grow_below")
                        else
                            hist.Color("col_fall_below"));

AssignPriceColor(
    if PaintBars then
        if hist == 0.1 then
        if (hist == 0.1) and (close > fastMA) and (open > fastMA) and (low > fastMA) then
            hist.Color("col_grow_above")
        else
            hist.Color("col_fall_above")
        else
        if (hist == 0.09) and (close < fastMA) and (open < fastMA) and (high < fastMA) then
            hist.Color("col_grow_below")
        else
            hist.Color("col_fall_below")
    else
        Color.CURRENT
);

AddLabel(ShowLabel,
        if hist == 0.1 then
            if (hist == 0.1) and (close > fastMA) and (open > fastMA) and (low > fastMA) then
                "Grow Above"
            else
                "Fall Above"
        else
            if (hist == 0.09) and (close < fastMA) and (open < fastMA) and (high < fastMA) then
                "Grow Below"
            else
                "FallBelow",
        if hist == 0.1 then
            if (hist == 0.1) and (close > fastMA) and (open > fastMA) and (low > fastMA) then
                hist.Color("col_grow_above")
            else
                hist.Color("col_fall_above")
        else
            if (hist == 0.09) and (close < fastMA) and (open < fastMA) and (high < fastMA) then
                hist.Color("col_grow_below")
            else
                hist.Color("col_fall_below")
);
 
I’m not familiar with it. Is it custom?
I don't believe so. I've modded it a bit:
Code:
#
# TD Ameritrade IP Company, Inc. (c) 2012-2020
# Modded Mashume 2020
#

declare zerobase;

input price = close;
input threshold = 0.5;
input length = 30;
input slowingLength = 5;
input over_bought = 90;
input over_sold = 60;

def rainbow = reference RainbowAverage(price = price, averageType = AverageType.WEIGHTED);
plot Stochastic = sum(rainbow - Lowest(rainbow, length), slowingLength) / (sum(Highest(rainbow, length) - Lowest(rainbow, length), slowingLength) + 0.0001) * 100;

def normStochRainbow = 0.1 * (Stochastic - 50);
plot IFT = 100 / (1 + exp(-2 * normStochRainbow));
plot OverBought = over_bought;
plot OverSold = over_sold;

Stochastic.SetDefaultColor(GetColor(2));
IFT.SetDefaultColor(GetColor(1));
OverBought.setDefaultColor(GetColor(5));
OverSold.setDefaultColor(GetColor(5));

def smalldip = if
        IFT > IFT[1]
    and IFT[1] < IFT[2]
    and IFT - IFT[1] >= threshold
    and IFT[7] > IFT
    and IFT[7] > 95
    and IFT[1] <= 92.5
    and IFT > over_sold
    then IFT ELSE DOUBLE.NAN;

plot small_dip = smalldip;
small_dip.SetPaintingStrategy(paintingStrategy = PaintingStrategy.ARROW_UP);
small_dip.SetDefaultColor(getColor(3));
but I left the original copyright. :)

EDIT:
I should explain the small_dip plot. The idea with this one is that, in a trending market (where the IFT is pegged near 100), a small dip in the IFT can indicate a place to 'get in on the momentum' if you will. Sometimes it fails and after a brief rebound, things fall flat -- Note the small blue arrow at the right of the LIFE chart above? That's the small dip being triggered... and then failing to maintain. Here's an example of it in action:
2xQhCse.png

You can see the small blue arrow near the left, and the trend just continues going... The small dip showed a reasonable entry point.
happy trading
-mashume
 
Last edited:
I've been trying to apply to Futures /NQ, /YM, /GC, /HG, etc.. Doesn't seem to work well, at least with my calibrations. Any suggestions? I guess for forex it seems fairly justified
It's a trend trade above or below the 50EMA. It resonates well with me on 5 minute.
look at MACD weighted with a MACD line of 3 and you'll see why BEEP-BOOP is IMO better on a 5 min than 1 min
 
I"m using the "Beep Boop" as my entry into ThinkScript. I planned on adding the RSI as the height of the bars. I know the colors depend on the height but, if I can do it, then I'm learning. I added the counting part at the end.

I'd like to fix my lower studies range along the vertical axis to a range of 1 to 100. Currently it is taking on the value of the upper studies price...

Code:
# Beep Boop MTF
# Converted from TradingView
# v1 - 20210115 barbaros
# v2 - 20210117 barbaros - Added filter to show only in long term direction
# v3 - 20210121 barbaros - Added MTF, Removed Source

declare lower;
declare zerobase;
declare once_per_bar;


input FastLength = 12;                  # Fast Length
input SlowLength = 26;                  # Slow Length
input EMATrend = 50;                    # EMA Trend
input EMAFilter = no;                   # Only show in the direction of the trend
input EMAFilterPeriod = 200;            # EMA Filter Trend Period
input Agg = AggregationPeriod.FIVE_MIN; # Aggregation Period
input SignalLength = 9;                 # Signal Smoothing, minval = 1, maxval = 50
input SMASource = no;                   # Simple MA(Oscillator)
input SMASignal = no;                   # Simple MA(Signal Line)
input ShowLabel = yes;                  # Show indicator label

def fast_ma = if SMASource then SimpleMovingAvg(close(period = Agg), FastLength) else MovAvgExponential(close(period = Agg), FastLength);
def slow_ma = if SMASource then SimpleMovingAvg(close(period = Agg), SlowLength) else MovAvgExponential(close(period = Agg), SlowLength);
def macd = fast_ma - slow_ma;
def signal = if SMASignal then SimpleMovingAvg(macd, SignalLength) else MovAvgExponential(macd, SignalLength);
def histVal = macd - signal;
def fastMA = MovAvgExponential(close(period = Agg), EMATrend);
def longtermMA = MovAvgExponential(close(period = Agg), EMAFilterPeriod);

#plot asdf = RSI(200);


def histResult =      if histVal > 0 and (!EMAFilter or low > longtermMA) and (close > fastMA) and (open > fastMA) and (low > fastMA) then 10
            else if histVal < 0 and (!EMAFilter or high < longtermMA)and (close < fastMA) and (open < fastMA) and (high < fastMA) then 9
            # else if EMAFilter then Double.NaN else histVal;
            else 8;

plot hist =  histResult;


hist.defineColor("col_grow_above", CreateColor(38, 166, 154));
hist.defineColor("col_grow_below", CreateColor(255, 0, 0));
hist.defineColor("col_fall_above", CreateColor(255, 255, 255));
hist.defineColor("col_fall_below", CreateColor(255, 255, 255));
hist.defineColor("col_macd", CreateColor(0, 148, 255));
hist.defineColor("col_signal", CreateColor(255, 106, 0));

hist.setPaintingStrategy(PaintingStrategy.HISTOGRAM);
hist.assignValueColor(if hist == 10 then
                          hist.Color("col_grow_above")
                      else if (hist == 9) then
                          hist.Color("col_grow_below")
                      else
                          hist.Color("col_fall_below"));

AddLabel(ShowLabel,
        if hist == 10 then
            if (hist == 10) and (close > fastMA) and (open > fastMA) and (low > fastMA) then
                "Grow Above"
            else
                "Fall Above"
        else
            if (hist == 9) and (close < fastMA) and (open < fastMA) and (high < fastMA) then
                "Grow Below"
            else
                "FallBelow",
        if hist == 10 then
            if (hist == 10) and (close > fastMA) and (open > fastMA) and (low > fastMA) then
                hist.Color("col_grow_above")
            else
                hist.Color("col_fall_above")
        else
            if (hist == 9) and (close < fastMA) and (open < fastMA) and (high < fastMA) then
                hist.Color("col_grow_below")
            else
                hist.Color("col_fall_below")
);








def fall = 1;
plot pFall = fall;
pFall.SetDefaultColor(Color.WHITE);
def upLine = 1;
plot pUp = upLine;
pUp.SetDefaultColor(Color.GREEN);
def downLine = 1;
plot pDown = downLine;
pDown.SetDefaultColor(Color.RED);

def countUp = hist == 10; #color changed
def countDOWN = hist == 9; #color changed
def countFALL = hist == 8; #color changed


def barCount = CompoundValue(1,
     if countFALL and hist[1] != 8 then barCount[1] - barCount[1] + 1 else if countFALL and hist[1] == 8 then barCount[1] + 1
else if CountDOWN and hist[1] != 9 then barCount[1] - barCount[1] + 1 else if countDOWN and hist[1] == 9 then barCount[1] + 1
else if CountUP   and hist[1] != 10 then barCount[1] - barCount[1] + 1 else if countUP   and hist[1] == 10 then barCount[1] + 1
else 0, 0);

plot pBarDownCount = barCount;
pBarDownCount.SetPaintingStrategy(PaintingStrategy.VALUES_ABOVE);
pBarDownCount.AssignValueColor(Color.YELLOW);
 
Here you go.

Python:
# Beep Boop MTF
# Converted from TradingView
# v1 - 20210115 barbaros
# v2 - 20210117 barbaros - Added filter to show only in long term direction
# v3 - 20210121 barbaros - Added MTF, Removed Source

declare lower;
declare zerobase;

input FastLength = 12;                  # Fast Length
input SlowLength = 26;                  # Slow Length
input EMATrend = 50;                    # EMA Trend
input EMAFilter = no;                   # Only show in the direction of the trend
input EMAFilterPeriod = 200;            # EMA Filter Trend Period
input Agg = AggregationPeriod.FIVE_MIN; # Aggregation Period
input SignalLength = 9;                 # Signal Smoothing, minval = 1, maxval = 50
input SMASource = no;                   # Simple MA(Oscillator)
input SMASignal = no;                   # Simple MA(Signal Line)
input ShowLabel = yes;                  # Show indicator label

def fast_ma = if SMASource then SimpleMovingAvg(close(period = Agg), FastLength) else MovAvgExponential(close(period = Agg), FastLength);
def slow_ma = if SMASource then SimpleMovingAvg(close(period = Agg), SlowLength) else MovAvgExponential(close(period = Agg), SlowLength);
def macd = fast_ma - slow_ma;
def signal = if SMASignal then SimpleMovingAvg(macd, SignalLength) else MovAvgExponential(macd, SignalLength);
def histVal = macd - signal;
def fastMA = MovAvgExponential(close(period = Agg), EMATrend);
def longtermMA = MovAvgExponential(close(period = Agg), EMAFilterPeriod);

plot hist = if histVal > 0 and (!EMAFilter or low > longtermMA) then 0.1
            else if histVal < 0  and (!EMAFilter or high < longtermMA) then 0.09
            else if EMAFilter then Double.NaN else histVal;


hist.defineColor("col_grow_above", CreateColor(38, 166, 154));
hist.defineColor("col_grow_below", CreateColor(255, 0, 0));
hist.defineColor("col_fall_above", CreateColor(255, 255, 255));
hist.defineColor("col_fall_below", CreateColor(255, 255, 255));
hist.defineColor("col_macd", CreateColor(0, 148, 255));
hist.defineColor("col_signal", CreateColor(255, 106, 0));

hist.setPaintingStrategy(PaintingStrategy.HISTOGRAM);
hist.assignValueColor(if hist == 0.1 then
                        if (hist == 0.1) and (close > fastMA) and (open > fastMA) and (low > fastMA) then
                            hist.Color("col_grow_above")
                        else
                            hist.Color("col_fall_above")
                      else
                        if (hist == 0.09) and (close < fastMA) and (open < fastMA) and (high < fastMA) then
                            hist.Color("col_grow_below")
                        else
                            hist.Color("col_fall_below"));

AddLabel(ShowLabel,
        if hist == 0.1 then
            if (hist == 0.1) and (close > fastMA) and (open > fastMA) and (low > fastMA) then
                "Grow Above"
            else
                "Fall Above"
        else
            if (hist == 0.09) and (close < fastMA) and (open < fastMA) and (high < fastMA) then
                "Grow Below"
            else
                "FallBelow",
        if hist == 0.1 then
            if (hist == 0.1) and (close > fastMA) and (open > fastMA) and (low > fastMA) then
                hist.Color("col_grow_above")
            else
                hist.Color("col_fall_above")
        else
            if (hist == 0.09) and (close < fastMA) and (open < fastMA) and (high < fastMA) then
                hist.Color("col_grow_below")
            else
                hist.Color("col_fall_below")
);
Hi @barbaros instead of using all of the lower real estate up is it feasible to set up a MTF label for this? Thanks in advance!
 

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
520 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