I started using _TRACE and find that the only number that comes back from 
"IndustryID() == IncludeIndustry( IndustryID() )" is 0, therefore IndustryID == 
0 works, but all others fail.
Wondering if the problem is with the format of the created IDs file or the read 
of the IDs file ???

Any thoughts

--- In [email protected], "gmorlosky" <gmorlo...@...> wrote:
>
> Here is the latest code, but it still is displaying in an Explore only 
> IndustryID() == 0.
> I did make 2 changes to the code:
> 1) flipped the StrFind parameters
> 2) expanded the Filter to include IndustryID() ==
> 3) Commentary display of printf(ID) looks like this:
> 
>  ,,0
>  ,1
>  ,2
>  ,3
>  ,4
>  ,5
>  ,6
>  ,7
>  ,8
>  ,9
>  ,10
>  ,,
> 
> 
> 
> _SECTION_BEGIN("ReadingCSV Function");
> Title = "ReadingCSV Function";
> id = 0;
> function IncludeIndustry( id )
> {
>     local ids;
>     local fh;
> 
>     ids = ",";
>     fh = fopen( "C:\\AmiBroker CSV\\ABTest.csv", "r" );
> 
>     if ( fh )
> {
>     while ( !feof( fh ) )
>     {
>         ids += fgets( fh );
>         ids += ",";
>         printf( ids );
>     }
>     fclose( fh );
> }
> //    return StrFind( "," + id + "," , ids); // original code
>     return StrFind( ids, "," + id + "," );
> }
> 
> //Filter = IncludeIndustry( IndustryID() ); // original code
> Filter = IndustryID() == IncludeIndustry( IndustryID() );
> 
> Buy = Close >= 0;
> Sell = Close == 0;
> AddColumn ( Buy,"Buy" );
> AddColumn ( Sell,"Sell" );
> AddColumn ( Close,"Close" );
> AddTextColumn( FullName(),"FullName" );
> AddColumn( id, "Id" );
> _SECTION_END();
>


Reply via email to