-
Notifications
You must be signed in to change notification settings - Fork 261
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Modify Dev_Strat to add technical indicators #31
Comments
I'd say no solution with "acceptable generalisation properties"; at the time present convergence on train data has been improved, see:
You absolutely correct that finding valuable signal features is critical to agent's performance and is an one open direction for future work. In brief, it is essential to provide agent with stationary (in terms of data), normalised and noise-free signal features with [possibly] some level of abstraction. It is also a question of finding balance between hard-coded, data-independent features (like SMA or other indicators) and learnable, data-dependent features (agent's convolution encoder). An example above, providing agent with just simple SMA-type of features greatly improves train data convergence ability. Adding other types of indicator may also be beneficial. An important complimentary direction, closely related to generalisation ability, is searching for disentangled hidden state representations, such as in beta-VAE approach in DARLA algorithm: https://arxiv.org/pdf/1707.08475.pdf
Take a look at Dev_Strat_4_11 class, it does exactly that:
... it purely backtrader-specific:
And that's all: bt.Cerebro() engine takes care of computing indicators with burn-in periods, and only after that strategy execution starts, refer to Also refer to
|
Thank you for your quick response @Kismuz . My next step is to figure out how to replace the FOREX data with my own, which I believe you have mentioned in other issues, so I am just gonna read those. Really appreciate your help. Keep up the good work!! |
@Kismuz MyDataset = BTgymDataset( by: class ExtraPandasDirectData(btfeeds.PandasDirectData):
class ExtraLinesDataset(BTgymDataset):
params = dict(
) MyDataset = ExtraLinesDataset( However, when I took a look in the derivative.py file where BTgymDataset located, I saw that you mentioned **kwarg is deprecated, so what passed as **params did not have any impact on reading the new file. So my question is: what is your plan in streamlining the process of importing new data files? I could keep debugging and modify your files to make it work but this would cause me trouble everytime I tried to pull update request from your github. Could you provide me some directions on how to tackle this issue? Also, just FYI, I am very interested in learning more about what you are doing with the btgym, so if you have sometime to mentor me about this package, I can pay back by my time to work on whatever task that you have in mind for the btgym package. Thank you. |
There is generic data iterator class
Pp. 2 and 3 are implementations of data abstractions outlined here and related to my attempts to properly formulate algo-trading problem in terms of learning and meta-learning in changing POMDP environments. All of them internally relies on pandas data frames methods.
Yes, because BTgymDataset is particularly demo "end-user" class which actually not supposed to be further worked with, but may serve as template. To implement your input pipe with similar to BTgymDataset functionality (which is actually simplified) it is better take base class, copy/paste BTgymDataset methods you want, throw away deprecation related staff and everything else you don't need, add your parser setup and name it BTgymDatasetStocksWithNews or whatever you like. It is an open question how to categorise and grow such an hierarchy of instruments and source-specific classes. Think It is sensible to follow proven Due to questions repeatedly asked I see it is time to make some extended roadmap and outline of open work directions; and maybe related papers shortlist. Will work in it. For now: https://kismuz.github.io/btgym/intro.html#environment-engine-description https://kismuz.github.io/btgym/intro.html#a3c-framework-description |
Thank you @Kismuz ! |
@Kismuz |
@ryanle88 Could you please elaborate on this method you took to use additional features in the CSV? I am stuck with a similar problem and I am not able to wrap my head around how to solve this. Appreciate your help. @Kismuz Considering this is an old thread, Has there been any new changes related to this particular problem of being able to use additional features/indicators straight out from the CSV file? Or this is the recommended approach? subclassing BTGymBaseData? Appreciate your insights as well. Wonderful framework by the way. Keep up the awsome work. |
@Kismuz First of all, thank you so much for creating this awesome gym. It is probably the best gym for trading that I could find on the web at the moment.
As I have read all the threads from other issues and also run the A3C Random notebook that you provided, the reward did not converge over time. I saw you have mentioned that as of now, you have not found any good solution that could lead to the convergence. I have spent sometime with the package, especially with the notebooks examples, and just thought maybe if we provided more information to the agent like technical indicators or the like, it would help improve the performance. I have tried to modify the Dev_Strat_4_6 by adding two simple moving average (50, 100) but keep getting the State observation shape/range mismatch, which I believe is due to the NAN problem since there is no data for the second indicator for the first 100 records. I could fix the problem by set the skip_frame to 100 but this is not a very data-efficient solution. Could you please help instruct me how to tackle this problem? Thank you in advance.
The text was updated successfully, but these errors were encountered: