How to bootstrap Amibroker array variable

yusi

Well-Known Member
#21
Mr. T. Janeczko has stated many times about why self referencing Prev is inferior to loop or AMA and about how doing it.
No doubt, Tomasz's will be the last word on the matter. But, just as the AMAs are a liner to the common construct, simple looping is as common as well.

For example, a humbler vector language such as ...err... Zerodha's algoZ offers:
LOOP(Vector1, Vector2, Offset1, Offset2, Operator).

So, to get Fibo's:
Set x = 1;
Set x = LOOP(x, x, 1, 2, ADD);
Do not have algoZ, and not tested, but I imagine that would work. Whether its slow as treacle or has internally been implemented better is an open question.
 

Einstein

Well-Known Member
#22
While garyc1st has been good to present the solution to mm7's smoothed feedback equation, it got me thinking about how general iteratives are coded in Ami's array language (without using loops).

For example, and just a typical one, how would one do Fibonacci : F(n) = F(n-1) + F(n-2) ?
how would you do that in excel sheet??
 

mastermind007

Well-Known Member
#24
trash, Einstein, Thank you for sharing the links.

Friends,

Amibroker formula using AMA2 gets accurate results majority of the time and for whichever scrips, Ami gets wrong results, Metastock also gets it wrong. (same EOD data is shared by both) This means that my EOD data is either missing few day (or has gotten different values)

I am glad that this thread has been learning experience for those involved.
 
Last edited:

trash

Well-Known Member
#25
trash, Thank you for sharing the links.

Friends,

Amibroker formula using AMA2 gets accurate results majority of the time.

Here's the breakdown for those interested.

NSE provided data for 152 scrips from which I can only test 143.
16 scrips have errors below 0.1%.
14 scrips have errors within 0.1% to 5%.
Only Wipro, AMA2 formula's result is seriously inaccurate.
NSE claims A.V. to be 46.45% whereas AB computed it at 57.57%
Then it is because of data differences! I get 48.xx%

Have you recalculated with a pocket calculator?
 
Last edited:

mastermind007

Well-Known Member
#26
Then it is because of data differences! I get 48.xx%

Have you recalculated with a pocket calculator?
Pocket Calculator, Yes Of course!!! :)

Yup, its missing data rows. Most of the missing data in case of Wipro is from 1995, 1996 and 1997 and is also not available from NSE site. Turns out that this Volatility is actually a quick way to detect missing data. Do you have any tool to extract data for scrip from ur db? if yes, I'd request data for those 3 years.
 

yusi

Well-Known Member
#27
mm7, if you have the time and inclination, could you run a sample computation in any convenient language using doubles over matching available data, and check the resultant error.

The values of absoluteReturn (= log(C/Ref(C,-1))) are far too near zero, and it is an unknown to what extent Ami uses single precision in afls.
 

mastermind007

Well-Known Member
#28
mm7, if you have the time and inclination, could you run a sample computation in any convenient language using doubles over matching available data, and check the resultant error.

The values of absoluteReturn (= log(C/Ref(C,-1))) are far too near zero, and it is an unknown to what extent Ami uses single precision in afls.
I ran the calculations in C# over same EOD data files and results matches with Amibroker, so we can be reasonably certain Ami is not introducing any errors due to floating point calculations.

Can you please extract EOD data for WIPRO from your EOD DB and send it to me? I mostly need years before 1997. Opening date for wipro in my system is showing as 01/Feb/95 and data during 95, 96, 97 is very sporadic. After June 97, there are only 3 days missing

1998-02-12 Thu
1999-03-29 Mon
2000-09-01 Fri
 
Last edited:

yusi

Well-Known Member
#29
Can you please extract EOD data for WIPRO from your EOD DB and send it to me? I mostly need years before 1997. Opening date for wipro in my system is showing as 01/Feb/95 and data during 95, 96, 97 is very sporadic. After June 97, there are only 3 days missing

1998-02-12 Thu
1999-03-29 Mon
2000-09-01 Fri
Sorry, do not have it loaded.

You could put in a request to Subroto (sr114). He has been uploading data from inception (based on getbhavcopy); and it is bonus adjusted if applicable in this case.
 

Similar threads