backtrader_contrib has been released.
Some of the contributions which were in the queue would for sure be nice additions for some users of `backtrader´. In order to allow for a seamless integration of those for as many people as possible, the following approach will be taken
A side project named
backtrader_contrib will be created
This project will accept pull requests
Elements submitted (indicators, analyzers, ...) will be injected into the main backtrader package
The licensing is left open to the user with one exception: no GPLv2. Being the reason that some licenses like Apache License 2.0 is not compatible with GPLv2, but it is with GPLv3
The repository will contain the license text for GPLv3, ASF 2.0, MIT, BSD
The repository will be published as a
pip package on a regular basis
I am attempting to run the sample code from:
No you are not. You are running a modified version, hence the error.
pgroup.add_argument('--target-size', required=True, action='store_true', # use target size help=('Use order_target_size')) pgroup.add_argument('--target-value', required=False, action='store_true', # use target value help=('Use order_target_value')) pgroup.add_argument('--target-percent', required=False, # use target percentage action='store_true', help=('Use order_target_percent'))
At leas there the code has been modified.
It's an error message. More cannot be said.
Not automatically. The reason to push daily timeframes to the limit of the day is to avoid them being overtaken by lower resolution timeframes. Because if the time of the daily resolution is 00:00:00 and is put in the same scheme as a data feed with minute resolution, a time 00:00:01 in the minute resolution data feed will surpass the daily resolution, which cannot happen in real life.
Correction: use the
sessionend=datetime.time(hh, mm, ss, us) parameter when instantiating a data feed and that will be the end of session.
Execution date may seem obvious to you, but see:
There are no data samples (the first 3 days of 2 data feeds would be enough)
notify_order doesn't show when the orders have been executed and there is no log of what it has actually printed.
An obvious question would be: how do you know when the orders were executed?
A working example (in case there is really a bug somewhere) is the best way to go.
pandas can help you with the resampling, but
DataFrames are not meant to be extended and doing it is a costly operation (which basically involves allocating memory and copying the previous data) The best approach would be to use a
list or an overdimensioned pre-allocated dataframe, keeping track of how many ticks have been stored for the current period.
For storage you can look into Artic: https://github.com/manahl/arctic
But the real problem is not whether
pandas can help you or if it's the best tool: real-time is the problem.
00:05:00.001, i.e.: almost 5 minutes later
00:00:01.798is the last tick for the 1st minute?
In the case of backtrader and when receiving ticks, the real-time clock is used to decide if a resampled bar has to be delivered for the chosen timeframe (1-minute in your case) even if no new tick has been seen. The logic
00:01:00.000(plus some time to allow for late ticks) and even in the absence of ticks, the resampled bar is delivered.
You may of course consider the example to be far fetched, but it does actually happen and it tends to happen more often when working with the smaller timeframes.
Should you code it yourself, take it into account.
Looks like your connection to Backtrader Community was lost, please wait while we try to reconnect.