Just to provide an example,
strategy1 = cerebro.run()
st = strategy1
# To return something back from the strategy -
df = st.params.results # Will return your df back.
st.params.midmaperiod # will return back 20 and so on.
@Eduardo-De-La-Garza said in Get Highest and Lowest value of first 15 Minutes data:
Can you explain that line of code? When would they not be different?Thanks!
One minute date, checking for new date at the beginning of the day. :)
@soulmachine said in How to use two CommissionInfo inside a strategy?:
Since data has only one name, so it's not possible to apply multiple commission fees?
You're probably right. AFAIK a single commission could be specified per data name or default. As @run-out correctly mentioned - you may develop your custom commission scheme.
@Stefan-Krecher said in When and how to execute the first an only trade in a buy-and-hold strategy:
So what am I missing here?
bt executes the orders on the next bar open price since this is the next available price after the order is issued in the next() or nextstart().
Moving average values at the very beginning are not defined by the moving average definition. Therefore nothing can be shown. If you want to show moving average value on particular bar, than you need to have 21 bar before this.
Still stuck on this issue for a week now, anyway I could contact you on Discord/Telegram? In my head coming from a trading background this is so simple but I can't manually do the strategy fast enough for it to be viable..
@André-Tavares said in How can I inherit params from a parent class and append on the child class?:
No need to update the params dict. The parameters from the base classes are fused automagically by metaclass during the instantiation. You may take a look at the following post as well: https://community.backtrader.com/topic/2379/difference-between-params-and-p/2
@tianjixuetu thanks for the follow-up. when I run this, I'm getting an error however.
ImportError Traceback (most recent call last)
<ipython-input-5-aadcf5db5945> in <module>
----> 2 from . import Indicator, Max, Min, MovAv,Average
4 class AverageTrueRange(bt.Indicator):
ImportError: cannot import name 'MovAv' from '__main__' (unknown location)