Hi
I am trying very hard and I still cannot make QuickAFL work in an Analysis Window.
I have the following script that can run from an AW. It is supposed to give results like this, IF QuickAFL is really working:
>>>>>>>>>>>>
bi (local BarIndex)= 200
Absolute Barindex from quickaflfirstdatabar = 1,240
bi (local BarIndex)= 201
Absolute Barindex from quickaflfirstdatabar = 1,241
bi (local BarIndex)= 202
Absolute Barindex from quickaflfirstdatabar = 1,242
bi (local BarIndex)= 203
Absolute Barindex from quickaflfirstdatabar = 1,243
<<<<<<<<<<<<
Unfortunatelly I cannot make it work. It seems that ALL bars are acounted and this is the result I get:
>>>>>>>>>>>>
bi (local BarIndex)= 1,240
Absolute Barindex from quickaflfirstdatabar = 1,240
bi (local BarIndex)= 1,241
Absolute Barindex from quickaflfirstdatabar = 1,241
bi (local BarIndex)= 1,242
Absolute Barindex from quickaflfirstdatabar = 1,242
bi (local BarIndex)= 1,243
Absolute Barindex from quickaflfirstdatabar = 1,243
<<<<<<<<<<<<
Here is the code:
>>>>>>>>>>>>
procedure _MYTRACE( part_diag_filename, msg )
{
local fh, fullpath;
fullpath = "c:\\broker-error\\debug" + part_diag_filename + ".txt";
msg = msg + "\n";
fh = fmkdir( "c:\\broker-error\\" ); // make dir in case it is not already there.
fh = fopen( fullpath, "a" ); // open file for Append
if( fh )
{
fputs( msg, fh );
fclose( fh );
}
else
{
printf( "Error_message failed: Error opening " + fullpath );
_TRACE( "Error_message failed: Error opening " + fullpath );
_TRACE( msg );
}
}
part_diag_filename = "bbbtest3";
bi=BarIndex();
msg="bi (local BarIndex)= "+NumToStr(bi,1.0);
printf(msg+"\n");
_MYTRACE( part_diag_filename, msg );
FirstBar = Status( "quickaflfirstdatabar" );
AbsBarIndex = FirstBar + bi;
msg="Absolute Barindex from quickaflfirstdatabar = "+NumToStr(AbsBarIndex,1.0);
printf(msg+"\n");
_MYTRACE( part_diag_filename, msg );
SetBarsRequired(300,0);
<<<<<<<<<<<<<<<<<<<
If somebody could tell me what I am doing wrong.
This was first asked here:
http://forum.amibroker.com/t/quickafl-and-analysis-window/1157/17