TOP Ultimate Breakout Indicator for ThinkorSwim

hoojsn

New member
I am new here. This indicator is called TOP Ultimate Breakout from TopTradeTools. Need your help with the following script for TOS. I have found it from some other place. When it comes to adding it to TOS Script there was an error "Invalid Statement at 134:1."

mod note: updated code in next post
 
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

@hoojsn Load the following code, I have cleaned it up for you so that the editor no longer complains of any syntax errors.
Please note that I did not make any changes to the logic

Code:
input BuyorSell = {default Buy, Sell};
input BuyEntry = 3;
input SellEntry = 3;
input BuyExit = 20;
input SellExit = 20;
input ATRLength = 50;
input TargetATRMult = 1;
input DisplayLines = yes;
#input PriceDigits=NumberFormat.TWO_DECIMAL_PLACES;

input PriceDigit=2;

def H = high;
def L = low;

def h1 = Highest(H, SellExit);
def ih2=if H != h1 then H else 0.0;
#def h2 = Highest(ih2, SellExit);
def h2=fold i =1 to SellExit with ip=0.0 do if GetValue(H,i)==h1 or GetValue(H,i)<ip then ip else GetValue(H,i);
#def h3 = Highest(if (H == h1 or H == h2) then 0 else H, SellExit);
def h3=fold i1 =1 to SellExit with ip1=0.0 do if GetValue(H,i1)==h1 or GetValue(H,i1)==h2 or GetValue(H,i1)<ip1 then ip1 else GetValue(H,i1);
def HH = (h2 + h3) / 2.0;

#plot pHH=HH;

def l1 = Lowest(L, BuyExit);
#def l2 = Lowest(if L == l1 then 1000000 else L, BuyExit);
def l2=fold i2 =1 to BuyExit with ip2=10000000.0 do if GetValue(L,i2)==l1 or GetValue(L,i2)>ip2 then ip2 else GetValue(L,i2);
def l3 = Lowest(if L == l1 or L == l2 then 1000000 else L, BuyExit);
def LL = (l2 + l2) / 2.0;

def QB = Highest(H, BuyEntry);
def QS = Lowest(L, SellEntry);

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

def dl = DisplayLines == yes;
def trade;
plot entry;

switch (BuyorSell){
case Buy:
    trade = 1;
#entry.SetDefaultColor(color.GREEN);
case Sell:
    trade = -1;
}
#AddLabel(1,trade);
#def c1 = (BuyorSell == "Buy") and barnumber() > Max(SellExit, BuyExit);
#def c2 = (BuyorSell == "Sell") and Barnumber() > Max(SellExit, BuyExit);

entry.AssignValueColor(if trade == 1 then Color.GREEN else if trade == -1 then Color.RED else Color.GREEN);
#entry.setPaintingStrategy(paintingStrategy.LINE);
plot exit;
exit.SetDefaultColor(Color.CYAN);

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

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];
}

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 dl and co then BTarget else Double.NaN;
pBTarget.SetDefaultColor(Color.YELLOW);

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

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

#plot pbt=if dl and co and (pos == 1 or pos == -1) and pos[1] == 0 then BTarget else double.NaN;
#pbt.setPaintingStrategy(paintingStrategy.VALUES_BELOW);

def valco=dl 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(valco, BTarget,rBTarget, Color.YELLOW);
AddChartBubble(valco, BTarget2, rBTarget2 ,Color.MAGENTA);
AddChartBubble(valco, EntryPr,rEntryPr, Color.WHITE);

def exv=if trade == 1 then LL else HH;
def rexv = round(exv,PriceDigit);
def rTradeRisk = round(TradeRisk,PriceDigit);

AddChartBubble(valco,exv,rexv + "(" +rTradeRisk + "ATR)", Color.CYAN);

#AddChartB=ubble(1,H,pos);

#END
 
Wondering anyone can write a script for the scan on the breakout.

@hoojsn Here - I have converted the code (based on post #1) so that it is a bullish breakout scan.
Additionally I have also formatted the code so that the logic is easier to follow
Scanning against the S&P 500 I obtained 17 results. Have a look at ticker IBM for example

Code:
# Top Ultimate Breakout Scan
# tomsk
# 12.9.2019

input BuyorSell = {default Buy, Sell};
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 H = high;
def L = low;

def H1  = Highest(H, SellExit);
def ih2 = if H != H1
          then H
          else 0.0;
def H2  = fold i = 1 to SellExit
          with ip = 0.0
          do if GetValue(H, i) == H1 or GetValue(H, i) < ip
             then ip
             else GetValue(H, i);

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

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

def QB = Highest(H, BuyEntry);
def QS = Lowest(L, SellEntry);

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

def dl = DisplayLines == yes;
def trade;

switch (BuyorSell) {

case Buy:
    trade = 1;

case Sell:
    trade = -1;
}

def entry;
def 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];
}

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 scan = close crosses above entryline;

# End Top Ultimate Breakout Scan
 
Last edited:
Is it possible to reverse the code?l for the scan and indicator? This is great for breakouts; interesting to have one that works on breakdowns.
 
@johntermotto Absolutely - The indicator already has both buy/sell signals configured. The default is buy / breakout.
To set this to a sell/breakdown, just load the same indicator and select the input field "buyorsell" to "Sell" in the user interface

Per your request I have COMPLETED the reverse scan - breakdown. I just scanned this against the S&P 500 and obtained 26 results (DAILY)
Have a look at AVGO, NOV, RTN, all showing signs of breakdown.

All the best!

Code:
# Top Ultimate Breakdown Scan
# tomsk
# 12.10.2019

input BuyorSell = {Buy, default Sell};
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 H = high;
def L = low;

def H1  = Highest(H, SellExit);
def ih2 = if H != H1
          then H
          else 0.0;
def H2  = fold i = 1 to SellExit
          with ip = 0.0
          do if GetValue(H, i) == H1 or GetValue(H, i) < ip
             then ip
             else GetValue(H, i);

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

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

def QB = Highest(H, BuyEntry);
def QS = Lowest(L, SellEntry);

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

def dl = DisplayLines == yes;
def trade;

switch (BuyorSell) {

case Buy:
    trade = 1;

case Sell:
    trade = -1;
}

def entry;
def 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];
}

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 scan = close crosses below entryline;

# End Top Ultimate Breakdown Scan
 
Last edited:
I think I've figured out how it works, the gist of it at least.

It uses a Donchian Channel of 3 and 20. So it is tracking the highest high and the lowest low of 3 and 20 bars.

Long Entry Trigger: the price touches Donchian (3) Upper band and vice-versa for the short entry.
Stoploss: It doesn't seem to be just a simple Donchian (20). Is it ATR(50) subtracted from it? If it's a long entry, the stop-loss has the same slope as the Lower band of Donchain 20, but it doesn't match it exactly. For short entry, it is the Upper band of Donchian (20), but I need help with this one.
Targets: Based on ATR (50)?

Would somebody who knows code please provide a little more clarity? I appreciate it.
 
Last edited by a moderator:
HZA8znj.png


I did a 2 grid comparison on /CL, can even use it on a 5min chart, need not be 30mins. Left grid thick gray line for buy entry, right grid thick gray line for sell entry.
Results are proven to be very good. Do the lines repaint?
Or, if entered buy entry, once right side sell entry gray line appears, it's also a sign to close the buy entry and enter short?
 
Last edited:
@Playstation The lines don't repaint.

When you enter Long, the blue line below your entry, (gray line) is your stoploss.
When you enter Short, the blue line above your entry (gray line) is your stoploss.

If you use the default settings, the stoploss is very wide. It uses a Donchian channel, so it enters Long/Short on Donchian (3), but the stoploss is Donchian (20). The entry is triggered on the first touch, not on a candle close.
 
Great indicator! I've used this to pass funded trader tests for futures. My $100k account will be funded in a couple of days. Too many false breakouts will leave lots of lines on your charts so I got rid of most of the lines and add labels instead. So the labels only show the most current signal. Is there a way to only keep the valid signals and remove signals that have been invalidated?
 
@tradegeek What settings have you used and for what futures?

Mainly /ES and /CL. Settings depend on what I'm trading, the type of charts I am looking at. The example below shows a 3200 tick chart on the /ES for the recent session. Two very profitable trades and a small loss. For /ES, this will keep you in the trade for $500-$2,000/contract (even more if you swing trade) in a trending market, as shown in the last trade of that day. The settings below is entry=3, exit=30, atr length=5, target atr mult=2. Just adjust the settings according to what you're trading and the chart you're using.

5VE5z0H.png
 
Last edited:
Can we turn off the indicator on previous days and only see today only...


Even in Today the Time Frame, still more than 3 sometime 5 group Lines would be plotted, we hope if possible we could have a choice to switch only show current group and erase previous groups


As requested by a couple of folks to display today's intraday levels and exclude previous days levels from being plotted, here is version 1.3 of the Top Ultimate Breakout Indicator. I have added a user selectable input selector called "ShowTodayOnly". You can configure this via the user interface. By default I set it to display only today's intraday levels. Note that is will only display the levels after the daily RTH opening bell.

I actually had a version going the last few days but was unable to test it until live trading hours today. It looks good to go, so have at it folks

Code:
# Top Ultimate Breakout Indicator
# tomsk
# 1.2.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

# 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 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);
exit.SetDefaultColor(Color.CYAN);

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
 
Is there a way to keep only valid signals?

Let's say if the first signal reaches target 1, and then get stopped out then with will no longer show the target 2 line. If it failed to reach target 1 and target 2, then both of those target bubbles and lines, along with that entry signal will not be shown on the chart?

That would reduce lots of clutter.
 
@tradegeek can I ask a couple questions about your use of Ultimate Breakout Indicator (UBI)?
1. Do you use a directional bias indicator when choosing long or short? If yes, is the directional bias indicator a different time frame such as using SmartBars ( see thread about creating these here SmartBars thread ) on a daily basis to get overall bias then use UBI on a shorter time frame like 5 or 15 minute going either long or short in direction of bias?
2. Do you find tick charts work better then time based, especially for futures with 23hr trade day?
3. Do you have any rules of thumb for adjusting settings in the UBI indicator for specific market conditions?
4. Do you exit some, or all of your position at target 1 or target 2 or do you use the stop line to take larger winning trades. If you only use the stop line, do you move your stop up to at least breakeven when target 1 or 2 is hit if it is closer?
5. Do you follow the guidelines they recommend and only take trades when the ATR risk is 2 or less.
I think this is an excellent indicator allowing for wins many times the average loss but you need to be able to accept a few losers along the way. Have you considered only taking trades after a set number of losing trades first?
Thanks in advance for your input, and thanks to all that have helped in the coding.
 
@tradegeek can I ask a couple questions about your use of Ultimate Breakout Indicator (UBI)?
1. Do you use a directional bias indicator when choosing long or short? If yes, is the directional bias indicator a different time frame such as using SmartBars ( see thread about creating these here SmartBars thread ) on a daily basis to get overall bias then use UBI on a shorter time frame like 5 or 15 minute going either long or short in direction of bias?
2. Do you find tick charts work better then time based, especially for futures with 23hr trade day?
3. Do you have any rules of thumb for adjusting settings in the UBI indicator for specific market conditions?
4. Do you exit some, or all of your position at target 1 or target 2 or do you use the stop line to take larger winning trades. If you only use the stop line, do you move your stop up to at least breakeven when target 1 or 2 is hit if it is closer?
5. Do you follow the guidelines they recommend and only take trades when the ATR risk is 2 or less.
I think this is an excellent indicator allowing for wins many times the average loss but you need to be able to accept a few losers along the way. Have you considered only taking trades after a set number of losing trades first?
Thanks in advance for your input, and thanks to all that have helped in the coding.

Let me see if I can provide some clarity.

1. I'm still experimenting with different things regarding directional bias. However, what I do is many times I will place two of the same indicator on the chart, one for buy and one for sell. I get rid of all the lines and convert them into labels to reduce chart clutter. The only lines that show are the exit lines from the indicator forming a Donchian channel. I pay attention to price action at the top and bottom of the channel. If I see resistance at the top, then I'm short bias. If I see resistance at the bottom, then I'm long bias.

2. I do find tick and range charts work better for futures for the way I trade. The reason is if you have wide-ranging bars, you're going to end up with larger stops. With tick and range charts, stops are often a few ticks and sometimes 1 or 2 ticks.

3. I don't adjust my settings for specific market conditions as that can change daily. However, I do adjust for different asset classes and different charts (range, tick, time) and use certain ones for trending or ranging markets.

4. How I exit depends... Go back to No. 1 above... If I see resistance at the top/bottom of the channel then I may exit one and move to breakeven or above. If I see resistance at target 1, I may reduce my position and add later at cheaper prices. If the trend is intact, and price is near the exit line, I may go in aggressively and place my SL tick or two from the exit line. That increases greatly the reward/risk factor and result in risking 1-2 ticks for 4-8+ ticks. Also, if I happen to miss a trade, I can jump in with very little risk right at the exit line. Generally, I find the exit line to be a good place for dynamic support/resistance.

5. No, it just depends on your own risk tolerance. However, going back to No.2, unless you're using a really large tick or range chart, you will seldom find any signals with ATR of 2 or more with tick or range charts.

I think I may have revealed my "holy grail". I feel anyone following this can be almost certain to be very profitable. I pass the funded trader test quite successfully in the minimum amount of time allowed while trading mostly 1-3 contracts. In fact, I reached the $6,000 profit target in less than 10 days but had to continue trading to meet the 15 days minimum. At the 15 day mark, I was close to $12,000. Combine this with others to greatly enhance it like using it alongside orderflow, market profile, support/resistance, pivots, etc. Good luck!
 
Last edited:
@tradegeek Do you take counter-trend trades? Do you follow a certain definition of what a trend is? I am just curious...but the risk-reward of this indicator is kind of brutal. I mean, it enters on Donchian (3) but the stop loss is around Donchian (20). I don't have exact math at the moment, but it would take a while to make it back.
 
Here is a counter-trend, entry Long today, intraday on RTY, 15 minutes. Today was kind of easy, a persistent downtrend, but most of the time it isn't that simple. Since this indicator simply uses a Donchian channel and ATR, it seems that the entries are arbitrary. Just something to be aware of.

 
I’m not sure I getting what you’re saying regarding risk-reward being brutal. Read my reply above. I risk only a few ticks compared to potential profit targets.

A trend is what appears to be going up/down on my charts. Even if were looking at the same underlying but with different chart settings we may see different trends.

As far as counter-trend, yes. Read my reply above regarding the channel. Usually price will meander around and area before turning unless there has been an aggressive move in one direction until it is met with support or resistance. This is why using this along-side of other things as I’ve stated will greatly enhance the use of this.
 
Last edited:

BenTen's Watchlist + Setup + Trade Recaps

Get access to Ben's watchlist, swing trading strategy, ThinkorSwim setup, and trade examples.

Learn more

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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