RAZNET

Composite Any Currency Strength Index

This is a flexible currency strength indicator and you can adjust it to any currency you wish 'to measure'. By default, it is set to measure USD major pairs. Indicator calculates every pair you list, and plots one composite chart in the form of Heikin Ashi candles. Basically, you will get USD index in this case. Similarly, you can get AUD, EUR, CAD, JPY, CHF, etc indexes by specifying corresponding symbols. Remember about base and quote currencies and location of each for correct calculations. Simple adjustments in the script needed if you want to value USD by using USD in both base and quote (counter) currencies.

For example, when calculating USD strength by looking into USDJPY (not into JPYUSD) symbols, you will need to add minus "-" before corresponding security in the script itself, not in the Settings Inputs.


Default study script (with JPYUSD):
// Inputs
...
string sec3 = input(defval="JPYUSD", type=input.symbol, title="Symbol")
...
h_sec3 = security(heikinashi(sec3), timeframe.period, high)
l_sec3 = security(heikinashi(sec3), timeframe.period, low)
o_sec3 = security(heikinashi(sec3), timeframe.period, open)
c_sec3 = security(heikinashi(sec3), timeframe.period, close)

Adjusted study script with USDJPY:
// Inputs
...
string sec3 = input(defval="USDJPY", type=input.symbol, title="Symbol")
...
h_sec3 = -security(heikinashi(sec3), timeframe.period, high)
l_sec3 = -security(heikinashi(sec3), timeframe.period, low)
o_sec3 = -security(heikinashi(sec3), timeframe.period, open)
c_sec3 = -security(heikinashi(sec3), timeframe.period, close)


Unfortunately, I am not a coder specialist and perhaps someone here could improve this indicator for easier and more friendly adjustments. But thanks to variety of symbols on TradingView, you can ignore any changes in the script, and just use symbols with corresponding counter currency offered by this great platform.

Bollinger Bands, 2 x RMA, 4 x SMA/EMA were added for deeper analysing of the index. Other indicators with ability to select data sources (like CCI, StochRSI, Momentum etc) can be separately added to a current chart, but use Composite Any Currency Strength Index data as the source for analysing displayed pair, i.e. by selecting source - Composite Any Currency Strength Index: SMA Close or EMA HLC.

Thank you and good luck everyone!
Open-source script

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.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?