-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Good First Issue >> Renko #152
Comments
Hello @Winthan, Added to the end of the list. Regards, |
@twopirllc Any update on that? |
Hi @codesutras, That would be great if you could look at it. From my initial review and investigation into Renko development yielded the same issue with indexing since it's index is not equivalent to the underlying ohlcv index. The Renko method/function would need to create a new DataFrame with it's own index, essentially a one way transformation. Thanks, |
You are correct. As of now I've been using renko dataframe and then using ta indicator on top of it. And handling the indexing at that. So, we've just have to apply the same logic if chart type renko in strategy class. Can we connect sometime today to discuss on this. So, that you can discuss the current strategy class code and you can guide me where do I have to keep this renko class. 🙂. Since, from my end all the things are available. We've just need to see that where I have to integrate my codes. |
Nice. What is name of the returned column when you call
Sure. But it's night time here and tomorrow is Mother's Day, so my time may be limited. Though there is no rush.
Excellent. If you want to share via my email, that is fine as well. Thanks, |
Hey, so columns in Renko will be the same, eg: open, close, low, high. And Renko doesn't use volume. As it's an only price chart :) and of course, Renko can only be used with price-based indicators. Not with indicators like VWAP (which uses volumne). That's the practical aspect. My renko class returns a dataframe. Which can be further used to apply indicators. And yeah, I'm doing reindexing before applying indicators.
In the case of strategy, I'm getting attached exceptions. I'd dropped you a mail already. Let's connect when we both are available to discuss it further and plan it out. No rush from my end too. Thanks, |
Hi @codesutras |
Quality converting to Renko needs much more work. I'm trying to keep the date/time index and to offset in advance by given delta (1sec) all extra bricks from gaps or fast moving bars. I also try to keep the volume like in TradingView by dividing the bar volume to number of result bricks and this is the brick volume. Then all volume indicators will work. I also add columns with real open and close prices from the original bars to all generated bricks from this bar in order to have real backtesting results with analyzing bricks but trading with the real open/close price for this brick. Fixed size and ATR brick size is only good for intraday and short term analysis. I also use log scale (by a given percentage of price increase/decrease). This way the brick size is smaller for old periods where the price of the stocks was times less than now. Otherwise the backtesting shows unbelievable wrong results. And so on details that matter. |
I agree. Do you have some code to share or would you like to contribute? 😎 Kind Regards, |
Unfortunately, I don't plan to implement this as part of pandas_ta because the result will be not compatible to the index of the rest of the indicators. It doesn't fit at all for this library. I'm trying to do it as part of my version of backtesting.py library where I have internal function to get ochlv data from a database with options to convert them to Renko or Heikin Ashi. Then with the resulting new index all other indicators will be attached properly to the Renko dataframe. When I keep the original open and close price available for each brick, the backtesting can be real. When I'm ready, I can provide the portion related to Renko converting even though it is clear enough how to do it with the notes I already mentioned here. My Python knowledge are not profound and I just want the code to be properly working, not perfectly written. |
I managed to make it work with a work around using another library to build Renko bricks(dataframes) and use it with pandas-ta. I used stocktrends (https://github.com/ChillarAnand/stocktrends) to build Renko data frames |
Stocktrends is done somehow to do the job. I started with it but found there is no atr support, no percentage log support, no volume, the date in the index for all extra bricks are the same, very low speed for large data frames or small brick sizes due to the concatenation of two data frames for each new bar and initially I had to add data frame caching to speed up the repeating analysis, no functions to evaluate the quality of selected brick size, no corresponding original trading prices for each brick that makes impossible the real backtesting, etc. The best way is to be completely rewritten. |
Right because Renko is time invariant.
How do you like backtesting.py? I use vectorbt.
Fair enough. |
@mobilepro Thanks for sharing a link |
Thanks for the information. I will take a look. I tested several backtesting frameworks but didn't find exactly what I needed. So, I started from the simpler one that was easy for me to understand and I tried to redo and to simplify the core logic to be able precisely to backtest several stocks and at the same time to trade several other options in complex strategies. I also needed to be able to use many standard indicators from all great TA libraries like yours and at the same time to be able to add easily my own indicators. I feel happy that I understand in details the one I write and I can modify at any moment whatever is needed to be modified. That's priceless. |
No worries. Makes sense. You may be interested in trying the Custom directory so you can incorporate your own indicators and have them hook into Pandas TA. Let me know if you do and if it works for you.
That's for sure! KJ |
Which version are you running? The lastest version is Github. Pip is for major releases.
Upgrade.
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
Thanks for using Pandas TA!
The text was updated successfully, but these errors were encountered: