TradingView
jdhadwin
21 Nis 2018 01:37

Support & Resistance Filter 

Bitcoin / United States DollarCoinbase

Açıklama

Visualize support and resistance levels with a high level of user control. Tired of meaningless, tightly clustered, support and resistance lines (shouldn't those just be considered bounces)? Just filter them out with the Bounce Filter. Want to visualize S&R in a crisp, clear new way? Use "Areas of S&R". Want to have a ridiculous amount of control over what counts for support and resistance in the first place? Use the Swing Filter (built-in). Perhaps most interesting... ...want to see support and resistance for (say) Bitfinex-BTC/USD on a Coinbase chart to see how they affect Coinbase candles? Then check out the advanced settings and have fun ;)



Support & Resistance levels are determined by historic pivots (swings). If a price breaks through the first resistance level, it may really take off. If it breaks through the second level, or through all five resistance levels, you might be on your way to the moon (Lambos not included). The inverse is true when the price breaks-down, through support levels.

5 Levels of Support and 5 levels of Resistance are available.



In a very bullish or bearish situation, searching back in time for the next highest Support or Resistance level can become quite demanding on TradingView's server. I've pushed it to the limit:
  • R2 & S2 look back 1,000 candles
  • R3 & S3 look back 2,250 candles
  • R4 & S4 look back 3,500 candles
  • R5 & S5 look back 4,999 candles


When TradingView's servers are getting a little bogged down, you may get an error about "a loop being longer than 100ms". That just comes with the territory of searching so many candles back. To resolve it, just click "Force Reload" in the settings.

I'd love to post the manual, the instructions for the settings, here in the description, but the publishing policy sets a limit as to how long these descriptions can be. So check the comments for a manual on how to use this indicator. And if you'd like to plug this kind of indicator into your scripts, just contact me for custom work.

~jdhadwin

Sürüm Notları

This update handles the merging of resolutions from other sources more accurately than version 1.0
Version 2.0 also fixes a Support-Levels bug that ignored changes to the Swing-Low Bars-Left settings.
Yorumlar
jdhadwin
SUPPORT & RESISTANCE VISIBILITY - Displays Support and Resistance

Show Areas of S&R - Display S&R as areas instead of just lines

Show Resistance Levels - How many Resistance Levels do you want on the screen?

Show Support Levels - How many Support Levels do you want on the screen?

Show S&R Extensions - Continue to display S&R lines after they have been crossed

Show S&R Connections - Connect the dots between changing S&R Levels

Offset S&R to Relevant Swing (only affects visuals) - It can be confusing to understand how S&R are formed, but offsetting them helps the eye find the swing high or low that produced them... remember, these S&R lines can't come into existence without first confirming that the swing high or low is confirmed, which means that the S&R won't show up until after the number of candles you have selected in settings, under the two "# of Bars to the Right of Swing" settings.
jdhadwin
S&R FUNCTIONALITY - This isn't a setting, it's just a header. Nothing will happen when you check the checkbox :)

Include Unconfirmed Swings for Support - A support level isn't official (confirmed) until a swing low is confirmed, and that requires at least one candle on the right side of that swing low to CLOSE higher than that swing low... the operative word being "close", that means that it won't be until the open of (at least) the second candle after the swing low before the support line is official, because if we don't wait till then, what if the first candle after the swing low shoots lower right before closing and now it's no longer a swing low? If you don't need this confirmation, then this option is for you! That being the case, support lines at the leading edge of your chart are liable to change if the swing low goes from being an unconfirmed swing low to a false swing low.

Include Unconfirmed Swings for Resistance - A resistance level isn't official (confirmed) until a swing high is confirmed, and that requires at least one candle on the right side of that swing high to CLOSE lower than that swing high... the operative word being "close", that means that it won't be until the open of (at least) the second candle after the swing high before the resistance line is official, because if we don't wait till then, what if the first candle after the swing high shoots higher right before closing and now it's no longer a swing high? If you don't need this confirmation, then this option is for you! That being the case, a word of caution; resistance lines at the leading edge of your chart are liable to change if the swing high goes from being an unconfirmed swing high to a false swing high.

Filter out S&R Bounces - Activates the S&R Bounce Threshold (the setting below), enabling you to filter out new Support or Resistance levels that should rather be counted as bounces off of existing S&R Levels

Set S&R Bounce Threshold: (% or Amount) - If a S&R comes within this (amount OR percent (based on the percentage setting below)) of an existing S&R level, and doesn't break through, count it as a confirmation rather than defining it as the new R1. You don't usually want to count confirmations of existing S&R lines as new S&R lines, or else you'll end up with cases where the first through fifth S&R levels are all within a tiny distance of each other, and the lines become increasingly meaningless. What use is an R2 or R3 breakthrough if R2 and R3 are within a fraction of a percent from one another? This Bounce Filter is how you filter those out.

Use Percentage for S&R Bounce Threshold - Causes the setting above to be counted as a percentage rather than a precise amount (Using BTC/USD, if checked 0.50 would mean 0.5%, if unchecked it would mean 50¢)
jdhadwin
Swing Filter (by jdhadwin) is the backbone of Support & Resistance Filter...
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.

Ignore Flash-Spike Highs - Sometimes you just want to ignore spikes that are too high. Enable that feature here and set it below.

Flash-Spikes Are This % & Above - When Ignore Flash-Spike Highs is checked, entering 40 here would ignore any swing high that is 40% higher than its neighboring candles.
jdhadwin
Swing Filter (by jdhadwin) is the backbone of Support & Resistance Filter...
SWING LOW VISIBILITY - Show the location of all swing lows remaining after filtering, marked with green "L"

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.

# 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?

# 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?

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.

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.

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.

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.

Ignore Flash-Crash Lows - Sometimes you just want to ignore crashes that are too low. Enable that feature here and set it below.

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
REWIRE DEMO (ADVANCED)

Use an Alternate Symbol or Exchange Instead - A confluence of S&R 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 support and resistance you'd like to rewire into your Support & Resistance Filter, to show its support and resistance 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
Force Reload This Indicator - Checking for S&R can require checking WAY back in time to look for old S&R levels as needed. To do this, Pine Script needs to use something called "loops" to go back in time. This script pushes that functionality to the limit, searching as far back as 4,999 candles to look for S5 or R5 when it needs to. To prevent malicious code from destroying the TradingView experience of all their users, trading view has disallowed any single loop that would run for longer than 100 miliseconds. If you get an error about something like that, just toggle this little button, and it will probably clear the error.
Daha Fazla