TOP Ultimate Breakout Indicator for ThinkorSwim

@tradegeek
I’m not sure I getting what you’re saying regarding risk-reward being brutal.

I'm talking about this indicator, the way it is set up, without anything else. It enters on Donchian (3), its stop-loss is around Donchain (20). Not saying this is how you trade, this is purely the way this indicator works without anything else.

As for risking only a few ticks, if you can do that, you are the master. I haven't seen anybody being able to do that consistently in real trading. Even if you're correct on an entry, a typical retrace is more than a few ticks, but if you're doing that, that is great.
 

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

Read my reply and you will understand how I only risk a few ticks and why I stay away from using charts like yours with this indicator. As I've stated above none of my trades has an ATR of 2 or more, while your chart shows 2.89. My chart would never look like that and I will never take such trades and never risk that much on a trade.

It doesn't matter how much a retrace is. If it goes beyond my exit, I'm already out. You don't need to be a master to be profitable in trading. You can lose more times than you win and still be profitable. That is consistency. If it doesn't work for you, then, by all means, change what you're doing. Continue to do the same thing over and over and losing is insanity.

There is no such thing as "purely the way this indicator works". If that is how you think about indicators, good luck! Indicators will respond differently depending on YOUR chart settings.
 
Last edited:
@tradegeek I didn't say I use this indicator. I was just trying to understand how this indicator works using its default settings, and since you've made some interesting claims, I wanted to understand how you use it. That is all.
 
I explained how I use it to hockeydoug in my reply previous which I referenced to you. Read it and placed it on the different charts I mentioned in the same thread. The chart I posted previous for yesterday's session, if taken all of the long signal, you would have had two winning trades and one losing trades. Winners are much larger than losers.
PvPGxAO.png


Look at today's session above. If you followed what I've laid out, you would have profited tremendously as well.

The first trade triggered long but met resistance at the Sell signal exit line (pink) which would have told me to get out there, at break-even, or worst-case at the long exit signal line (blue). So you could have made a little profit, broke-even, or lost 3 points. I would in turn be looking for a short with stops above the resistance there. So next signal is a short signal. If you've taken this short signal to the first target, that would have resulted in about 7.5 points. Then you have some signals in both direction which you would have lose some and win some but the wins would have been bigger than the losses. Look at the 2nd to last long signal where prices had a hard time above the sell exit line (pink). It's telling you to get out or scale out which would have reduce your loss or even still gave you a winner. Then with the last long signal, you could have taken profit around the pink line again and buy in at a better price at the long exit line (cyan) and ride it up through both targets. In my case, I would have gone long agressively right there with a 1-2 tick stop. If I'm wrong, I'm wrong and I stand to lose very little, but if I'm right, then look what happen after that. You could have gotten anywhere from 6-20 points of profit per one contract of profit depending on where you got out. Entering near the blue line could have resulted in you risking about 2-4 ticks and earning 40 ticks or more. That's about 40x the risks. Now tell me how I'm not risking a few ticks again?

It can be cluttering with both signals. In that case, just take one direction and wait for trade to happen. Use other indicators to help you filter which ones to take if that helps you. When markets are choppy, just scale our or get out near the channels and/or take trades near the channels (exit lines). Notice how price respected the exit lines (cyan and pink) as support and resistance. Look at the last leg up. Price continues to pierce and close above the sell exit line (pink). In that case, keep riding the momentum.
 
Last edited:
Very interesting @tradegeek . What do you do when you're in the middle of a short trade (for instance) and you get hit with a buy trade signal? And, do you always use the 3200t chart?...or do you use other tick chart trade frames?
 
@tradegeek is it possible instead of having so many prices on chart....only have the lines ..white yellow blue pink thanks... nice chart


@whats up Per your request, I have added a user input selector "ShowEntryExitBands" that when set to "no" via the user interface, you will only see the white yellow blue pink target lines. Here is version 1.4 that incorporates that. The default setting is "yes" as most folks would like to have the bands visible on the chart

Code:
# Top Ultimate Breakout Indicator
# tomsk
# 1.16.2020

# V1.0 - 12.08.2019 - hoojsn - Initial release of Top Ultimate Breakout Indicator (syntax errors)
# V1.1 - 12.08.2019 - tomsk  - Cleared all syntax errors from initial hoojsn release
# V1.2 - 12.31.2019 - tomsk  - Removed all extraneous logic and variables not used by the study
# V1.3 - 01.02.2020 - tomsk  - Added ShowTodayOnly input selector to display current intraday levels
# V1.4 - 01.16.2020 - tomsk  - Added ShowEntryExitBands input selector, can be set to "no"

# http://www.coinerpals.com/download-top-trade-tools-top-ultimate-breakout/
# https://bestforexfeatured.com/product/toptradetools-ultimate-breakout/

input BuyorSell = {default Buy, Sell};
input ShowTodayOnly = yes;
input ShowEntryExitBands = yes;
input BuyEntry = 3;
input SellEntry = 3;
input BuyExit = 20;
input SellExit = 20;

input ATRLength = 50;
input TargetATRMult = 1;
input DisplayLines = yes;
input PriceDigit = 2;

def today = !showTodayOnly or getDay() == getLastDay() and SecondsFromTime(0930) >= 0;

# High

def H1  = Highest(high, SellExit);
def H2  = fold i = 1 to SellExit
          with ip = 0.0
          do if GetValue(high, i) == H1 or GetValue(high, i) < ip
             then ip
             else GetValue(high, i);
def H3  = fold i1 = 1 to SellExit
          with ip1 = 0.0
          do if GetValue(high, i1) == H1 or GetValue(high, i1) == H2 or GetValue(high, i1) < ip1
             then ip1
             else GetValue(high, i1);
def HH  = (H2 + H3) / 2.0;

# Low

def L1  = Lowest(low, BuyExit);
def L2  = fold i2 = 1 to BuyExit
          with ip2 = 10000000.0
          do if GetValue(low, i2) == L1 or GetValue(low, i2) > ip2
             then ip2
             else GetValue(low, i2);
def L3  = Lowest(if low == L1 or low == L2 then 1000000 else low, BuyExit);
def LL  = (L2 + L2) / 2.0;

def QB = Highest(high, BuyEntry);
def QS = Lowest(low, SellEntry);

def ATRVal = ATR(length = ATRLength, averageType= AverageType.SIMPLE);
def mATR = Highest(ATRVal, ATRLength);

plot entry;
plot exit;

def EntryPr;
def pos;
def co = BarNumber() > Max(SellExit, BuyExit);

switch (BuyorSell) {

case Buy:
    entry = QB[1];
    exit = LL[1];
    pos = if co and high > QB[1] then 1 else if low < LL[1] then 0 else pos[1];
    EntryPr = if high > QB[1] and pos == 1 and pos[1] < 1
              then QB[1]
              else if pos == 0
                  then Double.NaN
              else EntryPr[1];
case Sell:
    entry = QS[1];
    exit = HH[1];
    pos = if co and low < QS[1] then -1 else if high[1] > HH[2] then 0 else pos[1];
    EntryPr = if low < QS[1] and pos == -1 and pos[1] > -1
              then QS[1]
              else if pos == 0
                  then Double.NaN
              else EntryPr[1];
}
entry.AssignValueColor(if BuyorSell == BuyorSell.Buy then Color.GREEN
                       else if BuyorSell == BuyorSell.Sell then Color.RED
                       else Color.CURRENT);
entry.SetHiding(!ShowEntryExitBands);
exit.SetDefaultColor(Color.CYAN);
exit.SetHiding(!ShowEntryExitBands);

def BTarget;
def BTarget2;
def EntryLine;
def TradeRisk;

switch (BuyorSell) {

case Buy:
    BTarget  = if pos == 1 and pos[1] < 1
                   then (EntryPr + (TargetATRMult * 2 * mATR))
               else if pos == 1
                   then BTarget[1]
               else Double.NaN;
    BTarget2 = if pos == 1 and pos[1] < 1
                   then (EntryPr + 2 * (TargetATRMult * 2 * mATR))
               else if pos == 1
                   then BTarget2[1]
               else Double.NaN;
    EntryLine = if LL < EntryPr then EntryPr else Double.NaN;
    TradeRisk = (EntryPr - LL) / mATR;

case Sell:
    BTarget  = if pos == -1 and pos[1] > -1
                   then (EntryPr - (TargetATRMult * 2 * mATR))
               else if pos == -1
                   then BTarget[1]
               else Double.NaN;
    BTarget2 = if pos == -1 and pos[1] > -1
                   then (EntryPr - 2 * (TargetATRMult * 2 * mATR))
               else if pos == -1
                   then BTarget2[1]
               else Double.NaN;
    EntryLine = if HH > EntryPr then EntryPr else Double.NaN;
    TradeRisk = (HH - EntryPr ) / mATR;
}

plot pBTarget = if today and DisplayLines and co then BTarget else Double.NaN;
pBTarget.SetDefaultColor(Color.YELLOW);

plot pBTarget2 = if today and DisplayLines and co then BTarget2 else Double.NaN;
pBTarget2.SetDefaultColor(Color.MAGENTA);

plot pEntryLine = if today and DisplayLines and co then EntryLine else Double.NaN;
pEntryLine.SetDefaultColor(Color.WHITE);

def valco = DisplayLines and co and (pos == 1 or pos == -1) and pos[1] == 0;
def rBTarget = Round(BTarget, PriceDigit);
def rBTarget2 = Round(BTarget2, PriceDigit);
def rEntryPr = Round(EntryPr, PriceDigit);

AddChartBubble(today and valco, BTarget, rBTarget, Color.YELLOW);
AddChartBubble(today and valco, BTarget2, rBTarget2, Color.MAGENTA);
AddChartBubble(today and valco, EntryPr, rEntryPr, Color.WHITE);

def exv=if BuyorSell == BuyorSell.Buy then LL else HH;
def rexv = Round(exv, PriceDigit);
def rTradeRisk = Round(TradeRisk, PriceDigit);

AddChartBubble(today and valco, exv, rexv + "(" + rTradeRisk + "ATR)", Color.CYAN);
# End Top Ultimate Breakout Indicator
 
Thanks to @hockeycoachdoug for his post on Jan 2 which included a question about determining directional bias. That got me thinking...and I've made some mods to this setup. Maybe it will help someone know which buy or sell signals to go with or to reject. (NOTE: I have not kept up with the code modifications made by @tomsk and others AND I've made my own modifications to the code myself. So, if you do download this flexible grid, know that the "TOP_Ultimate_Breakout" may be quite different than what you might already be using.)

Here's what I've done:

  1. Since having buy and sell signals on the same chart was just too busy for me, I run two identical charts side by side. The left chart is the "buy/long" chart and the right chart is the "sell/short" chart. These have been made into two separate indicators (Top_Ultimate_Breakout_BUY and Top_Ultimate_Breakout_SELL.) . The 'buy' indicator has had the buy alert label changed to green and the 'sell' indicator has had the sell alert label changed to red.

  2. As far as the directional bias is concerned, there are 3 ways to see if it is safe to get into the trade. First, the TrendMomentumCycle indicator (name I gave it) paints the candles red or green depending on trend (to be honest, I disregard all of the labels across the top of the chart). NOTE: I think this TMC indicator is named something else by many of you who use it. It is the same indicator found at

    #trend, a momentum and a cycle based indicator for ThinkorSwim V1.0
    #@hockeycoachdoug Community Request
    #
    #VERSION
    # 2019.12.31 V1.2 @diazlaz - Integrated FREMA
    # 2019.12.30 V1.1 @diazlaz - Labels
    # 2019.12.30 V1.0 @diazlaz - Community Ask/Release
    #
    #LINK
    #https://usethinkscript.com/threads/i-request-help-combining-3-indicators-into-1-paintbar-study.1390/

  3. The second way to confirm direction is with the 10EMA , which is magenta when trending down and cyan when trending up. If the 10EMA is cyan (up) AND green candles are now closing above the 10 EMA, this is a long confirmation. Vice versa for shorts.

  4. The third way to confirm direction is with the MACD shown below the chart. The settings are 15, 50, 5 and the MACD line is displayed as a magenta histogram. The Avg/Signal line is cyan and the diff histogram is not displayed. When the MACD histogram is running above the cyan signal line, this is a long confirmation. Vice versa for shorts.

  5. An extra bit of confirmation is with the 50 SMA (which is the line that changes green and red). Generally, the 50SMA is a fairly good indicator of short term direction and, again generally, it is safest to take trades that coincide with its direction. Of course, living by taking only trades in the direction of the 50SMA you will miss out on a lot of good scalps.
Now, take a look at the image i posted. On the left hand chart, the first green buy label is risky because the MACD and the 10EMA are still indicating 'short'. The second green buy label (just a few minutes later) shows that the MACD and the 10EMA have turned up with candles closing above (confirmation) and this is good for a 4 point scalp. The 3rd green buy signal is an obvious reject. And the 4th green buy signal turns into a 5 point win being confirmed within a candle or two. On the right hand side, the short side, the first red sell label is choppy for awhile and then the confirmation comes....but only after about 20 candles. The second red sell label is a golden ticket with all confirmations firing at the same time as the sell signal....including the 50SMA.

Here's the link to the flexible grid: https://tos.mx/F0ix1CA

74res7f.jpg
 
Last edited:
There sure are lots of variations to user preferences regarding this study. For those that wish to turn the bubbles off, here is version 1,5 of the code - I've added a ShowBubbles input selector, to enable users to toggle the display of bubbles from the user interface. By default the study will display bubbles. For those not conversant with code structure, there is no need to mess with code.

Code:
# Top Ultimate Breakout Indicator
# tomsk
# 1.22.2020

# V1.0 - 12.08.2019 - hoojsn - Initial release of Top Ultimate Breakout Indicator (syntax errors)
# V1.1 - 12.08.2019 - tomsk  - Cleared all syntax errors from initial hoojsn release
# V1.2 - 12.31.2019 - tomsk  - Removed all extraneous logic and variables not used by the study
# V1.3 - 01.02.2020 - tomsk  - Added ShowTodayOnly input selector to display current intraday levels
# V1.4 - 01.16.2020 - tomsk  - Added ShowEntryExitBands input selector, can be set to "no"
# v1.5 - 01.22.2020 - tomsk  - Added ShowBubbles input selector, to toggle display of bubbles

# http://www.coinerpals.com/download-top-trade-tools-top-ultimate-breakout/
# https://bestforexfeatured.com/product/toptradetools-ultimate-breakout/

input BuyorSell = {default Buy, Sell};
input ShowTodayOnly = yes;
input ShowEntryExitBands = yes;
input ShowBubbles = yes;
input BuyEntry = 3;
input SellEntry = 3;
input BuyExit = 20;
input SellExit = 20;

input ATRLength = 50;
input TargetATRMult = 1;
input DisplayLines = yes;
input PriceDigit = 2;

def today = !showTodayOnly or getDay() == getLastDay() and SecondsFromTime(0930) >= 0;

# High

def H1  = Highest(high, SellExit);
def H2  = fold i = 1 to SellExit 
          with ip = 0.0 
          do if GetValue(high, i) == H1 or GetValue(high, i) < ip 
             then ip 
             else GetValue(high, i);
def H3  = fold i1 = 1 to SellExit 
          with ip1 = 0.0 
          do if GetValue(high, i1) == H1 or GetValue(high, i1) == H2 or GetValue(high, i1) < ip1 
             then ip1 
             else GetValue(high, i1);
def HH  = (H2 + H3) / 2.0;

# Low

def L1  = Lowest(low, BuyExit);
def L2  = fold i2 = 1 to BuyExit 
          with ip2 = 10000000.0 
          do if GetValue(low, i2) == L1 or GetValue(low, i2) > ip2 
             then ip2 
             else GetValue(low, i2);
def L3  = Lowest(if low == L1 or low == L2 then 1000000 else low, BuyExit);
def LL  = (L2 + L2) / 2.0;

def QB = Highest(high, BuyEntry);
def QS = Lowest(low, SellEntry);

def ATRVal = ATR(length = ATRLength, averageType= AverageType.SIMPLE);
def mATR = Highest(ATRVal, ATRLength);

plot entry;
plot exit;

def EntryPr;
def pos;
def co = BarNumber() > Max(SellExit, BuyExit);

switch (BuyorSell) {

case Buy:
    entry = QB[1];
    exit = LL[1];
    pos = if co and high > QB[1] then 1 else if low < LL[1] then 0 else pos[1];
    EntryPr = if high > QB[1] and pos == 1 and pos[1] < 1 
              then QB[1] 
              else if pos == 0 
                  then Double.NaN 
              else EntryPr[1];
case Sell:
    entry = QS[1];
    exit = HH[1];
    pos = if co and low < QS[1] then -1 else if high[1] > HH[2] then 0 else pos[1];
    EntryPr = if low < QS[1] and pos == -1 and pos[1] > -1 
              then QS[1] 
              else if pos == 0 
                  then Double.NaN 
              else EntryPr[1];
}
entry.AssignValueColor(if BuyorSell == BuyorSell.Buy then Color.GREEN 
                       else if BuyorSell == BuyorSell.Sell then Color.RED 
                       else Color.CURRENT);
entry.SetHiding(!ShowEntryExitBands);
exit.SetDefaultColor(Color.CYAN);
exit.SetHiding(!ShowEntryExitBands);

def BTarget;
def BTarget2;
def EntryLine;
def TradeRisk;

switch (BuyorSell) {

case Buy:
    BTarget  = if pos == 1 and pos[1] < 1 
                   then (EntryPr + (TargetATRMult * 2 * mATR)) 
               else if pos == 1 
                   then BTarget[1] 
               else Double.NaN;
    BTarget2 = if pos == 1 and pos[1] < 1 
                   then (EntryPr + 2 * (TargetATRMult * 2 * mATR)) 
               else if pos == 1 
                   then BTarget2[1] 
               else Double.NaN;
    EntryLine = if LL < EntryPr then EntryPr else Double.NaN;
    TradeRisk = (EntryPr - LL) / mATR;

case Sell:
    BTarget  = if pos == -1 and pos[1] > -1 
                   then (EntryPr - (TargetATRMult * 2 * mATR)) 
               else if pos == -1 
                   then BTarget[1] 
               else Double.NaN;
    BTarget2 = if pos == -1 and pos[1] > -1 
                   then (EntryPr - 2 * (TargetATRMult * 2 * mATR)) 
               else if pos == -1 
                   then BTarget2[1] 
               else Double.NaN;
    EntryLine = if HH > EntryPr then EntryPr else Double.NaN;
    TradeRisk = (HH - EntryPr ) / mATR;
}

plot pBTarget = if today and DisplayLines and co then BTarget else Double.NaN;
pBTarget.SetDefaultColor(Color.YELLOW);

plot pBTarget2 = if today and DisplayLines and co then BTarget2 else Double.NaN;
pBTarget2.SetDefaultColor(Color.MAGENTA);

plot pEntryLine = if today and DisplayLines and co then EntryLine else Double.NaN;
pEntryLine.SetDefaultColor(Color.WHITE);

def valco = DisplayLines and co and (pos == 1 or pos == -1) and pos[1] == 0;
def rBTarget = Round(BTarget, PriceDigit);
def rBTarget2 = Round(BTarget2, PriceDigit);
def rEntryPr = Round(EntryPr, PriceDigit);

AddChartBubble(ShowBubbles and today and valco, BTarget, rBTarget, Color.YELLOW);
AddChartBubble(ShowBubbles and today and valco, BTarget2, rBTarget2, Color.MAGENTA);
AddChartBubble(ShowBubbles and today and valco, EntryPr, rEntryPr, Color.WHITE);

def exv=if BuyorSell == BuyorSell.Buy then LL else HH;
def rexv = Round(exv, PriceDigit);
def rTradeRisk = Round(TradeRisk, PriceDigit);

AddChartBubble(ShowBubbles and today and valco, exv, rexv + "(" + rTradeRisk + "ATR)", Color.CYAN);
# End Top Ultimate Breakout Indicator
 
@tomsk - amazing work on this! Seems to work well on a 1min chart from the testing i've done.

I have noticed a few things that i have tried to correct on my own but may need some assistance.

1. I am noticing that the only way a new signal will be created is if the high/low crosses the Exit band. Is there a way to stop the lines from showing if the target points are met? See below. The 2nd signal of the day is met when it crosses the purple line but no signals can be created for 45 minutes after because the target lines still exist.
item


2. If there is a large gap up/down from the previous day, the opening initial signal is weird. See below. The initial 9:30 candle creates a signal and the open is well above. This throws off the following potential trade options as the #1 reason above would apply.
item



just some additional info in case someone asks. I combined this indicator with the supertrend. Signals will only be triggered if Breakout_signals are met and supertrend is green (for buy signals). I use 1.2mATR, 4.0, HULL for my ST. This seems to weed out some of the false signals even further.
 
Here is my adjustment,......, using price and my Volstops......
gqrgWsS.jpg
,.............and I included my chart with studies......https://tos.mx/8s08XAh
I know anything less than 5 minutes is noise and try not to allow anymore than I can.......
 
I like it,....your adjustments, 1.2mATR, 4.0Hull,....cannot find that in the script?........

I coded in the Supertrend myself. I'm still backtesting it but seems to show good results. Below is my code how it stands today -- keep in mind this is still a work in progress. I've only looked at it for long positions at the moment.

today i'm 3 winners out of 4.

Code:
# Top Ultimate Breakout Indicator
# tomsk
# 1.22.2020

# V1.0 - 12.08.2019 - hoojsn - Initial release of Top Ultimate Breakout Indicator (syntax errors)
# V1.1 - 12.08.2019 - tomsk  - Cleared all syntax errors from initial hoojsn release
# V1.2 - 12.31.2019 - tomsk  - Removed all extraneous logic and variables not used by the study
# V1.3 - 01.02.2020 - tomsk  - Added ShowTodayOnly input selector to display current intraday levels
# V1.4 - 01.16.2020 - tomsk  - Added ShowEntryExitBands input selector, can be set to "no"
# v1.5 - 01.22.2020 - tomsk  - Added ShowBubbles input selector, to toggle display of bubbles

## Added supertrend - RCONNER7 03.30.2020 ##

# http://www.coinerpals.com/download-top-trade-tools-top-ultimate-breakout/
# https://bestforexfeatured.com/product/toptradetools-ultimate-breakout/

input BuyorSell = {default Buy, Sell};
input ShowTodayOnly = yes;
input ShowEntryExitBands = yes;
input ShowBubbles = yes;
input BuyEntry = 3;
input SellEntry = 3;
input BuyExit = 20;
input SellExit = 20;

input ATRLength = 50;
input TargetATRMult = 1;
input DisplayLines = yes;
input PriceDigit = 2;
#input OpenTime = 0940;
#input CloseTime = 1550;
#input notrades = 1550;
#def OpenGood = SecondsFromTime(OpenTime) >= 0 and SecondstillTime(notrades) >= 0;
#def CloseAllCondition = SecondstillTime(CloseTime) == 0;

def today = !showTodayOnly or getDay() == getLastDay() and SecondsFromTime(0930) >= 0;

# SuperTrend - YAHOO Finance ver.
input AtrMult = 1.2;
input nATR = 4;
input AvgType = AverageType.HULL;
input PaintBars = yes;

def ATR = ATR("length" = nATR, "average type" = AvgType);
def UP_Band_Basic = HL2 + (AtrMult * ATR);

def LW_Band_Basic = HL2 + (-AtrMult * ATR);

def UP_Band = if ((UP_Band_Basic < UP_Band[1]) or (close[1] > UP_Band[1])) then UP_Band_Basic else UP_Band[1];

def LW_Band = if ((LW_Band_Basic > LW_Band[1]) or (close[1] < LW_Band[1])) then LW_Band_Basic else LW_Band[1];

def ST = if ((ST[1] == UP_Band[1]) and (close < UP_Band)) then UP_Band else if ((ST[1] == UP_Band[1]) and (close > Up_Band)) then LW_Band else if ((ST[1] == LW_Band[1]) and (close > LW_Band)) then LW_Band else if ((ST[1] == LW_Band) and (close < LW_Band)) then UP_Band else LW_Band;

def ST_UP = ST < close;
def ST_DN = ST > close;

# High

def H1  = Highest(high, SellExit);
def H2  = fold i = 1 to SellExit
          with ip = 0.0
          do if GetValue(high, i) == H1 or GetValue(high, i) < ip
             then ip
             else GetValue(high, i);
def H3  = fold i1 = 1 to SellExit
          with ip1 = 0.0
          do if GetValue(high, i1) == H1 or GetValue(high, i1) == H2 or GetValue(high, i1) < ip1
             then ip1
             else GetValue(high, i1);
def HH  = (H2 + H3) / 2.0;

# Low

def L1  = Lowest(low, BuyExit);
def L2  = fold i2 = 1 to BuyExit
          with ip2 = 10000000.0
          do if GetValue(low, i2) == L1 or GetValue(low, i2) > ip2
             then ip2
             else GetValue(low, i2);
def L3  = Lowest(if low == L1 or low == L2 then 1000000 else low, BuyExit);
def LL  = (L2 + L2) / 2.0;

def QB = Highest(high, BuyEntry);
def QS = Lowest(low, SellEntry);

def ATRVal = ATR(length = ATRLength, averageType= AverageType.SIMPLE);
def mATR = Highest(ATRVal, ATRLength);


plot entry;
plot exit;

def EntryPr;
def pos;
def co = BarNumber() > Max(SellExit, BuyExit);

switch (BuyorSell) {

case Buy:
    entry = QB[1];
    exit = LL[1];
    pos = if ST_UP and co and high > QB[1] then 1 else if low < LL[1] then 0 else pos[1];
    EntryPr = if high > QB[1] and pos == 1 and pos[1] < 1
              then QB[1]
              else if pos == 0
                  then Double.NaN
              else EntryPr[1];
case Sell:
    entry = QS[1];
    exit = HH[1];
    pos = if ST_DN and co and low < QS[1] then -1 else if high[1] > HH[2] then 0 else pos[1];
    EntryPr = if low < QS[1] and pos == -1 and pos[1] > -1
              then QS[1]
              else if pos == 0
                  then Double.NaN
              else EntryPr[1];
}
entry.AssignValueColor(if BuyorSell == BuyorSell.Buy then Color.GREEN
                       else if BuyorSell == BuyorSell.Sell then Color.RED
                       else Color.CURRENT);
entry.SetHiding(!ShowEntryExitBands);
exit.SetDefaultColor(Color.CYAN);
exit.SetHiding(!ShowEntryExitBands);

def BTarget;
def BTarget2;
def EntryLine;
def TradeRisk;

switch (BuyorSell) {

case Buy:
    BTarget  = if pos == 1 and pos[1] < 1
                   then (EntryPr + (TargetATRMult * 2 * mATR))
               else if pos == 1
                   then BTarget[1]
               else Double.NaN;
    BTarget2 = if pos == 1 and pos[1] < 1
                   then (EntryPr + 2 * (TargetATRMult * 2 * mATR))
               else if pos == 1
                   then BTarget2[1]
               else Double.NaN;
    EntryLine = if LL < EntryPr then EntryPr else Double.NaN;
    TradeRisk = (EntryPr - LL) / mATR;

case Sell:
    BTarget  = if pos == -1 and pos[1] > -1
                   then (EntryPr - (TargetATRMult * 2 * mATR))
               else if pos == -1
                   then BTarget[1]
               else Double.NaN;
    BTarget2 = if pos == -1 and pos[1] > -1
                   then (EntryPr - 2 * (TargetATRMult * 2 * mATR))
               else if pos == -1
                   then BTarget2[1]
               else Double.NaN;
    EntryLine = if HH > EntryPr then EntryPr else Double.NaN;
    TradeRisk = (HH - EntryPr ) / mATR;
}

plot pBTarget = if today and DisplayLines and co then BTarget else Double.NaN;
pBTarget.SetDefaultColor(Color.YELLOW);

plot pBTarget2 = if today and DisplayLines and co then BTarget2 else Double.NaN;
pBTarget2.SetDefaultColor(Color.MAGENTA);

plot pEntryLine = if today and DisplayLines and co then EntryLine else Double.NaN;
pEntryLine.SetDefaultColor(Color.WHITE);

def valco = DisplayLines and co and (pos == 1 or pos == -1) and pos[1] == 0;
def rBTarget = Round(BTarget, PriceDigit);
def rBTarget2 = Round(BTarget2, PriceDigit);
def rEntryPr = Round(EntryPr, PriceDigit);

AddChartBubble(ShowBubbles and today and valco, BTarget, rBTarget, Color.YELLOW);
AddChartBubble(ShowBubbles and today and valco, BTarget2, rBTarget2, Color.MAGENTA);
AddChartBubble(ShowBubbles and today and valco, EntryPr, rEntryPr, Color.WHITE);

def exv=if BuyorSell == BuyorSell.Buy then LL else HH;
def rexv = Round(exv, PriceDigit);
def rTradeRisk = Round(TradeRisk, PriceDigit);

AddChartBubble(ShowBubbles and today and valco, exv, rexv + "(" + rTradeRisk + "ATR)", Color.CYAN);
# End Top Ultimate Breakout Indicator
 
I coded in the Supertrend myself. I'm still backtesting it but seems to show good results. Below is my code how it stands today -- keep in mind this is still a work in progress. I've only looked at it for long positions at the moment.

today i'm 3 winners out of 4.

Code:
# Top Ultimate Breakout Indicator
# tomsk
# 1.22.2020

# V1.0 - 12.08.2019 - hoojsn - Initial release of Top Ultimate Breakout Indicator (syntax errors)
# V1.1 - 12.08.2019 - tomsk  - Cleared all syntax errors from initial hoojsn release
# V1.2 - 12.31.2019 - tomsk  - Removed all extraneous logic and variables not used by the study
# V1.3 - 01.02.2020 - tomsk  - Added ShowTodayOnly input selector to display current intraday levels
# V1.4 - 01.16.2020 - tomsk  - Added ShowEntryExitBands input selector, can be set to "no"
# v1.5 - 01.22.2020 - tomsk  - Added ShowBubbles input selector, to toggle display of bubbles

## Added supertrend - RCONNER7 03.30.2020 ##

# http://www.coinerpals.com/download-top-trade-tools-top-ultimate-breakout/
# https://bestforexfeatured.com/product/toptradetools-ultimate-breakout/

input BuyorSell = {default Buy, Sell};
input ShowTodayOnly = yes;
input ShowEntryExitBands = yes;
input ShowBubbles = yes;
input BuyEntry = 3;
input SellEntry = 3;
input BuyExit = 20;
input SellExit = 20;

input ATRLength = 50;
input TargetATRMult = 1;
input DisplayLines = yes;
input PriceDigit = 2;
#input OpenTime = 0940;
#input CloseTime = 1550;
#input notrades = 1550;
#def OpenGood = SecondsFromTime(OpenTime) >= 0 and SecondstillTime(notrades) >= 0;
#def CloseAllCondition = SecondstillTime(CloseTime) == 0;

def today = !showTodayOnly or getDay() == getLastDay() and SecondsFromTime(0930) >= 0;

# SuperTrend - YAHOO Finance ver.
input AtrMult = 1.2;
input nATR = 4;
input AvgType = AverageType.HULL;
input PaintBars = yes;

def ATR = ATR("length" = nATR, "average type" = AvgType);
def UP_Band_Basic = HL2 + (AtrMult * ATR);

def LW_Band_Basic = HL2 + (-AtrMult * ATR);

def UP_Band = if ((UP_Band_Basic < UP_Band[1]) or (close[1] > UP_Band[1])) then UP_Band_Basic else UP_Band[1];

def LW_Band = if ((LW_Band_Basic > LW_Band[1]) or (close[1] < LW_Band[1])) then LW_Band_Basic else LW_Band[1];

def ST = if ((ST[1] == UP_Band[1]) and (close < UP_Band)) then UP_Band else if ((ST[1] == UP_Band[1]) and (close > Up_Band)) then LW_Band else if ((ST[1] == LW_Band[1]) and (close > LW_Band)) then LW_Band else if ((ST[1] == LW_Band) and (close < LW_Band)) then UP_Band else LW_Band;

def ST_UP = ST < close;
def ST_DN = ST > close;

# High

def H1  = Highest(high, SellExit);
def H2  = fold i = 1 to SellExit
          with ip = 0.0
          do if GetValue(high, i) == H1 or GetValue(high, i) < ip
             then ip
             else GetValue(high, i);
def H3  = fold i1 = 1 to SellExit
          with ip1 = 0.0
          do if GetValue(high, i1) == H1 or GetValue(high, i1) == H2 or GetValue(high, i1) < ip1
             then ip1
             else GetValue(high, i1);
def HH  = (H2 + H3) / 2.0;

# Low

def L1  = Lowest(low, BuyExit);
def L2  = fold i2 = 1 to BuyExit
          with ip2 = 10000000.0
          do if GetValue(low, i2) == L1 or GetValue(low, i2) > ip2
             then ip2
             else GetValue(low, i2);
def L3  = Lowest(if low == L1 or low == L2 then 1000000 else low, BuyExit);
def LL  = (L2 + L2) / 2.0;

def QB = Highest(high, BuyEntry);
def QS = Lowest(low, SellEntry);

def ATRVal = ATR(length = ATRLength, averageType= AverageType.SIMPLE);
def mATR = Highest(ATRVal, ATRLength);


plot entry;
plot exit;

def EntryPr;
def pos;
def co = BarNumber() > Max(SellExit, BuyExit);

switch (BuyorSell) {

case Buy:
    entry = QB[1];
    exit = LL[1];
    pos = if ST_UP and co and high > QB[1] then 1 else if low < LL[1] then 0 else pos[1];
    EntryPr = if high > QB[1] and pos == 1 and pos[1] < 1
              then QB[1]
              else if pos == 0
                  then Double.NaN
              else EntryPr[1];
case Sell:
    entry = QS[1];
    exit = HH[1];
    pos = if ST_DN and co and low < QS[1] then -1 else if high[1] > HH[2] then 0 else pos[1];
    EntryPr = if low < QS[1] and pos == -1 and pos[1] > -1
              then QS[1]
              else if pos == 0
                  then Double.NaN
              else EntryPr[1];
}
entry.AssignValueColor(if BuyorSell == BuyorSell.Buy then Color.GREEN
                       else if BuyorSell == BuyorSell.Sell then Color.RED
                       else Color.CURRENT);
entry.SetHiding(!ShowEntryExitBands);
exit.SetDefaultColor(Color.CYAN);
exit.SetHiding(!ShowEntryExitBands);

def BTarget;
def BTarget2;
def EntryLine;
def TradeRisk;

switch (BuyorSell) {

case Buy:
    BTarget  = if pos == 1 and pos[1] < 1
                   then (EntryPr + (TargetATRMult * 2 * mATR))
               else if pos == 1
                   then BTarget[1]
               else Double.NaN;
    BTarget2 = if pos == 1 and pos[1] < 1
                   then (EntryPr + 2 * (TargetATRMult * 2 * mATR))
               else if pos == 1
                   then BTarget2[1]
               else Double.NaN;
    EntryLine = if LL < EntryPr then EntryPr else Double.NaN;
    TradeRisk = (EntryPr - LL) / mATR;

case Sell:
    BTarget  = if pos == -1 and pos[1] > -1
                   then (EntryPr - (TargetATRMult * 2 * mATR))
               else if pos == -1
                   then BTarget[1]
               else Double.NaN;
    BTarget2 = if pos == -1 and pos[1] > -1
                   then (EntryPr - 2 * (TargetATRMult * 2 * mATR))
               else if pos == -1
                   then BTarget2[1]
               else Double.NaN;
    EntryLine = if HH > EntryPr then EntryPr else Double.NaN;
    TradeRisk = (HH - EntryPr ) / mATR;
}

plot pBTarget = if today and DisplayLines and co then BTarget else Double.NaN;
pBTarget.SetDefaultColor(Color.YELLOW);

plot pBTarget2 = if today and DisplayLines and co then BTarget2 else Double.NaN;
pBTarget2.SetDefaultColor(Color.MAGENTA);

plot pEntryLine = if today and DisplayLines and co then EntryLine else Double.NaN;
pEntryLine.SetDefaultColor(Color.WHITE);

def valco = DisplayLines and co and (pos == 1 or pos == -1) and pos[1] == 0;
def rBTarget = Round(BTarget, PriceDigit);
def rBTarget2 = Round(BTarget2, PriceDigit);
def rEntryPr = Round(EntryPr, PriceDigit);

AddChartBubble(ShowBubbles and today and valco, BTarget, rBTarget, Color.YELLOW);
AddChartBubble(ShowBubbles and today and valco, BTarget2, rBTarget2, Color.MAGENTA);
AddChartBubble(ShowBubbles and today and valco, EntryPr, rEntryPr, Color.WHITE);

def exv=if BuyorSell == BuyorSell.Buy then LL else HH;
def rexv = Round(exv, PriceDigit);
def rTradeRisk = Round(TradeRisk, PriceDigit);

AddChartBubble(ShowBubbles and today and valco, exv, rexv + "(" + rTradeRisk + "ATR)", Color.CYAN);
# End Top Ultimate Breakout Indicator
Will this show buy and sell or do i need to set up 2 charts side by side like before
 
Will this show buy and sell or do i need to set up 2 charts side by side like before

You could add the indicator twice on the same chart. Set one to Sell and one to Buy. I would change the line colors for each to help distinguish between them.
 
Thank You thats the one I have

What is your experience so far?

Sometimes, the callout happens before the bar color and the MACD confirms, and by the time this is confirmed it is too late.

I am finding the entries difficult to time correctly. One setup I noticed that helps is when a buy or sell bubble appears, the current bar needs to close below the buy and above the sell. Then, you get ready for the entry price that is in the bubble and MACD to cross over, if the acceleration is towards the bubble price, then you place your order.

Watching it live makes me think this is intended to be used without confirmation. When it calls, you enter the market and place your stop loss. As it progresses, you find your exit. @RickKennedy, @hoojsn, and @BenTen, what are your thoughts?
 
Last edited:
What is your experience so far?

Sometimes, the callout happens before the bar color and the MACD confirms, and by the time this is confirmed it is too late.

I am finding the entries difficult to time correctly. One setup I noticed that helps is when a buy or sell bubble appears, the current bar needs to close below the buy and above the sell. Then, you get ready for the entry price that is in the bubble and MACD to cross over, if the acceleration is towards the bubble price, then you place your order.

Watching it live makes me think this is intended to be used without confirmation. When it calls, you enter the market and place your stop loss. As it progresses, you find your exit. @RickKennedy, @hoojsn, and @BenTen, what are your thoughts?
I agree still trying to fine tune with timeframes it does work but not all the time
 
FIRST POST at UTS!

Came across this thread and incorporated Tomsk's version where you can hide price bubbles.

Anyway, I have been using super trend (gives you price in bubble) along with trend reversal (green & red bubbles) for 2 or 3 weeks now and those two combined on 1m chart and 10m chart are good for entry and exits. After adding breakout ultimate indicator, things get confusing for me...

So the question I have (trying to pick up pointers), you guys test out scripts and are gifted in this field of coding. Is there an advantage of using/incorporating this script with those 2 (mentioned above).

Would you guys advice another script that would further make a case for confident entry and exit on 1m chart &/or 10m chart. That I can incorporate along with super trend and trend reversal

Thank you All!
 
FIRST POST at UTS!

Came across this thread and incorporated Tomsk's version where you can hide price bubbles.

Anyway, I have been using super trend (gives you price in bubble) along with trend reversal (green & red bubbles) for 2 or 3 weeks now and those two combined on 1m chart and 10m chart are good for entry and exits. After adding breakout ultimate indicator, things get confusing for me...

So the question I have (trying to pick up pointers), you guys test out scripts and are gifted in this field of coding. Is there an advantage of using/incorporating this script with those 2 (mentioned above).

Would you guys advice another script that would further make a case for confident entry and exit on 1m chart &/or 10m chart. That I can incorporate along with super trend and trend reversal

Thank you All!
I changes the 10 ema to an 8 try that which super trend do you have
 
trend reversal
https://usethinkscript.com/threads/trend-reversal-indicator-with-signals-for-thinkorswim.183/
super trend
https://usethinkscript.com/threads/supertrend-indicator-by-mobius-for-thinkorswim.7/
I use them both on 1m & 10m chart side by side, to see up/downward trend. Gets a better idea, I did try to use Trend quality on 10m, and benten's trend magic as well...though, I decided to run rsi5ma on 10m.

@Billions can you compare the two strategies?

I have been watching the breakout indicator on the side today. It does have false triggers, but it seems like it expects you to take all of them and cumulatively it will be positive at the end of the day. It will be nice to figure out how to filter out the false triggers, or show a confidence score so we can make the choice to take the risk or not.
 
Last edited by a moderator:

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

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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