This script originally began as just a candle coloring exercise with some optional shapes plotted above/below certain candles, but I quickly realized I wanted to draw lines or zones from these candles, so eventually, after many hours spent figuring out and learning 'line.new' and 'box.new' I got things sorted.
Essentially, my line of thinking is that on impulsive candles down, the origin of the impulse is more important than the close (not always of course, as there are no unbreakable rules in what markets can do), and with impulsive candles up, the same theory applies.
So, for upward impulsive candles I've marked out the zone from the open to the low as a support (until broken, in which case it may become resistance). For downward impulsive candles the zone encompasses the open to the high. I've given the option to plot a line from the close for all of these. It's turned off by default as it's just less stuff on the chart, but you may like it.
The line length is customizable in a menu. It does funny things on low timeframes on forex and stock charts (long lines that result in chart compression), but for some reason very rarely on crypto charts. If someone who is smart (not me) and has much experience with pinescript could perhaps help me out with a fix for this, that would be great. I suspect it has something to do with my "bar_index_duration" that I defined using the time function, but I'm not sure how or why.
Line length on time frames of one hour and up it is typically fine.
Use the ATR multiple to change the sensitivity of the indicator. This is basically the determination of when a candle is beyond the ATR. A multiple of two is two times the ATR. With lower volatile pairs you can maybe make this lower. On lower time frames or with more volatile pairs (illiquid alts in particular) a higher multiple might serve better. I find the default 1.75 is mostly acceptable.
As I started this I also thought adding some sort of information to the candles might be useful as well, so I added a simple candle coloring feature referencing the OBV and a 21 period . Candles are colored based on the OBV's relation to its moving average.
I added some plot shapes and candle coloring utilizing the as well. Options to turn on or off shapes plotted for overbought and oversold across the top of the chart. The most interesting feature that I implemented here is a zone around the centerline of the . If the is between 49 and 51 then you can have optional candle coloring, shapes plotted above the candles, and s/r zones drawn on the chart. In trending markets the centerline of the will frequetly act as support or resistance, so by being alerted of this condition on the chart you can use that with actual levels marked off in order to help make a judgement on a trade. I think it's a nice addition, and an oft overlooked aspect of the usefulness of the .
I've also included a calculation, with candle coloring and/or plot shapes, for something like a stop run on high . The calculation for that is in its section below, and should be pretty self explanatory.
Lastly, typing this as I'm posting it, this indicator could also be useful for helping to find placement for trailing a stop. Just a thought!
Here is a cleaner image of how I like using the indicator. Fewer symbols, and I like the greater consistency in the candle coloring.
And I added an average of the exponential, simple, and Kijun 200 length moving averages to use as a potential baseline.
also, fixed it so if you don't want to plot zones, but are curious about where the RSI is about the centerline, symbols are plotted above or below the bar depending on if it's acting as resistance or support
Siguiendo el verdadero espíritu de TradingView, el autor de este script lo ha publicado en código abierto, para que los traders puedan entenderlo y verificarlo. ¡Un hurra por el autor! Puede utilizarlo de forma gratuita, aunque si vuelve a utilizar este código en una publicación, debe cumplir con lo establecido en las Normas internas. Puede añadir este script a sus favoritos y usarlo en un gráfico.