Back

Algorithm Help, New to QuantConnect :(

Hi, I'm new to this site, I've been using Quantopian mostly. I had a question regarding syntax/how to approach my algorithm within the structure of QuantConnect. So what I'm trying to do is buy a stock, let's say "IBM" at open and keep track of that price. Then throughout the day sell all my shares in IBM if the current price rises by 30 cents or so, and buy as much as I can if the price drops by 20 cents or so. Then at the end of the day just sell all shares. Very simple but my implementation is throwing lots of errors :(

Update Backtest







Hi Michael,
I'd suggest checking out the algo examples. You will likely find something that could be used as a base for your algo.
-E

0

0


Thanks for the advice :) I'm now curious why my returns are so horrid based on the backtest above, I was expecting around 30 percent return or so. Any obvious/trivial reason that you see why my returns are this way? 

0

Welcome to the QuantConnect community! It looks like the algorithm is doing exactly what was intended. If we walk through the trading logic, AAPL is bought at market open and then we decide to either invest in AAPL if the price is going down by 20 cents, or sell AAPL if the price is going up by 30 cents. So we set a limit on the daily profit to 30 cents per share, and have an unlimited loss until the end of trading day.

0

Awesome, thanks Gurumeher! Was the choice of OnTick rather than OnData the correct move if you don't mind me asking your opinion? Thanks again :)

0

Update Backtest





0

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 QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect 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. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Loading...

This discussion is closed