RicardoSantos

[RS]Dollar Composite Index V0

EXPERIMENTAL:
Majors equally weighted Dollar index.
オープンソーススクリプト

TradingViewの精神に則り、このスクリプトの作者は、トレーダーが理解し検証できるようにオープンソースで公開しています。作者に敬意を表します!無料で使用することができますが、このコードを投稿で再利用するには、ハウスルールに準拠する必要があります。 お気に入りに登録してチャート上でご利用頂けます。

免責事項

これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。

チャートでこのスクリプトを利用したいですか?
//@version=2
study(title='[RS]Dollar Composite Index V0', shorttitle='DCI')
INVERT = input(false)
range = cum(close-close[1])
f_composite(_tf, _src)=>
    _eurusd = security('EURUSD', _tf, -_src)
    _gbpusd = security('GBPUSD', _tf, -_src)
    _audusd = security('AUDUSD', _tf, -_src)
    _usdjpy = security('USDJPY', _tf, _src)
    _usdcad = security('USDCAD', _tf, _src)
    _usdchf = security('USDCHF', _tf, _src)
    _return = (_eurusd + _gbpusd + _audusd + _usdjpy + _usdcad + _usdchf)/6

v_close = INVERT ? -f_composite(period, cum(close/close[1])) : f_composite(period, cum((close-close[1])/close))
v_high = INVERT ? -f_composite(period, cum(high/high[1])) : f_composite(period, cum((high-high[1])/high))
v_low = INVERT ? -f_composite(period, cum(low/low[1])) : f_composite(period, cum((low-low[1])/low))

plotcandle(v_close[1], v_high, v_low, v_close, title='DCI', color=change(v_close)>=0?lime:red)