Currency Strength different metric wanted

Posted By: Smon

Currency Strength different metric wanted - 02/24/19 09:23

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=390132
The 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.
Posted By: Smon

Re: Currency Strength different metric wanted - 03/05/19 16:18

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:

Code:
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"));
}

Posted By: Smon

Re: Currency Strength different metric wanted - 03/05/19 16:26

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.
Posted By: Smon

Re: Currency Strength different metric wanted - 03/06/19 06:24

Solution (I had missing round brackets in the ifs)

Code:
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);
		}
	}
	
	
}

Posted By: jcl

Re: Currency Strength different metric wanted - 03/06/19 07:21

I would normalize the input or convert it to a percentage before passing it to ccySet. The values should be in the same range for all assets, otherwise assets with a higher price get higher strength.
Posted By: Smon

Re: Currency Strength different metric wanted - 03/06/19 14:53

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.
Posted By: jcl

Re: Currency Strength different metric wanted - 03/06/19 16:04

Yes, dividing by ATR(30) sounds good.
© 2024 lite-C Forums