I have calculated the time-weighted return for different periods using the code below for several years.
type _SECTION_BEGIN("Time-Weighted Return");
// This formula calculates the time-weighted return for different periods.
// Calculate the 5 day time-weighted return
twr5 = Prod( C, 5 ) - 1;
// Calculate the 21 day time-weighted return
twr21 = Prod( C, 21 ) - 1;
// Calculate the 63 day time-weighted return
twr63 = Prod( C, 63 ) - 1;
// Exploration
Filter = 1;
AddColumn( C, "TWR", 1.5 );
AddColumn( twr5, "5-Day TWR", 1.5 );
AddColumn( twr21, "21-Day TWR", 1.5 );
AddColumn( twr63, "63-Day TWR", 1.5 );
_SECTION_END();or paste code here
Recently, I had to reinstall Amibroker on my computer due to a hard drive issue. I ran the code below for the first time and got an error that the identifier 'prod' is undefined and the operation is not allowed.
I double checked the Amibroker function reference guide and seem to be using the 'prod' function correctly.
Why am I getting this error when I have never gotten it before?