373 3 65
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)

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))

Good thinking Batman
+1 Reply
CapnOscar SunnyBTC
was simple solution I thought :)
+1 Reply
EN English
EN English (UK)
EN English (IN)
DE Deutsch
FR Français
ES Español
IT Italiano
PL Polski
SV Svenska
TR Türkçe
RU Русский
PT Português
ID Bahasa Indonesia
MS Bahasa Melayu
TH ภาษาไทย
VI Tiếng Việt
JA 日本語
KO 한국어
ZH 简体中文
ZH 繁體中文
AR العربية
Home Stock Screener Forex Signal Finder Cryptocurrency Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Feature Request Blog & News FAQ Help & Wiki Twitter
Profile Profile Settings Account and Billing My Support Tickets Contact Support Ideas Published Followers Following Private Messages Chat Sign Out