Page 1 of 1

Dollar Composite Index

PostPosted: Mon Oct 16, 2017 6:27 pm
by isamegrelo
This code from TradingView:


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)

Re: Dollar Composite Index

PostPosted: Tue Oct 17, 2017 5:05 am
by Apprentice
Can you provide web reference?

Re: Dollar Composite Index

PostPosted: Tue Oct 17, 2017 9:49 am
by Apprentice

Re: Dollar Composite Index

PostPosted: Tue Oct 17, 2017 10:45 am
by Apprentice
Your request is added to the development list under Id Number 3924

Re: Dollar Composite Index

PostPosted: Tue Oct 17, 2017 11:21 am
by isamegrelo
Thanks.

Re: Dollar Composite Index

PostPosted: Mon Oct 23, 2017 3:37 am
by Apprentice