For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
Getting a calculated value from strategy
-
I have a number that is calculated in the strategy when it is initialized. I would like to retrieve this variable, but it does not seem possible to get this from cerebro because it instantiates the strategy itself. What is a way around this?
-
Quoting the docs: "cerebro returns the instances of the strategies it created during backtesting. This allows to analyze what they did, because all elements in the strategies are accessible"
See here: https://www.backtrader.com/docu/cerebro/#returning-the-results
-
Ah, I missed that in the documentation. Thanks a lot, my problem is solved now!