Hi!
I am completely stuck! I figured the best way to start learning the IDE would be with the basics - plot some simple charts with indicators for trades that I have identified using scanners I've put together in Trade Ideas. The trades would be intra-day. I would then refine the algorithms then look at going live.
However, I am coming up with a total blank. All examples in the Documentation and in the Community show that in order to plot data, especially candlesticks, then one must set Holdings in order to do this. This does not make sense as the holdings are not the price of the asset, merely a virtual holding based on a user-set initial dollar amount.
I must be missing something very fundamental here and would really welcome your advice!
Many thanks,
Paul Beharrell
Petter Hansson
Hello Paul,
this thread slid down to second page, hence nobody found it. I will try to give an answer:
Intraday charting is not available in the backtest environment. I *think* you can do that in the Python research environment by simply plotting whatever data you like in it, though I haven't used this myself yet. Of course, a more advanced alternative is to run Lean locally and create charts in whatever library you have, if you can deal with the setup issues (including data warehousing).
As for SetHoldings, it calculates a target quantity w.r.t. to the symbol's price in order to attempt to make the specified fraction of the portfolio's value be invested in that symbol. Then, a market order is generated if the target quantity is different from the currently held quantity.
Almost all my algos start out with SetHoldings because it's quickest for prototyping, but later I replace these calls with custom order management (QCAlgorithm.MarketOrder, QCAlgorithm.LimitOrder, etc.) Reasons for doing this manually include stoploss, latency, and error handling,
Paul Beharrell
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.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!