How to Pick From Several Stocks?
-
Hi,
I am new at Backtrader and would like to use it in the following way:
I have several stocks I can pick from.
I would like to pick (buy and later sell) some of these stocks whenever my strategy forsees this.How can I supply several stocks within Backtrader and how can I tell Backtrader only to buy / sell these stocks I would like to?
In the examples I can only see something like: self.buy()
Is there any example that does something similar?
Thanks in advance!
The NewestTrader
-
Have you tried to search documentation and/or blog before posting a question here?
As I know it was a good blog post describing how to trade multiple stocks with backtarder. -
@ab_trader said in How to Pick From Several Stocks?:
Have you tried to search documentation and/or blog before posting a question here?
As I know it was a good blog post describing how to trade multiple stocks with backtarder.Hi, thanks for your reply. Yes, I looked for a place in the documentation where exactly this is described, but in vain.
Which blog post do you mean?
-
@ab_trader may be referring to this: https://www.backtrader.com/blog/posts/2017-04-09-multi-example/multi-example.html
Operating on the stock you want is as simple as
self.buy(data=my_target_data)
-
@Paska-Houso said in How to Pick From Several Stocks?:
@ab_trader may be referring to this: https://www.backtrader.com/blog/posts/2017-04-09-multi-example/multi-example.html
Operating on the stock you want is as simple as
self.buy(data=my_target_data)
thanks a lot, that was very helpful (I saw the blog post, but was not able to refer it to my question)