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
Algorithm for Detrend=SHUFFLE #472296
04/18/18 23:19
04/18/18 23:19
Joined: Dec 2017
Posts: 129
Halifax, NS
K
kujo Offline OP
Member
kujo  Offline OP
Member
K

Joined: Dec 2017
Posts: 129
Halifax, NS
JCL,

1. Could you please share the code or algorithm used in Detrend=SHUFFLE? I'd like to know how Zorro generates shuffled price curves.

2. If I use Detrend=SHUFFLE, do percentage returns have the same mean and standard deviation as original percentage returns?

3. Is it correct to use shuffled prices with Detrend=SHUFFLE for Monte Carlo reality check? I'm concerned that this mode keeps overall trend and price range. Does it mean that simulated prices are correlated in a similar manner as the original prices? I thought that it's important to remove existing correlations in prices for the MonteCarlo analysis.

Thank you!

Last edited by kujo; 04/19/18 01:07.
Re: Algorithm for Detrend=SHUFFLE [Re: kujo] #472308
04/19/18 11:43
04/19/18 11:43
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
Detrend=SHUFFLE uses the Fisher-Yates algorithm. Which method a reality check uses depends on the reality check.

Re: Algorithm for Detrend=SHUFFLE [Re: jcl] #472310
04/19/18 13:24
04/19/18 13:24
Joined: Dec 2017
Posts: 129
Halifax, NS
K
kujo Offline OP
Member
kujo  Offline OP
Member
K

Joined: Dec 2017
Posts: 129
Halifax, NS
As I understand, Fisher-Yates algorithm shuffles data without replacement. I generated a couple of shuffled price curves with priceClose() and compared with original curve. I sorted and compared percentage returns (p0/p1-1) and price difference (p0-p1). They are different. I wonder what is shuffled then? I assumed the returns should be the same but shuffled? Mean of returns is different as well.

I want to run the Monte Carlo analysis: generate simulated price curves and run my algo on them to reject the null hypothesis. As I understand, Zorro provides 2 options out-of-the-box: Detrend=SHUFFLE (according to the updated manual it's randomize(SHUFFLE,...) ) and randomize(BOOTSTRAP). The difference is that the first one is shuffling without replacement (used for montecarlo in the Black Book example), the second one is shuffling with replacement (used for Whit Reality Check). Which method can be used for above-mentioned montecarlo analysis? Which one is preferable? What's the difference?




Last edited by kujo; 04/19/18 13:32.

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