TradingView
jdhadwin
20 apr 2018 21:48

Swing Filter 

Bitcoin / DollarBitfinex

Descrizione

Swing Filter allows you to identify market swings and use the settings to filter out the noise.

The concept is the same as Pine Script's built in pivothigh() and pivotlow(), except with a command center full of controls. Do you to only see swings that are a certain amount higher or lower than their neighboring candles? Want to filter out flash-crashes or freak-spikes? Do you want to count swing-highs or lows that are formed by multiple bars? ...how many? ...how strict? Do you only want swings that are already confirmed or do you want swings that are probably about to be confirmed? You get the idea.

Swing Filter was designed to be plugged into other tools. Swings are used to figure Support and Resistance in Technical Analysis (TA), so you'll find that it is swing filter working in the background of my Support & Resistance Indicator. The creator of this indicator would be happy to help you implement Swing Filter into your workflow, and even can unlock rewiring features that allow Trading View Premium customers to use outputs from other indicators as inputs to swing filter (indicator layering).

INDICATOR SETTINGS:
  • SWING HIGH VISIBILITY - Show the location of all filtered swing-highs, marked with green "H"
  • Show Unconfirmed Swing Highs - Whereas a confirmed swing high is shown with a green H, unconfirmed swing highs are shown with an orange H. Sometimes you want to see what could become a swing high before the final right-neighboring candle closes and confirms it. As long as the final right-side candle still has a lower high, we can show an unconfirmed swing high. Once the final right-side candle closes with a lower high, then we have a confirmed swing high. When the "# of Lower Bars to Right of Swing High" setting is set to a number greater than 1, keep in mind that unconfirmed candles will only ever appear one candle prior to confirmation.
  • # of Lower Bars to Left of Swing High - Swing highs are calculated based on being higher than neighboring candles. How many candles do you want to check to the left-side of a swing high?
  • # of Lower Bars to Right of Swing High - Swing highs are calculated based on being higher than neighboring candles. How many candles do you want to check to the right-side of a swing high?
  • Must be This % Higher Than Left Bars - Filter out highs that aren't high enough. "0.5" would require your swing highs to be at least half a percent higher than the high of its confirming left-side bars.
  • Must be This % Higher Than Right Bars - Filter out highs that aren't high enough. "1" would require your swing highs to be at least one percent higher than the high of its confirming right-side bars.
  • Multibar Highs - # Bars Allowed to Form High - Filter out or allow highs that are formed at a transition from one bar to another. Especially on low spread exchanges like GDAX, highs may be formed by many consecutive bars, formed by persistant impenetrable buy/sell walls. When using multibar highs, they are counted as a single candle: the swing high will be marked on the right-most high of the multi-bar high, and then the left-side bars are counted from the left-most high of the multi-bar high.
  • Multibar Highs Strict-Mode - Some multibar highs are just the result of chance, meaning that the first candle reached it's high, went back down, then the second candle reached the same high at a later time. Strict mode will filter these out and only show multibar swing highs that were formed when a candle closed at its high and the next candle opened at its same high. How strict? It allows a one penny difference (for negligible spreads). It also doesn't care about the candles' lows, which leaves room for a future super-strict mode.

    *For the complete list of settings and instructions see comments below (sorry they're listed in backwards order below, and the publishing rules won't let me put them all here (too long))
Commenti
jdhadwin
SWING FILTER REWIRE DEMO
Use an Alternate Symbol or Exchange Instead - A confluence of swings between securities that exists on multiple exchanges could be an important piece of info when making trading decisions. Playing with this can help.

Alternate Exchange or Symbol - Choose any source whose swing highs & swing lows you'd like to rewire into your Swing Filter and show on the current chart for comparison (i.e. "BITFINEX:BTCUSD" or maybe "BITSTAMP:BTCUSD")

Alternate Source Chart Resolution - Until an automatic workaround is available, you'll have to manually adjust the chart resolution in the settings panel (mixing chart resolutions will probably show inaccurate results)
jdhadwin
Flash-Crashes Are This % & Below - When Ignore Flash-Crash Lows is checked, entering 0.9 here would ignore any swing low that is 0.9% lower than its neighboring candles.
jdhadwin
Ignore Flash-Crash Lows - Sometimes you just want to ignore crashes that are too low. Enable that feature here and set it below.
jdhadwin
Multibar Lows Strict-Mode - Some multibar lows are just the result of chance, meaning that the first candle reached it's low, went back up, then the second candle reached the same low at a later time. Strict mode will filter these out and only show multibar swing lows that were formed when a candle closed at its low and the next candle opened at its same low. How strict? It allows a one penny difference (for negligible spreads). It also doesn't care about the candles' highs, which leaves room for a future super-strict mode.
jdhadwin
Multibar Lows...# Bars Allowed to Form Low - Filter out or allow lows that are formed at a transition from one bar to another. Especially on low spread exchanges like GDAX, lows may be formed by many consecutive bars, formed by persistant impenetrable buy/sell walls. When using multibar lows, they are counted as a single candle: the swing low will be marked on the right-most high of the multi-bar high, and then the left-side bars are counted from the left-most low of the multi-bar low.
jdhadwin
Must be This % Lower Than Left Bars - Filter out lows that aren't low enough. 0.1 would require your swing lows to be at least a tenth of a percent lower than the low of its confirming right-side bars.
jdhadwin
Must be This % Lower Than Left Bars - Filter out lows that aren't low enough. 2 would require your swing lows to be at least two percent lower than the low of its confirming left-side bars.
jdhadwin
# of Higher Bars to Right of Swing Low - Swing lows are calculated based on being lower than neighboring candles. How many candles do you want to check to the right-side of a swing low?
jdhadwin
# of Higher Bars to Left of Swing Low - Swing lows are calculated based on being lower than neighboring candles. How many candles do you want to check to the left-side of a swing low?
jdhadwin
Show Unconfirmed Swing Lows - Whereas a confirmed swing low is shown with a green L, unconfirmed swing lows are shown with an orange L. Sometimes you want to see what could become a swing low before the final right-neighboring candle closes and confirms it. As long as the final right-side candle still has a higher low, we can show an unconfirmed swing low. Once the final right-side candle closes with a higher low, then we have a confirmed swing low. When the "# of Higher Bars to Right of Swing Low" setting is set to a number greater than 1, keep in mind that unconfirmed candles will only ever appear one candle prior to confirmation.
Altro