[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: Any AFL gurus?



PureBytes Links

Trading Reference Links

Using name() you might be able to store parameters within the AFL.
You might have to use loops but the logic might follow:
If name()==INTC then 'n'=20
If name()==IBM then 'n'=15

MA(C,n)

Interesting problem.
-rlb

--- In amibroker@xxxxxxxxxxxxxxx, "Dave Merrill" <dmerrill@xxxx> 
wrote:
> I've wondered about the following:
> 
> suppose you store them in an artificial ticker corresponding to 
each stock
> you cared about, say SymbolName~Params? each artifical ticker has O-
H-L-C-OI
> fields, which could cover that many parameters. if you needed more 
than
> that, you could use additional tickers (~Params_1 etc). they'd be 
stored in
> the local db, so AB would manage reading them off disk at the 
appropriate
> times, without you coding anything.
> 
> you'd have to read the right one, using one of the Foreign 
mechanisms, and
> read the right field(s) in spite of their names. if these params 
are static
> for the history of each stock, you'd also have to use LastValue or 
something
> like that to extend it across all dates.
> 
> alternatively, if they're dynamic, you'd need a way to calculate 
the full
> history of them (easy), and place the results in a ticker, which I 
don't
> know how to do.
> 
> haven't tried any of this, just thinking out loud... make any sense?
> 
> dave
>   This is what I'm trying to do:
> 
>   -My system requires a different parameter for each stock ie.
>   different moving averages, different periods used for calculation
>   etc.  Currently I have to use the Param function and interactively
>   change parameters for each symbol.  When I go back to the same
>   symbol; I would like to use the previous parameters that I have 
set
>   to produce the same result I had before.  The only way that I 
know of
>   right now is to write/store these parameters into an external 
file in
>   the harddrive and read them back when I go back to the same 
symbol.
> 
>   -I am currently running into problem of AB variable definition and
>   initialization.  I want to have a static kind of variable which 
store
>   the symbol and use this to conditionally read in the external file
>   only a new symbol is read in.  I do not have a solution.  There 
might
>   be other alternative which I would like to hear.
> 
>   -I have successfully implemented read/write to an external file 
using
>   combination of JScript and AFL.  Next is how to conditionally 
steer
>   the readin or not when the new symbol is entered.
> 
>   --- In amibroker@xxxxxxxxxxxxxxx, "Dave Merrill" <dmerrill@xxxx>
>   wrote:
>   > hi, sorry to butt in offering being any help, but I'm 
interested in
>   how
>   > you're creating and reading these external parameter files. 
could
>   you
>   > provide some details?
>   >
>   > also, when you say you only need to read them when a new symbol 
is
>   added,
>   > that must mean you're putting the data you read somewhere within
>   AB's
>   > universe, like in a composite maybe, or somewhere else, yes?
>   >
>   > I've wondered about using the Open Interest field for a custom
>   parameter I
>   > calculate for each stock. is it possible for AFL code to write 
data
>   into an
>   > existing quote on an existing stock? has anyone done anything 
like
>   this? I'd
>   > love to see some examples.
>   >
>   > thanks,
>   >
>   > dave
>   >   Has anyone tried to write AFL code which will only executed 
once
>   each
>   >   time it detects a new symbol just entered?  For example:
>   >
>   >   I have external parameter files for each symbol.  I only need 
to
>   read
>   >   in these parameters once using JScript for each new symbol
>   entered.
>   >
>   >   TIA
> 
> 
>         Yahoo! Groups Sponsor
>               ADVERTISEMENT
> 
> 
> 
> 
>   Send BUG REPORTS to bugs@xxxx
>   Send SUGGESTIONS to suggest@xxxx
>   -----------------------------------------
>   Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
>   (Web page: http://groups.yahoo.com/group/amiquote/messages/)
>   --------------------------------------------
>   Check group FAQ at:
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> 
>   Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
Service.


------------------------ Yahoo! Groups Sponsor ---------------------~-->
ReplayTV: CNet Ranked #1 over Tivo!
Instant Replay & Pause live TV.
Special Sale: 50% off!
http://us.click.yahoo.com/UUMW7B/.5qGAA/ySSFAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/