Indicators are computed in their own next, so it isn't clear what your problem is.
Docs - Indicator Development
With regards to dynamic parameters, nothing prevents you from changing the parameters and altering the calculations you make during next
@mothee said in how to get the indicator data alone?:
That adds an indicator into a sample strategy class. It is meant for experimentation purposes.
You should read the top of the forum. It will help you posting and coding:
For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
The Indicator class it not complex or simple. It is meant to be used withing the backtrader echosystem.
See: Docs - Platform Concepts - Getting a Slice
It shows how to get the data (from the current point backwards). You may also access the attribute array of each line of the indicator if you want it all.
data = indicator_instance.lines.array
Docs - Data Resampling for the general functionality about resampling
Docs - Data - Multiple Timeframe for documentation and code where the data is resampled from the lower timeframe.
You simply need to change the timeframe/compression parameters
@rstrong said in Earnings date Data:
if self.date(0) is in earnings:
If you can load the earnings' dates into that array, that would work.
Creating a data feed would be optimal in a case in which you don't know in advance when you will have access to the earnings' date. The data feed would for example await such date listening on a socket and would deliver something (for example the actual earning) on that date, giving you a cue.
But for backtesting it seems far better to load things into an array and make the logic test.