TradingView
Amphibiantrading
2023年7月6日下午2點33分

Flag Finder 

Lantheus Holdings, Inc.NASDAQ

描述

Flag Finder Indicator is a technical analysis tool to identify bull and bear flags.

What are flags
Flags are continuation patterns that occur within the general trend of the security. A bull flag represents a temporary pause or consolidation before price resumes it's upward movement, while a bear flag occurs before price continues its downward movement.

Both flag patterns consist of two components:
  • The Pole
  • The Flag


The pole is the initial strong upward surge or decline that precedes the flag. The pole is usually a fast move accompanied by heavy volume signaling significant buying or selling pressure.

The flag is then formed as price consolidates after the initial surge or decline from the pole. For a bull flag price will drift slightly downward to sideways, a bear flag will drift upward to sideways. The best flags often see volume dry up during this phase of the pattern.




Indicator Settings
Both components are fully customizable in the indicator so the user can adjust for any time frame or volatility. Select the minimum and maximum accepted limits from the % gain loss required for the pole, the maximum acceptable flag depth or rally and the minimum and maximum number of bars for each component.

Colors and what components are visible at any time are also user controlled.

Trading flags
Traders typically use flags to enter on breakouts. A breakout occurs when price moves above the left side high of a bull flag or below the left side low of a bear flag.

Alerts
The Flag Finder allows for four different types of alerts
  • New Bull Flag
  • New Bear Flag
  • Bull Flag Breakout
  • Bear Flag Breakout


Pine Script
On top of the indicator identifying bull and bear flags, throughout the source code I left notes on nearly every line to help anyone who is interested in pine script see my thought process and explain which each line of code does. This code isn't too complex, but it offers a look into many different concepts one might use when writing pinescript such as:
  • input groups
  • declaring and reassigning variables
  • for loops
  • plotshapes & lines
  • alerts



發布通知

Changed step value to .25 increments and lowered the minimum amounts for max depth/rally of flags.
評論
PineCoders
In the name of all TradingViewers, thank you for your valuable contribution to the community, and congrats!
Amphibiantrading
@PineCoders, thank you!
Amphibiantrading
@PineCoders, Thanks for the coins, glad to contribute
Shinhunter
I tried on many tickers but it;s not showing anything for me lol,. I even changed the numbers but nothing show up
Amphibiantrading
@Shinhunter, give me a specific example please. So far I’ve had no problems on any ticker
jscottw
Nice script. Doesn't work for symbol SPY; Any idea why? Cheers
Amphibiantrading
@jscottw, Thanks, SPY doesn't tend to have as big of moves as normal stocks, so you will want to lower your prior uptrend/downtrend minimum. 20% (default setting) move on SPY is pretty big. Lowering it to 6-8% yields lots of flags.
dreambasher1969
hello does it work for Forex have it on the one hour and nothing shows ty
Amphibiantrading
@dreambasher1969, you will just need to adjust the prior uptrend/downtrend minimum setting. The default setting is for 20%, you will want to lower that significantly for forex and intraday
dreambasher1969
@Amphibiantrading, thank you for your fast reply
更多