Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Some Stats in Quantopian

Hi all,

I'm new on Quantopian and I'm exploring its potential.
I wonder if is possible to perform some simple stats on the db.
Let's say for example that I want to calculate a 10 days close to close percent change on AAPL and then count how many time, historically, this percent change is greater than 5%.

I want result printed as a single number not as a bar by bar.
Any tips?

Thanks.

Max

5 responses

Presumably you could do that sort of thing in the research environment... if you wanted to...

Here...

Thanks Simon, I'll give a glance at the Research environment.

I'm doing some test.

Few questions:

1) is there a way to count the number of data in a database? (ex how many rows has the AAPL db)
2) In your example you used the log function, but how do I calculate a simple difference between closes?
3) In the output is there a way to show the name of the security and the result (ex: AAPL = 1010)?
4) the same calculation could be done with more the one security (ex: an array with more symbols)?
5) is there a list of math and stat function to be used?

Sorry if my questions could appear silly but I don't have experience in python and I'm reading tutorials to understand this environment.

Thanks.

Max

The databases go back to 2002 I believe. The rest of your questions are all totally possible to do, but I am not going to make examples for everything. Someone else might!