jdhadwin

Swing Filter

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))
Script protetto
Questo script è pubblicato con codice protetto, ma puoi comunque usarlo gratuitamente. Mettendolo tra i preferiti potrai applicarlo al grafico, senza però la possibilità di visualizzare o modificare il codice sorgente.
Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.

Vuoi usare questo script sui tuoi grafici?