Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Paul Tudor Jones with Algos

Hi guys,

Just starting out to use algos and quantopian.
I watched a segment of Paul Tudor Jones's Documentary online a while back, and at one point they showed him using a technique where he compared the current 10yr chart of the market, to that of the 1920s. They punched in the HLC of the market then and did a chart correlation to see whether it was similar to the market of today.

I was wondering,how can I create something similar--except automated? Basically, where I specify the current time frame of the Dow that I wish to use, and it automatically goes into the past and find the closest correlation to the time frame I specified? So say I want to see if this week's movements of the Dow had happened sometime in the past 10 yrs, and it goes and checks to see if and when in the last 10 yrs there was a similar week in terms of price movements. The output would then be a chart that shows the comparison.

Any ideas or direction would be really appreciated!

Thanks!

2 responses

I don't know how to code this but the logic might be something like:

Price(i) = Current days price
Price(p) = Price(i) - n
n= 5, 6, 7, 8... inf

The best way would probably be to use change in consecutive price percentages instead of the prices themselves:

[(Price(i) / (Price (i) - 1)) - (Price(p) / (Price(p) - 1)] + [(Price(i) - 1) / (Price(i) - 2) - (Price(p) - 1 / (Price(p) - 2)]= 0 +- std dev.

Basically just find a consecutive period of 5 days where the percentage changes for those 5 consecutive days is roughly the same. So the code might look like:

IF [(Price(i) / (Price (i) - 1)) - (Price(p) / (Price(p) - 1)] + [(Price(i) - 1) / (Price(i) - 2) - (Price(p) - 1 / (Price(p) - 2)]= 0 +- std dev.

THEN Chart the current week, and whatever days the other prices occurred on.

I would assume you would also want the next week of trading after the previous week that correlated in order to try and predict what would happen to the price currently so maybe chart those 5 days too.

Best of Luck!

BSM

Hey Blake,

Thanks a lot for the reply! You are absolutely right, the price comparisons would have to be made in percentages rather than absolute values.
The logic too makes sense, and is absolutely what I wanted to create.

I would really appreciate if someone could help me by taking it a tad step further and explaining how I could possibly create this on quantopian. Thanks!