• The price of VIP membership is increasing to $199 beginning June 1. Click here to lock in the current rate of $149.

Best Bull Flag Indicator Yet

spoiledtechie

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);
 

arc561998

New member
I added it to my 1 min chart but I'm confused as to what is supposed to happen, I know today is probably a bad day cause everything's red but can you maybe post a screenshot or something showing how its supposed to alert and how it looks on chart @spoiledtechie
 

wesam

New member
Can you help me with a custom indicator I have I will like to turn it into a scanner. Would be appreciated

@MerryDay I just noticed this isn’t the same. The person that created this thread changed the code provided by Ken to better results. The link above is for the original code. I was hoping for this code is I be turned into a scan from spoiledtechie
 

MerryDay

Well-known member
VIP
@wesam as @spoiledtechie said in the 1st post. There is less than 30sec to make a decision on whether to make entry. Given that scans update every 3-7min. A scan would not be applicable in this instance.
 

wesam

New member
I agree but I wanted to use it for other reasons is why a scan would benefit
@wesam as @spoiledtechie said in the 1st post. There is less than 30sec to make a decision on whether to make entry. Given that scans update every 3-7min. A scan would not be applicable in this instance.
wouldn’t the scan still be on the 1 min I just want to be able to see which stocks are receiving the signals since it’s on the 3 min for signals
 

Similar threads

Top