Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (SBGuy), 652 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Currency Strength different metric wanted #476423
02/24/19 09:23
02/24/19 09:23
Joined: Dec 2014
Posts: 206
Germany
Smon Offline OP
Member
Smon  Offline 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=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.

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 Offline OP
Member
Smon  Offline 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:

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


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 Offline OP
Member
Smon  Offline 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 Offline OP
Member
Smon  Offline OP
Member

Joined: Dec 2014
Posts: 206
Germany
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);
		}
	}
	
	
}


Last edited by sdh309795gaas; 03/06/19 15:20.
Re: Currency Strength different metric wanted [Re: Smon] #476508
03/06/19 07:21
03/06/19 07:21
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
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.

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 Offline OP
Member
Smon  Offline 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.
Re: Currency Strength different metric wanted [Re: Smon] #476522
03/06/19 16:04
03/06/19 16:04
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
Yes, dividing by ATR(30) sounds good.


Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1