Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Slight Change with good return and low drawdown

Exelis Inc and Computer Science Corp are related thru Jet Propulsion Labs and this algo looks good. Any thoughts?

7 responses

giid = good, bad typing

doesn't look so good to me. If you were to buy and hold CSC during that time frame you would beat your algo.

i think you have a bug on line 132, the calculation of % correct. the sign should be flipped

if spread < 0:  

doing that shows your adverage prediction to be around 53%, which would make sence seeing as you are getting a positive return.

EDIT: sorry i'm wrong, i didn't read the above comments. so that makes me wonder why you are still seeing a positive return if you are only correct 48% of the time?

I added a call to set_benchmark to bench the algo against the stock itself. Jason is right that the stock's returns are higher, but the volatility and max drawdown of the stock are also much higher.

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.

I feel that limiting your short exposure to -0.5 is data snooping bias, given that the underlying stock has had a stratospheric rise.

also if you change your backtest period to start May 2011 you will gain significantly more volatility.

i also think that your stepsize of 0.1 is effectively data snooping bias, as this is turning your algo into a lagged-contra indicator....

finally, i think i found a bug: around line 33 wheren you trim the length of X and Y, you should use

del context.X[:-60]  
del context.Y[:-60]  

because I think otherwise you are keeping the original training set

with that change I get more robust results with undesirable period like 2011, but still not particularly noteworthy it seems to me....

How did you decide that XLS is a contra indicator for CSC? you say they are related through JPL but maybe elaborate?

All my criticisms aside, I really think this is an interesting idea as i have not used neural nets before. Maybe this would be interesting for pair trading?

Been out fishing in The Gulf. I tried the "del context.x/y" lines on line 33 and 34. Better return but a 10% increase in drawdown totaling 17.6%. This is a deal breaker for me. I am trying to keep a drawdown of less than 10%. XLS and CSC both contract with/thru JPL and their work overlaps and majority of the time. So, when 1 of these 2 companies gets a project contract the other takes a theoretical loss. This is my "contra-indicator theory" on these 2 companies.
Thank you to everyone that has replied or looked at my algo. I will be sharpening it up over the next month. I will start a new thread upon next major return increase, somewhere around 200%.

Hi Darrell, it's your choice of course, but I think you should seriously reconsider keeping a strategy with known technical errors just because it gets higher returns than the fixed version.

With that in mind, I found numerous other technical errors with this strategy:

1) your "contra" parameter is basically saying "do the opposite of what the neural net predicts" so if it predicts an inverse correlation, you are executing the opposite....
2) your training dataset (XLS) is not the same security used for prediction (CSC). this pretty much invalidates everything right there.

i might have found more issues when looking at this, sorry i deleted my notes already.