Back

Assistance with Plotting Behavior

I developed an algorithm that was not functioning as expected so I reduced it to simply buying and holding a stock. However when I click on the Stockplot and select the stock the plot show a large number of trades. Any idea what I might have done wrong? Thanks in advance for any suggestions
Update Backtest








Hey @Tim, welcome to QC :) Please post your algorithm and we can help you debug,

Best,
Jared
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.


Second attempt at attaching project, added backtest as well
0


Hey @Tim -- "trades" is defined as a closed trade (open-close). We might update this to be just total orders sent because its a misleading number.

The algorithm seems to be behaving as expected. It only buys until you've maxed out your leverage, and then rejects the last few orders because you don't have sufficient capital.

When the asset price falls you get margin calls which trigger the sell orders nearing the end!
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.


Hi Jared,

Thanks so much for the prompt response. It turns out the problem was with my Debug statements and how they were being displayed in the console - they were leading me astray. It is also really good to know that margin and margin calls are actually automatically handled in your code. Pretty impressive platform. Thanks for your work, and for making it public.
0

No problem Tim! Its thanks to lots of hard work by @Gustavo and @MichaelH, and thanks to the awesome Pioneers, subscribers who support the project.
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.


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