I need an indicator to be written in Amibroker Formula Language to calculate an Nth order polynomial (sum of least squares) for backtesting purposes. The code should operate on the symbol being backtested itself, as well as a second set of the same logic/method but calculating on an index like SPX, SPY etc.. It should calculate/operate on all the bars in the data history of the symbol/index (not just the latest most bar within today's exploration) such that it can work in backtesting mode for historical bars.
I have attached two example AFL's which partially solve the problem, but are incomplete. These can likely be used as the basis for the solution. One of the examples goes part of the way in estimating the lookforward position, however it only operates on the latest most bar. The other example does not have a lookforward parameter and also only operates on the latest most bar. I do not need a large/complex solution like the larger file I have provided, in fact it can be more simple like the smaller of the example files I provided. What is essential is that I want to be able to enter four parameters into the completed indicator:
Nth order Polynomial (1st to 15th order),
Lookback Period (1 to 1000 days),
Lookforward Period (1 to 100 days),
Reference Index (Something like SPX, SPY etc.).
The code is to provide two resulting numbers:
The lookforward result of the symbol being tested,
The lookforward result of the reference Index.
It might be nice to include PLOT or FPRINT code to help me with plotting, interpretation window etc.
I would expect you have coded AFL, looping, and hopefully the Matrix related functions before. I believe the functions needed will be Matrix, MxSetBlock, MxTranspose and MxSolve or similar. I am guessing it will end up being around 50 to 100 lines of code.
5 pekerja bebas membida secara purata $140 untuk pekerjaan ini
Hello, dear friend I am expert in math, physics, statistics. I have a lot of experiences in many math and physics projects. Please discuss for your task. Best regards. Hello, dear!