Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (TipmyPip, AndrewAMD, Quad, aliswee, degenerate_762), 970 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 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: 204
Germany
Smon Offline OP
Member
Smon  Offline OP
Member

Joined: Dec 2014
Posts: 204
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: 204
Germany
Smon Offline OP
Member
Smon  Offline OP
Member

Joined: Dec 2014
Posts: 204
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: 204
Germany
Smon Offline OP
Member
Smon  Offline OP
Member

Joined: Dec 2014
Posts: 204
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: 204
Germany
Smon Offline OP
Member
Smon  Offline OP
Member

Joined: Dec 2014
Posts: 204
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,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
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: 204
Germany
Smon Offline OP
Member
Smon  Offline OP
Member

Joined: Dec 2014
Posts: 204
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,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
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