over the past year I have learnt to program DLL plugins (to some extent) with the help of some Amibroker users. I still know very little about C++ but today returned to DLL programming to try to implement a cubic spline using free resources on the internet. That was very easy! So I am a bit excited about that. Not sure if Cubic Splines have any predictive value but they can be used just like polynomials to make predictions about the future. Which makes me think about a quoted quote I just read by Paul Levine a few days ago: "Prophecy is extremely difficult, especially as regards the future!".
will post the DLL + AFL a bit later (maybe) since it looks like I have a memory leakage problem which I have to correct for
yes not sure yet how to use it. Looks like my DLL is ok, I was having some other problem. But will check it first and then post it, maybe tomorrow. The math world has many amazing things that can be used, splines are 1 of them. Many info about Splines. I am no math expert but know a few things that are out there. There is many more
@empottasch I tried developing a cubic spline DLL using “free resources on the internet”. This was many years ago. I discovered the algorithm had future leaks and abandoned the effort. The built-in future leak detection in AmiBroker does not check for leaks in user-written DLLs. I used bar-replay to discover the future leaks. Having never seen your code, I’m not saying your code has future leaks, but it is something you may want to test.
yes the curve does “repaint”. Like in my chart the top red curve => once a new point comes in that you use to calculate the spline then it will repaint. So the predictive value will only be before a new point comes in
like in this channel code I posted:
you can use only parts of the channel that do not look into the future. The lightblue channels do not look into the future of the code in that link. Similarly that can be done for splines i think
i think this memory problem was not due to my plugin. So try it out if you like. As always on your own risk. You can always just delete it from the plugin directory. I assume you know how it all works and where you need to put the plugin. The plugin is for 64bit Amibroker assuming you have installed the latest Microsoft stuff that Amibroker installes for you
below the AFL, hope the plugin uploads correctly …
no can’t upload DLL so will do some other way next few days
Thank you very much for your contribution. I will work on it with a great interest.
Concerning potential applications, one is a method called EMD (empirical mode decomposition). It allows to split a signal into a trend and cyclic components. It is 100% procedural and it does not make any assumption on the nature of the signal. It is therefore well adapted for non linear and non stationary time series.
It seems quite simple to implement in AFL once you have a spline module. Nevertheless,repainting seems to limit its capacity for real trading application.
Thanks again for sharing your work.
here is an example how you could use it without the fear of repainting (to run this code you need the plugin)
with the mouse you can select a bar in the chart. The data before that bar (blue separator) is used to calculate the spline, the data after that bar is the extended spline and does not use data after the vertical blue separator. In the chart the light blue and violet curve is the extended (non-repainting) spline.
looks indeed like you can use it to extrapolate but it is not very good in doing so, meaning that the predictive value is low. As I come to understand, Splines are very well suited for interpolation but not for extrapolation. So for forecasting we need some other functions
I agree with you, potential for real trading is limited. Moreover, there is no room for backtesting.
By the way, I have downloaded your dll but it is a 64 bits and I cannot run it on my 32bits AB. Would you have a 32 bits version?