|
Currency Strength different metric wanted
#476423
02/24/19 09:23
02/24/19 09:23
|
Joined: Dec 2014
Posts: 206 Germany
Smon
OP
Member
|
OP
Member
Joined: Dec 2014
Posts: 206
Germany
|
I want the metric for currency strength to which I got used to when I was trading manually. It's a number between 1.0 (weak) and 8.0 (strong). This metric seems very popular. I already started looking into how Zorros Currency strength functions work. As far as I can tell it's really only a framework that can take any metric through the ccySet() function. Has anybody tried to use the Currency strength functions to get this metric? Check this: https://www.forexfactory.com/showthread.php?t=390132The first post contains a link to an Excel Spreadsheet that contains the calculation. If nobody can help, I will succeed for sure and post the code here.
|
|
|
Re: Currency Strength different metric wanted
[Re: Smon]
#476499
03/05/19 16:18
03/05/19 16:18
|
Joined: Dec 2014
Posts: 206 Germany
Smon
OP
Member
|
OP
Member
Joined: Dec 2014
Posts: 206
Germany
|
As I understood the way calculation is done, I decided to forget this. I tried to get the average maximum pips upwards for up candles and downwards for down candles with this script, but the values I'm getting are looking strange:
function run()
{
StartDate = 20180101;
EndDate = 20181231;
BarPeriod = 1440;
ccyReset();
while(asset(loop("AUD/CAD","AUD/CHF","AUD/JPY","AUD/NZD","AUD/USD","CAD/CHF","CAD/JPY",
"CHF/JPY","EUR/AUD","EUR/CAD","EUR/CHF","EUR/GBP","EUR/JPY","EUR/NZD",
"EUR/USD","GBP/AUD","GBP/CAD","GBP/CHF","GBP/JPY","GBP/NZD","GBP/USD",
"NZD/CAD","NZD/CHF","NZD/JPY","NZD/USD","USD/CAD","USD/CHF","USD/JPY")))
{
if(priceOpen < priceClose) ccySet((priceHigh() - priceClose())/PIP);
if(priceOpen >= priceClose) ccySet((priceClose() - priceLow())/PIP);
}
printf("n%d.%d.%d - USD = %.5f", year(),month(),day(),ccyStrength("USD"));
}
|
|
|
Re: Currency Strength different metric wanted
[Re: Smon]
#476500
03/05/19 16:26
03/05/19 16:26
|
Joined: Dec 2014
Posts: 206 Germany
Smon
OP
Member
|
OP
Member
Joined: Dec 2014
Posts: 206
Germany
|
Just in case you are wondering, I want to get my own measurement of how much of an impact a deviation of some fundamental indicator on forexfactory.com has. Throwing all indicators at once on a neural net wasn't successful, so I'm now trying to only give it a hand full of indicators that are about to get released and maybe 1-2 past ones. As not all indicators are equally important, I need this metric.
Last edited by sdh309795gaas; 03/05/19 16:26.
|
|
|
Re: Currency Strength different metric wanted
[Re: Smon]
#476506
03/06/19 06:24
03/06/19 06:24
|
Joined: Dec 2014
Posts: 206 Germany
Smon
OP
Member
|
OP
Member
Joined: Dec 2014
Posts: 206
Germany
|
Solution (I had missing round brackets in the ifs)
function run()
{
StartDate = 20180101;
EndDate = 20181231;
BarPeriod = 15;
ccyReset();
while(asset(loop("AUD/CAD","AUD/CHF","AUD/JPY","AUD/NZD","AUD/USD","CAD/CHF","CAD/JPY",
"CHF/JPY","EUR/AUD","EUR/CAD","EUR/CHF","EUR/GBP","EUR/JPY","EUR/NZD",
"EUR/USD","GBP/AUD","GBP/CAD","GBP/CHF","GBP/JPY","GBP/NZD","GBP/USD",
"NZD/CAD","NZD/CHF","NZD/JPY","NZD/USD","USD/CAD","USD/CHF","USD/JPY")))
{
if(priceOpen() < priceClose())
{
var upCandle = (priceHigh() - priceOpen())/PIP;
ccySet(upCandle);
}
if(priceOpen() >= priceClose())
{
var downCandle = (priceLow() - priceOpen())/PIP;
ccySet(downCandle);
}
}
}
Last edited by sdh309795gaas; 03/06/19 15:20.
|
|
|
Re: Currency Strength different metric wanted
[Re: jcl]
#476519
03/06/19 14:53
03/06/19 14:53
|
Joined: Dec 2014
Posts: 206 Germany
Smon
OP
Member
|
OP
Member
Joined: Dec 2014
Posts: 206
Germany
|
Yes, this came to me right after posting it. Not the price issue (look again, I'm just measuring a fraction of the length of each candle, so I get rid of the absolute price). But I see a problem with different volatilities across different assets. So instead of dividing by PIP, I will divide by ATR(30). Does that make sense? I can't figure out how to get something capped at 100% when I don't know what the biggest price jump will be.
Last edited by sdh309795gaas; 03/06/19 15:17.
|
|
|
|