Login Page - Create Account

Support Board


Date/Time: Wed, 24 Apr 2024 06:56:19 +0000



Help Creating a 4 Currency USD Index

View Count: 521

[2021-05-09 10:48:25]
Alberto Gauer - Posts: 121
Can someone please help me creating a USD index to complement the USDX?

I wanted

EURUSD x GBPUSD x USDJPY X AUDUSD thus each having 25% weight on the index

Already went through the documentation and can´t figure out how to create this, if Sierra had a study "currency index" where we could just put the symbols we wanted it would be great, otherwise you gotta have a masters degree in programming to figure those studies out, and to make things more difficult there is the USDJPY in the mix which needs to be inverted first.

If you could post here for me a study or chart collection that would create the index requested it would be great.

Best regards
Date Time Of Last Edit: 2021-05-09 10:49:28
[2021-05-09 10:53:18]
Alberto Gauer - Posts: 121
It would be even easier if Sierra offered a field on the Chart Settings windows where we could input a simple formula for creating indexes, you would just need to type EURUSDxGPBUSDxJPYUSDxAUDUSD *typing JPYUSD would automatically apply a formula to invert base and quote currency, like in tradingview
Date Time Of Last Edit: 2021-05-09 10:53:53
[2021-05-09 10:56:12]
Alberto Gauer - Posts: 121
Perhaps the title of my thread should have been different because what I Really meant by Index was a custom symbol, not data plotted on a subwindow, like an indicator.

I wanted a symbol with those 4 currencies similar to the USDX symbol
[2021-05-09 12:35:42]
Alberto Gauer - Posts: 121
I think I am almost getting it right creating a new custom symbol, but I don´t understand what is happening in here.

If in multiplication the order doesn´t matter, why I am getting a different chart when using:

-1*{USDJPY}*{EURUSD}*{GBPUSD}*{AUDUSD}

Vs.

{EURUSD}*{GBPUSD}*{AUDUSD}*-1*{USDJPY}

????
[2021-05-09 16:45:15]
User365411 - Posts: 171
Insatead of pairs try to use currency indexes already available in SC in FX-indexes group.
[2021-05-09 17:21:01]
Alberto Gauer - Posts: 121
Insatead of pairs try to use currency indexes already available in SC in FX-indexes group.

I know that there are indexes available, but I wanna build my own using only 4 currencies with equal weight.
[2021-05-09 22:25:45]
RoadKill - Posts: 38
Are you sure you're "multiplying" in 2nd case?
Looks to me you're missing a parenthesis, as it otherwise would be understood as subtraction...
Date Time Of Last Edit: 2021-05-09 22:25:55
[2021-05-09 22:30:34]
Alberto Gauer - Posts: 121
Are you sure you're "multiplying" in 2nd case?
Looks to me you're missing a parenthesis, as it otherwise would be understood as subtraction...

Yes, the price in the scale is negative and chart is inverted, so the program is reading the -1 as a negative number, not a subtraction
[2021-05-09 23:16:11]
Sawtooth - Posts: 3976
Here's an old thread about this:
Creating OHLC chart of a custom index
You can't use the files in post #2 in current versions of SC.

You probably need to sum the charts, not multiply them. Then divide the sum by 4 to get an average.

And you need to first use the 1 Divided By Price study on the USDJPY chart.

If you don't want to average them, use the Sum Charts From List study.

If you want to multiply them, the formula would look like this:
{EURUSD}*{GPBUSD}*{AUDUSD}*1/{USDJPY}
Date Time Of Last Edit: 2021-05-10 14:27:21
[2021-05-09 23:25:13]
Alberto Gauer - Posts: 121
@tomgilb

Thanks Tom, I have been experimenting with different formula combinations and so far the one I like the most is the:

{EURUSD}*{GBPUSD}*{AUDUSD}*-1*{USDJPY}

I compared the above with {EURUSD}*{GBPUSD}*{AUDUSD}*(-1*{USDJPY}) and the chart looks exactly the same, but I prefer the volume of the above "looks better" to me for VSA analysis.

I also tried {EURUSD}+{GBPUSD}+{AUDUSD}+{1/USDJPY}/4 but "did not like" the chart and volume compared with {EURUSD}*{GBPUSD}*{AUDUSD}*-1*{USDJPY}

Out of curiosity why shouldn´t I use -1* instead of 1/ ??
[2021-05-09 23:51:48]
Sawtooth - Posts: 3976
Both -1* and 1/ will invert the candles. The former returns the negative of the price, and the latter returns very small positive numbers.

Dealing with negative prices would not work when trying to create an index including positive priced symbols.
You'll need to use the smaller positive prices.

1/USDJPY will give you JPYUSD.

I think this is the formula you want to use:
{EURUSD}*{GPBUSD}*{AUDUSD}*1/{USDJPY}
Date Time Of Last Edit: 2021-05-10 13:02:37
[2021-05-10 14:32:57]
Sawtooth - Posts: 3976
Edited posts 9 & 11

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account