Hi, big guys
Amibroker Version 6.40.4
Question 1:
There a formula (Xi - X_bar)
How to use ARRAY to express instead of LOOP? (it’s not efficient with loop.)
Sample code :
Period = 5; // Start Index
CloseAverage = MA(Close, Period);
IndexValue = 0;
for (i = Period; i < BarCount; i++)
{
for (j = 0; j > 5; j++)
{
IndexValue[i] = Close[i-j] - CloseAverage[i];
}
}
Question 2:
There’s a series with both positive and negative numbers (see picture for example), if i want to select down 5 positive numbers from X starting value (date) to calculate it, like examples 1~3 below. How can i use ARRAY to express instead of use LOOP?
thanks.