OPEN-SOURCE SCRIPT
تم تحديثه

+ REX Oscillator

16 305
So, what is the REX oscillator, you might be asking yourself.
"The Rex oscillator is an indicator that measures market behavior based on the relationship of the close to the open, high and low values of the same bar. A big difference between the high and close on a bar indicates weakness, and wide disparity between the low and close indicates strength. The difference between open and close also indicates market performance."

The True Value of a Bar (TVB) gives an indication of how healthy the market is. A negative close and a positive TVB (or vice versa) is an indication of the market building strength on the opposing side of the trend. The Rex oscillator is a moving average of the TVB value with the specified period.

I first came across this watching one of many No Nonsense Forex videos. Mostly, from comments I've read, it is used as an exit indicator for people who trade with a system similar or identical to the one VP espouses in his NNFX blog. I think it's perfectly apt to use as an entry indicator as well, or even as both, perhaps, depending on the moving average you chose to apply to the TVB.

There are a few other versions of this on tradingview, but I thought I'd make an updated version. Added Donchian Channels because I like the idea of a dynamic sort of overbought/sold area. I left out the basis because the indicator pivots around a center line, and has a signal line as well. A basis line just seemed like too much, and would likely not be very useful.

The additional usual things that I incorporate into my indicators are included here: optional candle coloring, alerts, and probably a too large selection of moving averages.

Credit to Nemozny for the FRAMA calculation. I may add that to other indicators I have.
ملاحظات الأخبار
a user mentioned to me a tweak that I should make to the Jurik Moving Average, so I have done so. It's a simple thing, changing the power value from an integer to a float so that you can fine tune the MA more so than whole integers would allow.

also made the donchian channel band thickness adjustable. Anywhere from 3 on up is fine. Once you get past around 8 it's pretty negligible changes though. Smaller numbers are wider (2 would basically start the bands at the basis), and the bands can only go so thin, hence why anything beyond 8 doesn't change much.
ملاحظات الأخبار
made a few minor tweaks in the case of language, but the big update, as suggested in the comments (and something I was thinking about implementing anyway) is adding divergences to the indicator. Thanks to AtomOfScent for the suggestion (and also the suggestion for the change in the JMA).
I've actually added this across all my oscillating indicators, because why not. In the case of the REX Oscillator I've set it so that you can set divergences to plot from either the REX or the Signal Line.

لقطة
ملاحظات الأخبار
added alert conditions for divergences
ملاحظات الأخبار
-conversion to pinescript v5
-added T3, RMA, and UMA moving averages for REX and as signal line
-added option for plots for signal line crosses
-added histogram option. This works the same as it does for MACD. It's just measuring the distance between the REX and Signal line
-histogram is also selectable as a candle coloration option and as a divergence option
ملاحظات الأخبار
-added an alert for histogram crossing the center line
ملاحظات الأخبار
I'm publishing updates to all of my indicators, so I'm just going to comment on everything here since most of the updates are common across most of my indicators.

User Non-Visible Updates (basically backend stuff that makes:
- changes in code legibility and consistency across all indicators (basically standardizing the coding across as many indicators as possible)
- implementation of libraries into my indicators; which helps significantly in doing what I typed above; which in turn will make creating any new indicators, if they are of the type to use these libraries, much simpler
- updated descriptions for all indicators, which should (it's possible I've forgotten things) reflect changes I've made recently and any I may have made in the past after first publication (this is very minor, but as I was changing so much I thought I may as well--I don't intend to update these much, if at all, in the future)

User Visible Updates:
- as I mentioned everything now uses my moving averages library and volatility bands library--this cuts down the total amount of code significantly, and has made it easier for me to add moving averages, or volatility bands to these indicators because I only had to/have to add it one time (to the library) rather than multiple times across all indicators*
- since creating these libraries I've added several new moving averages (Kaufman Adaptive, Laguerre Filter, McGinley Dynamic (doesn't work for all), and Zero-lag) to them while retaining all the previous with the exception of the UMA, which wasn't implemented consistently across all indicators anyway
- eliminated having two Bollinger Bands with different standard deviations and a fill between them in exchange for one with the band fill implementation that I use on my Donchian Channels Bands
- part of my code consistency across all indicators resulted in a much needed organization of the 'style' tab

*(affects all but the Wavetrend Oscillator, Wavetrend Oscillator Overlay, Jurik KDJ, Average Candle Bodies Range, Bollinger Bands Width, ALMA Trend Detector, Ultimate Moving Average, Donchian Channels, and Dynamic Donchian Channels)
ملاحظات الأخبار
Another update, and another recognition of something in the code that had me scratching my head and rethinking things.

- updated to pine v6
- converted moving average functions to switch operators to cut out a bunch of code
- added a second signal line similar to my other indicators. This allows using one signal line to smooth the RO, which I will refer to as the smoothed RO, and having an additional signal line to be the signal line on that smoothed RO, or, if your fancy is to have two signal lines, then by all means....
- I should clarify about the smoothed RO vs the og RO. The RO is simply a user-selected moving average applied to a calculation done on each bar, called the TVB or true value of a bar. Certain MAs, such as the Hull, or Jurik, being extremely smooth themselves don't require further smoothing, but things like an SMA, EMA and others can, in my opinion, benefit by some smoothing. Depending on your preference of moving average you perhaps should or perhaps should not use a smoothed RO. The default settings are a 21 period EMA smoothed by a three period SMA, and an eight period EMA as a signal line.
- I've organized the code in the script to better reflect TradingView's recommendations
- updated the divergences portion of code to TV's most recent version
- changed default color pallet
- removed color gradients. Sorry, your indicator won't be quite as pretty now, but I'm doing a lot of these updates to clean up the UI of the indicators, part of which is eliminating color inputs, and in order to eliminate color inputs, because of the way pinescript handles coloring, I had to cut out color.gradient.
- added a color by timeframe option that allows the user to select an alternate timeframe for coloring, so that the indicator reflects that alternate timeframe's location by color. Example: you're on an hourly chart and you set the color timeframe to a 4h chart and the color reference to Centerline. The indicator is well above the centerline but it is still red, indicating that it is still bearish on the 4h. You're looking for shorts here most probably.

That is all, I think!
Enjoyyyyy

إخلاء المسؤولية

لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.