I have written a least squares fit to a quadratic equation. It was quite difficult due to the computation of the coefficient of the x^2 term. The problem is that AB uses single precision math, and the computation would 'blow up' every so often because the coeff of x^2 is the difference between two very large numbers.
I used the technique of Gaussian Elimination and had to create a separate time base to prevent the 'blow up's. Then, if you want to do backtesting, it is necessary to extract arrays of price data n-days back, then align and load them in with the artificial time base array before you start the Gauss. It is really quite messy, but I was able to make it work eventually. So of course the REAL question is if it works better than - say - a linear regression which Tomasz has kindly pre-programmed for us. Being slightly 'bendy' because it is a section of a parabola, entries occur a bar or two earlier, and exits are similarly. Whipsaws are also a little increase because of the flexability. In all, it works better than a linear regression, but not a lot better. The code is not available - as it is used commercially. ReefBreak --- In [email protected], "d_hanegan" <[EMAIL PROTECTED]> wrote: > > Hello All: > > Sigma Bands aside, has anyone seen or done any work on nth order > Polynomial Trendlines? > > Thanks. > > Dan > Please note that this group is for discussion between users only. To get support from AmiBroker please send an e-mail directly to SUPPORT {at} amibroker.com For other support material please check also: http://www.amibroker.com/support.html Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/amibroker/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/amibroker/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
