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

Re: [amibroker] Creating new watchlists from AFL



PureBytes Links

Trading Reference Links

The key here is when you change the DB.

I wrote a script to download all S&P watchlists and copy to watchlists 
folder in DB.
Sequence as follows works fine.
1. Load Amibroker.
2. Run script FROM Amibroker to write new watchlists.
3. Exit Amibroker.
4. Load Amibroker.

[ Special Note ]
Im sure* I have changed the DB in the middle of that sequence (between 
step 2-3) and it still updated the watchlists.
(* However I can't be certain because it was a while ago. And I wasn't 
really checking for that as a problem.)
I'd check it now & post the result but I'm halfway out the door to go 
buy my nephew his Birthday present.

ATB
Michael.


dingo wrote:
>
> Yep, Also I've observed that AB will write back the index.txt file 
> when you change the DB or exit (based on autosave settings I think) So 
> you don't want to be working on the watchlists while AB is open and 
> working on that database.
> d
>
>     ------------------------------------------------------------------------
>     *From:* amibroker@xxxxxxxxxxxxxxx
>     [mailto:amibroker@xxxxxxxxxxxxxxx] *On Behalf Of *RR
>     *Sent:* Wednesday, September 12, 2007 10:43 AM
>     *To:* amibroker@xxxxxxxxxxxxxxx
>     *Subject:* RE: [amibroker] Creating new watchlists from AFL
>
>     Thanks Dale and Tomasz for your responses.
>
>     It appears that you must pre-define all watchlists with the UI
>     before loading the database with the default 0..63 being done for
>     you and any others you have previously manually done with the UI
>     (Symbol menu). It appears the physical position inside the
>     index.txt file within the open database determines the ordinal
>     number when using the CategoryFind function. This means,
>     presumably, that one could write code to manipulate the index.txt
>     file to dynamically create and/or delete watchlists by using FSO
>     with extreme care on handling of deletes as you would impact
>     ordinal values of any “open” watchlist. This would avoid the need
>     to use the UI and would be useful for eventual distribution of a
>     script not requiring the customer to manually enter a bunch of
>     pre-defined watchlist names with the usual typo errors. :^))
>
>     ------------------------------------------------------------------------
>
>     *From:* amibroker@xxxxxxxxxxxxxxx
>     [mailto:amibroker@xxxxxxxxxxxxxxx] *On Behalf Of *dingo
>     *Sent:* Wednesday, September 12, 2007 8:34 AM
>     *To:* amibroker@xxxxxxxxxxxxxxx
>     *Subject:* RE: [amibroker] Creating new watchlists from AFL
>
>     Thanks!
>
>     d
>
>         ------------------------------------------------------------------------
>
>         *From:* amibroker@xxxxxxxxxxxxxxx
>         [mailto:amibroker@xxxxxxxxxxxxxxx] *On Behalf Of *Tomasz Janeczko
>         *Sent:* Wednesday, September 12, 2007 9:10 AM
>         *To:* amibroker@xxxxxxxxxxxxxxx
>         *Subject:* Re: [amibroker] Creating new watchlists from AFL
>
>         There was never a function for *creating* watchlists from AFL
>         level, no matter if they are less than 64 or not.
>
>         Watchlist are created/deleted from UI.
>
>         The only "programmatic" control is using the files inside
>         Watchlist subfolder - add an entry in index.txt file.
>
>         Reloading the database is required to re-read the index.txt.
>
>
>         Best regards,
>         Tomasz Janeczko
>         amibroker.com
>
>             ----- Original Message -----
>
>             *From:* dingo <mailto:dingo@xxxxxxxxxxx>
>
>             *To:* amibroker@xxxxxxxxxxxxxxx
>             <mailto:amibroker@xxxxxxxxxxxxxxx>
>
>             *Sent:* Wednesday, September 12, 2007 3:02 PM
>
>             *Subject:* RE: [amibroker] Creating new watchlists from AFL
>
>             Yes but how about his question on how to create a
>             watchlist using AFL for > 64 watchlists?
>
>             d
>
>                 ------------------------------------------------------------------------
>
>                 *From:* amibroker@xxxxxxxxxxxxxxx
>                 <mailto:amibroker@xxxxxxxxxxxxxxx>
>                 [mailto:amibroker@xxxxxxxxxxxxxxx] *On Behalf Of
>                 *Tomasz Janeczko
>                 *Sent:* Wednesday, September 12, 2007 8:40 AM
>                 *To:* amibroker@xxxxxxxxxxxxxxx
>                 <mailto:amibroker@xxxxxxxxxxxxxxx>
>                 *Subject:* Re: [amibroker] Creating new watchlists
>                 from AFL
>
>                 Hello,
>
>                 This statement from the AB guide is obsolete. Will be
>                 removed.
>
>                 There is NO limit on number of watchlists and NO limit
>                 in Category* functions.
>
>
>                 Best regards,
>                 Tomasz Janeczko
>                 amibroker.com
>
>                     ----- Original Message -----
>
>                     *From:* RR <mailto:stocks@xxxxxxxxxxxxx>
>
>                     *To:* amibroker@xxxxxxxxxxxxxxx
>                     <mailto:amibroker@xxxxxxxxxxxxxxx>
>
>                     *Sent:* Wednesday, September 12, 2007 9:36 AM
>
>                     *Subject:* RE: [amibroker] Creating new watchlists
>                     from AFL
>
>                     Dingo,
>
>                     Suppose I want to create a new style watchlist
>                     titled “GuppyCountBackLine”.
>
>                     The CategoryAddSymbol appears to be limited to a
>                     range of 0..63 for watchlists. (page 398 of 5.0
>                     user’s guide).
>
>                     All of the watchlists I want to create fall
>                     outside of the default range of 0..63.
>
>                     The only way I see to create these watchlists is
>                     to manually create these with the Symbol menu from
>                     the main toolbar. How do I create these new style
>                     watchlists with just AFL? How do I delete the new
>                     style watchlists using just AFL?
>
>                     I do have code for the default case of 1..63. For
>                     example:
>
>                     // ClearWatchList
>
>                     *function* ClearWatchlist(wl)
>
>                     {
>
>                     *if* (Status("stocknum") == 0)
>
>                     {
>
>                     // remove all existing symbols from the market list
>
>                     _TRACE("Removing Tickers from watchlist number " +
>
>                     NumToStr(wl, 1.0)+":");
>
>                     List = CategoryGetSymbols(*categoryWatchlist*, wl);
>
>                     *for*( i = 0; ( sym = StrExtract( List, i ) ) !=
>                     ""; i++ )
>
>                     {
>
>                     _TRACE(sym);
>
>                     CategoryRemoveSymbol(sym, *categoryWatchlist*, wl);
>
>                     }
>
>                     _TRACE("Removing Tickers from Watchlist completed.");
>
>                     };
>
>                     }
>
>                     This works great for 1..63 but it still appears
>                     that manually using SYMBOL..WATCHLIST..New
>                     Watchlist must be used to create the new style
>                     watchlist. I do not see how to do the logical
>                     equivalent of SYMBOL..WATCHLIST..New Watchlist
>                     strictly using AFL for the new style watchlist.
>                     For distribution purposes, I would prefer to not
>                     have a client have to manually enter potentially
>                     hundreds of watchlist names using the Symbol menu.
>
>                     If you try using the wl = CategoryFind
>                     (“GuppyCountBackLine”,categoryWatchlist) you get a
>                     -1 return code according to debugview instead of
>                     the next available ordinal index number.
>                     Obviously, the CategoryFind function is used to
>                     retrieve the ordinal number of the watchlist for
>                     parameter entry into the other Category…..
>                     functions in AFL.
>
>                     Thanks in advance :^))
>
>                     ------------------------------------------------------------------------
>
>                     *From:* amibroker@xxxxxxxxxxxxxxx
>                     [mailto:amibroker@xxxxxxxxxxxxxxx] *On Behalf Of
>                     *dingo
>                     *Sent:* Tuesday, September 11, 2007 9:53 PM
>                     *To:* amibroker@xxxxxxxxxxxxxxx
>                     *Subject:* RE: [amibroker] Creating new watchlists
>                     from AFL
>
>                     All of the old methods of creating watchlists
>                     remain - Check CategoryAddSymbol/ ..removesymbol
>                     in the help file and then do a search of this
>                     forum on them. There you'll find examples.
>
>                     d
>
>                         ------------------------------------------------------------------------
>
>                         *From:* amibroker@xxxxxxxxxxxxxxx
>                         [mailto:amibroker@xxxxxxxxxxxxxxx] *On Behalf
>                         Of *RR
>                         *Sent:* Tuesday, September 11, 2007 10:48 PM
>                         *To:* amibroker@xxxxxxxxxxxxxxx
>                         *Subject:* [amibroker] Creating new watchlists
>                         from AFL
>
>                         I do not see a way to create new watchlists
>                         using AFL. Is this do-able? I have heard that
>                         you can code a workaround using FSO (file
>                         system object) and something about maintaining
>                         the index yourself. Unfortunately, I did not
>                         see any code posted. It seems this would be
>                         best done by TJ so the implementation of
>                         watchlists would not be broken in case
>                         additional enhancements were made. Also, the
>                         ability to delete a watchlist is needed from
>                         AFL so that you do not have to predict ahead
>                         of time which watchlists need to be created.
>
> __._,_._



Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

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