@Grant: I think those are great ideas to explore and it is definitely something we want to enable at Quantopian. The first step is to make it easy to build your own data transforms which I'm working on right now. The current syntax would look something like this:
@batch_transform
def spectral(data):
____Pxx, freqs, bins, im = specgram(x[SID]);
____return Pxx, freqs
(sorry for the mess but there seems to be something wrong with pasting code).
The decorator provides the functionality of a sliding window of the trading events. Data will be a pandas dataframe where each column contains the price history (the window length can be specified by you) for each sid.
You would then call this function inside handle_data(context, data):
Pxx, freqs = spectral(data, sids=[21, 1024], refresh_period=5, days=5)
This will keep a sliding window of 5 days and recompute the FFT every 5 days. Data will contain the price for sid 21 and 1024.
What do you think of that syntax/functionality?
The second step is how to display the results which is where plotting becomes relevant which touched on in our previous discussion.
Disclaimer
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.