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
3 registered members (AndrewAMD, Nymphodora, Quad), 919 guests, and 6 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
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,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

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


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1