• LIMITED TIME ONLY: Take $40 off VIP with code: BTD40.

Best Bull Flag Indicator Yet For ThinkOrSwim

MerryDay

Administrative
Staff member
Staff
VIP
Lifetime
@wesam
6ql6Q5z.png
 

Amzning

New member
VIP
I have this bull flag indicator I pulled from the post here: https://usethinkscript.com/threads/bull-flag-and-bear-flag-formations-for-thinkorswim.467/

I modified it to work for day traders. I use this indicator while showing the 1 MIN chart, but its aggregation is on the 3 min chart. So I can see ALL bull flag formations on the 3 minute charts, at the 1 min chart level.

HOW TO:
  1. Add the script to your 1 min chart.
  2. ONLY use this on a moving upward trend. I use a 20 chart layout, opening this up with Trade Ideas scanners. I find the Momentum stocks that are continuing to hit new highs. The problem with these stocks, is you never know when they will crash, right? So now you know, when they will push up.
  3. When I place these upward trend charts and this indicator finds a bull flag, it sends me a PING. I look at the chart and I have about 30 seconds - 5 minutes to decide if I will enter the trade.
    1. If its a flag sideways bull flag, I have longer to decide. If its a moving upwards bull flag, I have 30 seconds or so to decide to enter the trade.
  4. I kid you not, 9 times out of 10 bull flags that appear, this one makes money on UPWARD trending stocks 90% of the time.
This is one of my favorite indicators as it makes money ALL day long when paired with a momentum trending up scanner.

Code:
# Bull Flag and Bear Flag Indicator
# Original from https://twitter.com/KRose_TDA/status/1158974048518328320
# [email protected] CBLOLD Search
#To use for scan place # signs before 2 Addlabel statements and change "def" before trigger statement to "plot"
# Modified by BenTen at useThinkScript to Display Signals on Chart
##############Bull Flag
input agg3 = AggregationPeriod.Three_MIN;

def StockPrice = close(period=agg3)>=10;
def trend = simpleMovingAvg("length"=90)> (simpleMovingAvg("length"=90)[5]);
def MacdLow = macdHistogram(24,51,27)[1]< macdHistogram(24,51,27)[2]and close(period=agg3)[1]<close(period=agg3)[2] and close(period=agg3)>high(period=agg3)[1];
#def Momentum = macdHistogram(8,17,9) > macdHistogram(8,17,9)[1];
##############Bear Flag
def StockPriceBear = close(period=agg3)>=10;
def trendBear = simpleMovingAvg("length"=90)< (simpleMovingAvg("length"=90)[5]);
def MacdHighBear = macdHistogram(24,51,27)[1]> macdHistogram(24,51,27)[2]and close(period=agg3)[1]>close(period=agg3)[2] and close(period=agg3)<low(period=agg3)[1];
#########################################
#def trigger = trend and momentum and MacdLow;
def Bulltrigger = trend and MacdLow;
def BearTrigger = TrendBear and MacdHighBear;

Alert (Bulltrigger,"BULL FLAG", Alert.Bar, Sound.Bell);

AddLabel(yes, if Bulltrigger then "Bull Flag" else "",Color.PLUM);
#AddLabel(yes, if Bulltrigger then "Bull Flag" else if BearTrigger then "Bear Flag" else " ",Color.black);
#AssignBackgroundColor(if Bulltrigger then color.YELLOW else if bearTrigger then color.LIGHT_RED else color.WHITE);

# Plot Confirmed Signals
plot bullish = Bulltrigger;
bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
bullish.SetDefaultColor(Color.RED);
bullish.SetLineWeight(1);
plot bearish = BearTrigger;
bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
bearish.SetDefaultColor(Color.CYAN);
bearish.SetLineWeight(1);
Hi, I've been using this script for the past couple of weeks, which has been extremely helpful. However, I've noticed that the BULL FLAG Alert only reflects "BULL FLAG" even when a Bearish reversal occurs. Is there a way to update the script to trigger "BEAR FLAG" as well, instead of only & always alerting "BULL FLAG" regardless of the stocks direction? I'm hoping to avoid trade confusions as I've just received a BULL FLAG Trigger while the stock ($AMZN) was clearing reversing towards a Bearish direction. Please assist & Thanks in advance,
 

Thomas

Active member
Hi, I've been using this script for the past couple of weeks, which has been extremely helpful. However, I've noticed that the BULL FLAG Alert only reflects "BULL FLAG" even when a Bearish reversal occurs. Is there a way to update the script to trigger "BEAR FLAG" as well, instead of only & always alerting "BULL FLAG" regardless of the stocks direction? I'm hoping to avoid trade confusions as I've just received a BULL FLAG Trigger while the stock ($AMZN) was clearing reversing towards a Bearish direction. Please assist & Thanks in advance,
In your code, there are "Plots," one bullish, other bearish,..... you either make two different scans Bull/Bear and (#) hashtag one plot or leave so. The other thing is using these columns FLAG https://tos.mx/AiyoCt3 TRENDBULL https://tos.mx/2Py0zL7
there is a column system Ken created.......
 

Amzning

New member
VIP
In your code, there are "Plots," one bullish, other bearish,..... you either make two different scans Bull/Bear and (#) hashtag one plot or leave so. The other thing is using these columns FLAG https://tos.mx/AiyoCt3 TRENDBULL https://tos.mx/2Py0zL7
there is a column system Ken created.......
Thanks for the response. I'm currently not using the scanner feature, as I'm only using this indicator for day trading but let me back test the scripts you've provided. Thanks for the quick response and awesome work! I've truly enjoyed my membership thus far!!! #happytrading
 

MerryDay

Administrative
Staff member
Staff
VIP
Lifetime
Ruby:
#Bull Flag on Pole - SCAN
# Mobius
# V01.02.2014
# Price trend - Upward leading to the pattern. The price should rise by at least 90% in less than 2 months.
# Shape - A consolidation pattern forms after price doubles. It usually doesn't look like a flag or pennant, just a pause in the price rise.
# Volume - Recedes for best performance
# Confirmation - The pattern confirms as valid when price closes above the highest peak in the pattern.
input n = 21;

def upward = IsAscending(HL2, 65);
def p = (highest(high, 21) / close[65]) > 1.1;
def h = high;
def l = low;
def c = close;
def FE = (Log(Sum(TrueRange(h, c, l), n) /
         (Highest(h, n) - Lowest(l, n))) /
          Log(n)) > .68;

plot Flag = upward and p and FE;
 

Similar threads

Top