TulipCharts / tulipindicators

Technical Analysis Indicator Function Library in C
https://tulipindicators.org/
GNU Lesser General Public License v3.0
841 stars 157 forks source link

Data Transformation (Renko Charting, Volume Profile) #33

Open codeplea opened 5 years ago

codeplea commented 5 years ago

It would be nice to add in calculations for Renko Charting and Volume Profile. The issue with these is that the input/output interface will need to be different from the existing indicators. The output array size isn't know for either until after the calculation is completed.

For Renko Charting, it would be nice to pass in date/time values and have Tulip Indicators copy those into the outputs. Because there isn't a standard way of storing date/time in C, I don't see an obvious good way of doing it. One idea would be to pass in the date/time value size (e.g. array stride), and copy based on that. Another way would be to simply have TI return indices instead of values. The indices method feels more generic, which is important for TI being easy to write bindings for.

Volume profile doesn't need to work with date/time, but it has the problem that there is no way to cap the maximum output size ahead of time. At least with Renko the output is strictly smaller than the input. I really don't want TI to do the output allocation, so I'm thinking that it would instead use a return value to tell the caller that the output isn't big enough. This isn't very efficient, but it keeps the interface more generic.