- Joined
- 20 January 2010
- Posts
- 87
- Reactions
- 5
Hi dunno where to post this stuff, but as im reading through Howard Bandy's "Introduction to AmiBroker" I sometimes come across stuff which im confused on. Could someone pls annotate wats goin on each line? (hope this is okay). Especially dont get whats happening with the result, input and i.
From the section on user defined functions:
function IIR2( input, f0, f1, f2)
{
result[ 0 ] = input[ 0 ];
result[ 1 ] = input[ 1 ];
for( i = 2; i <BarCount; i++ )
{
result[ i ] = f0 * input[ 1 ] +
f1 * result[ i - 1] +
f2 * result[ i - 2];
}
return result;
}
Plot( Close, "Price", colorBlack, styleCandle );
Plot( IIR2( Close, 0.2, 1.4, -0.6 ), "function example", colorRed );
Cheers!
From the section on user defined functions:
function IIR2( input, f0, f1, f2)
{
result[ 0 ] = input[ 0 ];
result[ 1 ] = input[ 1 ];
for( i = 2; i <BarCount; i++ )
{
result[ i ] = f0 * input[ 1 ] +
f1 * result[ i - 1] +
f2 * result[ i - 2];
}
return result;
}
Plot( Close, "Price", colorBlack, styleCandle );
Plot( IIR2( Close, 0.2, 1.4, -0.6 ), "function example", colorRed );
Cheers!