A qestion about AFL Formula.

#1
Is possible to export in a single file (named symbol.kkk) automatically, "ONLY" a list of symbols (stored in a watchlist) using an Exploration (Automatic Analysis)?

Oh yes I can already to do this: WL >>> Export in a file. But if there is a way to do this (after an exploration) automatically, is better for me.


Important: the list of symbol must be all one "below" other and not one "after" other.

1. Is OK:

A
B
C
D


2 Not OK : A B C B


I've found this (formula below)but is not OK because symbol follow other symbol:
A,B,C,D etc...

--------------------------------------------------

WatchListNo = Param("WatchListNo", 0, 0, 63, 1);

fh = fopen( "C:\\Temp\\myfile.kkk", "w");

list = CategoryGetSymbols( categoryWatchlist, 1 );

for( i = 0; ( symbol = StrExtract( list, i ) ) != ""; i++ )
{
fputs( symbol + ",", fh );
}

fclose( fh );

------------------------------------------------------


I don't know if is clear my question but for better explanation I wait your reply.

Could anyone help me with a sample formula?
Thank in advance for help... :)
 
Last edited:

KelvinHand

Well-Known Member
#2
Is possible to export in a single file (named symbol.kkk) automatically, "ONLY" a list of symbols (stored in a watchlist) using an Exploration (Automatic Analysis)?

Oh yes I can already to do this: WL >>> Export in a file. But if there is a way to do this (after an exploration) automatically, is better for me.


Important: the list of symbol must be all one "below" other and not one "after" other.

1. Is OK:

A
B
C
D


2 Not OK : A B C B


I've found this (formula below)but is not OK because symbol follow other symbol:
A,B,C,D etc...

--------------------------------------------------

WatchListNo = Param("WatchListNo", 0, 0, 63, 1);

fh = fopen( "C:\\Temp\\myfile.kkk", "w");

list = CategoryGetSymbols( categoryWatchlist, 1 );

for( i = 0; ( symbol = StrExtract( list, i ) ) != ""; i++ )
{
fputs( symbol + ",", fh );
}

fclose( fh );

------------------------------------------------------


I don't know if is clear my question but for better explanation I wait your reply.

Could anyone help me with a sample formula?
Thank in advance for help... :)

Change the ',' to '\n'
 
#3
Thank You very much.
Now formula work very well.

Now I have latest question.

If a I want fullname of Symbol?
Now Below the formula work well:


--------------------------------------------
fh0 = fopen( "D:\\mystocks\\alpha.kkk", "w");

list0 = CategoryGetSymbols( categoryWatchlist, 0 );

for( i = 0; ( symbol = StrExtract( list0 , i ) ) != ""; i++ )
{
fputs( symbol + "\n", fh0 );
}

fclose( fh0 );
-------------------------------------------

I've try to add FullName() after symbol + but (no error on debug) the result is wrong (equal fullname for all stock).

Thanks for help.
 
Last edited:

sudris

Well-Known Member
#4
Thank You very much.
Now formula work very well.

Now I have latest question.

If a I want fullname of Symbol?
Now Below the formula work well:


--------------------------------------------
fh0 = fopen( "D:\\mystocks\\alpha.kkk", "w");

list0 = CategoryGetSymbols( categoryWatchlist, 0 );

for( i = 0; ( symbol = StrExtract( list0 , i ) ) != ""; i++ )
{
fputs( symbol + "\n", fh0 );
}

fclose( fh0 );
-------------------------------------------

I've try to add FullName() after symbol + but (no error on debug) the result is wrong (equal fullname for all stock).

Thanks for help.
for fullname of ticker use the OLE interface. "Stocks" object and the "Stock" sub-object it has a property of "FullName"
 

KelvinHand

Well-Known Member
#5
Thank You very much.
Now formula work very well.

Now I have latest question.

If a I want fullname of Symbol?
Now Below the formula work well:


--------------------------------------------
fh0 = fopen( "D:\\mystocks\\alpha.kkk", "w");

list0 = Categorizations( categoryWatchlist, 0 );

for( i = 0; ( symbol = StrExtract( list0 , i ) ) != ""; i++ )
{
fputs( symbol + "\n", fh0 );
}

fclose( fh0 );
-------------------------------------------

I've try to add FullName() after symbol + but (no error on debug) the result is wrong (equal fullname for all stock).

Thanks for help.
Read the CategoryGetSymbols() help guide properly again.
 

Similar threads