One notable difference between this and the original formulation is that I have added an independent control for the Super Smoother. This "tweak" is enabled by applying the override and adjusting it's period. There is a "Post Smooth" input() that "tweaks" the internal Reflex too. Keep in mind that my intention of adding tweaks is solely for experimentation with the original formulation.
I also added adjustable levels for those of you that may wish to employ alertcondition()s to this indicator somehow. Providing a more utilitarian approach, I created this with an easy to use reusable function named reflex(). As always, I have included advanced Pine programming techniques that conform to proper "Pine Etiquette". Being this is one of John Ehlers' first two simultaneously released indicators for 2020, I felt a few more bells and whistles were appropriate as a proper contribution to the Tradingview community.
Features List Includes:
Dark Background - Easily disabled in indicator Settings->Style for "Light" charts or with Pine commenting
AND much, much more... You have the source!
The comments section below is solely just for commenting and other remarks, ideas, compliments, etc... regarding only this indicator, not others. When available time provides itself, I will consider your inquiries, thoughts, and concepts presented below in the comments section, should you have any questions or comments regarding this indicator. When my indicators achieve more prevalent use by TV members , I may implement more ideas when they present themselves as worthy additions. As always, "Like" it if you simply just like it with a proper thumbs up, and also return to my scripts list occasionally for additional postings. Have a profitable future everyone!
In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.
I'm an amateur coder and new to pine script... I have a question about this code which I've been unable to find
In the Plot and hline code below:
1. I'm not sure what the first plot line does. I have actually commented it out and do not see a difference in the output.
2. The Hex colors have 8 characters. What do the last 2 characters do? e.g. #FFFFFF22 (22)
plot( 0.0, color=#FFFFFF22, linewidth=7 , editable=false)
hline( 0.0, color=#FFFFFFff, title= "Zero", editable=false)
hline(upperLevel, color=#FF0000ff, title="Upper Threshold")
hline(lowerLevel, color=#00FF00ff, title="Lower Threshold")
Behind the hline() zero line is a secondary 7px wide "TRANSPARENT" highlighter at 0.0 for hline(). If your monitor is not color calibrated OR you are using a Light chart, it may be visibly indistinguishable. If you increase the "brightness" (22) to 33, 40, etc... it will be more pronounced with a dark background color. 80 (hex) is effectively half way transparent. This controls the transparency of any line, yielding a mostly transparent line with 22. If you change 22 to ff, it will be full intensity white (#FFFFFFff) rather than a ghost gray. Equal separation transparency gradients can easily be coded with either of the following 00, 11, 22, 33, 44, 55, 66, 77, 88, 99, aa, bb, cc, dd, ee, ff (16 grades) OR 00, 40, 80, c0, ff (5 gradesl) OR 00, 33, 66, 99, cc, ff (6 grades). 00 will create a completely invisible line of any color. Try #80808022
This indicator is a high intensity bright yellow, so it appears to bleed into the transparent white mostly. If you go into Settings -> Style you can toggle this line on/off with a checkbox to easily see the difference. Toggling all of the other lines OFF will only leave only that one visible, and it should be unmistakable with a dark background. While you are in Settings -> Style, you may change colors, line style, and linewidth (1-4px) creating a perfectly styled indicator to your liking without coding. After coloring it to perfection you can use Firefox's in browser developer eyedropper to retrieve colors from almost anything HTML, however with transparency less than full intensity (ff), the actual color may vary when eyedropped from what the actual code may be in transparency controlled indicators.
Some Pine plotting functions have a transp= parameter that uses as a percentage of transparency. 100 being 100% color intensity and 0 being invisible, you may apply transparency = input(50, "Transparency for transp=", input.integer, minval=0, maxval=100, step=5) to these and then see how it works at the programming level using Settings. plot() is the most versatile with plot(AnyNumber, color=XXXXXX, transp=transparency) . xx won't be needed in this case.
Searching for "html color picker" will provide you with unlimited resources of everything in hex color. That is significantly more broad spectrum than transparency, yet able to be learned by anyone who can functionally program at any stage of experience. The best way to learn is code colors and a lot of them.
If you want a full list of my recommended colors, you may visit my "Pine Color Magic and Chart Theme Simulator" in my scripts profile. You will find amazing code, colors, and techniques that are applicable on both chart types of Dark and Light while toying with the colorcator Settings. This is intended for developers at any stage of learning, providing the best eye candy indicators that can be built utilizing the "Power of Pine". #XXXXXXxx yields more than 1.6 billion color code variations to choose from...