CapnOscar

USDIndex

331 3 48
Just seeing folks asking a lot about USD INDEX I just wanted to help little bit
Remove from Favorite Scripts Add to Favorite Scripts
// CapnOscar Cheers

study(title="USDIndex", overlay=false)

eusd = security("EURUSD", period, close) // 
usjpy = security("USDJPY", period, close) // 
gbpus = security("GBPUSD", period, close) // 
uscad = security("USDCAD", period, close) // 
ussek = security("USDSEK", period, close) // 
uschf = security("USDCHF", period, close) // 

usdx = 50.14348112 * pow(eusd,-0.576) * pow(usjpy,0.136) * pow(gbpus,-0.119) * pow(uscad,0.091) * pow(ussek,0.042) * pow(uschf,0.036)

plot(usdx, color = red)

SunnyBTC PRO
a year ago
Good thinking Batman
+1 Reply
CapnOscar SunnyBTC
a year ago
was simple solution I thought :)
+1 Reply
Sinuhet
a year ago
thx a lot! would be great if you could modify it to get it the same absolute value as the official USD index. Aka "fix it to the start date". Following could help you (credit to Ricardo Santos) by it as inspiration:

study("My Script"
_day = input(title='day', type=integer, defval=0)
_month = input(title='month', type=integer, defval=0)
_year = input(title='year', type=integer, defval=0)

check_time(_dd, _mm, _yyyy) => _dd == dayofmonth and _mm == month and _yyyy == year ? true : false
sec = security(tickerid, period, valuewhen(check_time(_day, _month, _year), close, 0))
plot(sec)

Reply
Ideas Scripts Chart
United States
United Kingdom
India
España
Italia
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Billing Sign Out