Gamestudio Links
Zorro Links
Newest Posts
IG plugin initial release
by TTT. 11/11/19 23:32
Optimize non asset/algo specific
by StefanCGN. 11/11/19 15:32
New Zorro version 2.20
by jcl. 11/11/19 09:11
OANDA pricing changes
by AndrewAMD. 11/11/19 02:25
Can't Connect..IG Plugin
by TTT. 11/10/19 23:12
CONTACT* contact
by Dooley. 11/10/19 14:08
How to control entry/exit price?
by Petra. 11/10/19 10:30
AUM Magazine
Latest Screens
The Space Between
Pogostuck: Rage With Your Friends
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Who's Online Now
5 registered members (TTT, AndrewAMD, Paulius, kvm, 1 invisible), 641 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
andrews825, KKelk, TTT, Mr_Rob, dkz
18325 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Accessing All Historical Price Data #478438
10/22/19 01:00
10/22/19 01:00
Joined: Jul 2017
Posts: 4
FL
J
JohnJits Offline OP
Guest
JohnJits  Offline OP
Guest
J

Joined: Jul 2017
Posts: 4
FL
Hello,

Is there a way to access all the historical data for an asset prior to the run function? For example, I would like to be able to scale the price data for the entire data set at once then iterate over them in the run function. It appears that if you do the following:

Code
vars Prices = series(price(0));


The Prices series is limited by the LookBack in length.

Borrowing from the code located at Better Strategies 5: A Short-Term Machine Learning System:

Code
var change(int n)
{
	return scale((priceClose(0) - priceClose(n))/priceClose(0),100)/100;
}


The above scales the data but is limited to n bars. In ML, you would typically want to scale the data using the entire range of data.

In other words, how do you reference the historical data set after you set your StartDate and EndDate and outside of the run function?

TIA!

Re: Accessing All Historical Price Data [Re: JohnJits] #478441
10/22/19 10:37
10/22/19 10:37
Joined: Jul 2000
Posts: 27,051
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,051
Frankfurt
I would not do that, since it can produce peeking bias in the backtest. But if you still want it, you can access the complete historical data from the AssetC etc. arrays.

https://manual.zorro-project.com/algovar.htm

Re: Accessing All Historical Price Data [Re: JohnJits] #478447
10/22/19 22:37
10/22/19 22:37
Joined: Jul 2017
Posts: 4
FL
J
JohnJits Offline OP
Guest
JohnJits  Offline OP
Guest
J

Joined: Jul 2017
Posts: 4
FL
Yes thank you for pointing the bias out and agree.

I was thinking of applying fractional differentiation (based on the research of Dr Marcos Lopez de Prado in his book Advances in Financial Machine Learning) to provide a stationary series and keep memory for the features and target. I could then scale the features in Zorro (only in training cycles) for AI. Does this sound ok?


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