I've corrected your code...
_SECTION_BEGIN("ADLine Clssic");
aI = Foreign("~StocksAdv","X");
dI = Foreign("~StocksDec", "X");
UncI = Foreign("~StocksNC","X");
ad = aI / dI;
Difference = (aI)-(DI) / ( UncI + 1 );
DiffSqrt = IIf( Difference > 0, sqrt( Difference ), - sqrt( -
Difference ) );
//ADLine = (Cum(DiffSqrt ));
//Plot (Cum(diffSqrt),"ADline",colorBlack,styleDots);
Plot(Cum(diffSqrt), "ADline", colorRed, 1);
_SECTION_END();
Thomas
www.PatternExplorer.com
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf
Of areehoi
Sent: Wednesday, December 10, 2008 10:50 PM
To: [email protected]
Subject: [amibroker] AD Line formual .... help
For the life of me I can't get this AD line formula to work. It keeps
hanging up with syntax error on first line and I can't figure out why.
I've used almost exact formula in other instances and it works fine.
Composites are set up for the "~" so the data is there. Any or all
help will be appreciated.
Dick H.
_SECTION_BEGIN("ADLine Clssic);
aI = Foreign("~StocksAdv","X");
dI = Foreign("~StocksDec", "X");
UncI = Foreign("~StocksNC","X");
ad = aI / dI;
Difference = (aI)-(DI) / ( UncI() + 1 );
DiffSqrt = IIf( Difference > 0, sqrt( Difference ), - sqrt( -
Difference ) );
//ADLine = (Cum(DiffSqrt ));
//Plot (Cum(diffSqrt),"ADline",colorBlack,styleDots);
Plot(Cum(diffSqrt, "ADline", colorRed );
_SECTION_END();
Note: Amibroker help menu says this is the formula.
" Difference = ( AdvIssues() - DecIssues() )/ ( UncIssues() + 1 );
DiffSqrt = IIF( Difference > 0, sqrt( Difference ), - sqrt( -
Difference ) );
ADLine = Cum( DiffSqrt );"