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

RE: [amibroker] Re: How to BUY a FOREIGN?



PureBytes Links

Trading Reference Links

Okay. Good Luck.

--
Terry

-----Original Message-----
From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On
Behalf Of herrfrechdax
Sent: Monday, July 10, 2006 03:43
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Re: How to BUY a FOREIGN?

Terry,

you are right when you are just talking about the loop. But of course 
some operations are done within the loop. I am not supposed to send 
you the code as I signed a note with my businesspartner not to share 
his strategies with anyone, I just tell you there are 2 timeframset()
and some commands to read close prices, in daily+1min timeframe. 

There are 30 symbols in the watchlist, theat means the loop to read 
30 symbols (the same than in the first place) is processed 30 times, 
as a result tis operations will be done 900 times. And from the point 
of view of a serious program-design it makes no sense at all, as I 
learned as a junior-programmer 20 years ago at the first day in 
trainee-course. 


The "hard-coded" stuff look looks like that:
IF (NAME()=="abc"") ...action.;
IF (NAME()=="def"") ...action.;
IF (NAME()=="ghi"") ...action.;
..
..
30 "IF´s

The result is, as you understand easily, "...action..." will be done 
only 30 times.

Believe my or not, there are no nested loops, its a very simple 
program so far, one that would take me 2 hours to code and test using 
a 4th generation programming-language, combined with a relational 
database.
I dont know, if it is the switch of timeframe-sets, the READ of close-
prices in daily and 1min timeframe, whatever, but at my desktop-puter 
AB will disappear, appear again with a blank window, automatic-
analysis-window blanks, will be shown again just to blank again and 
just when I think there is nothing more to do than shut down, the 
results are there. Takes about 5 minutes every time. 

Whith modified "hard-coded" symbols its finished within 1 minute with 
no problem at all. 

Thanks Terry for your input which was very welcome

cheers
enzo



 --- In amibroker@xxxxxxxxxxxxxxx, "Terry" <MagicTH@xxx> wrote:
>
> The loop to read a watchlist is processed for each symbol, but takes
> microseconds (or less) to read. Your "hard-code" for every symbol is
> initialized every pass too so I doubt this is really a time saver 
and is
> certainly not the reason you are experiencing "freezes". An 
exception
> would be if you have built nested loops.
> 
> To really tell, I would need your code.
> --
> Terry
> 
> -----Original Message-----
> From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] 
On
> Behalf Of herrfrechdax
> Sent: Saturday, July 08, 2006 10:59
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] Re: How to BUY a FOREIGN?
> 
> Terry,
> thanks a lot for your suggestions, which I all tried or checked. I 
> think I am exprienced in backtesting, its settings, filters and 
> stuff. Sometimes it happens I overlook small but important details. 
> >:-)
> 
> I think the concept of reading all symbols of a market or a 
watchlist 
> as mentioned in the first place and taken from the help-section 
> (chapter CATEEGORYGERSYMBOLS) is not useful in combination with a 
> filter.
> 
> Correct me when I am wrong, but that loop will be processed for 
every 
> symbol in the filter, while it would be necessary only one time. 
Its 
> using that much processing time and cpu-resources its close to 
> freeze. And there is also no satisfying result. So I hard-coded for 
> every symbol:
> 
> IF (NAME()=="xyz"" ...action...;
> 
> As the watchlist consists of the current stock that is in DJ-INDU 
its 
> almost static. This way its much faster and delivers the results 
that 
> I expected. Took me a long time to find out. 
> 
> enzo
> 
>  --- In amibroker@xxxxxxxxxxxxxxx, "Terry" <MagicTH@> wrote:
> >
> > Tradeprice = True means to replace the BuyPrice, SellPrice, etc. 
> with
> > those of the Foreign symbol.
> > 
> > You still must have the symbol selected or available in a filter
> > Watchlist or use "all symbols" in order to get it to trade.
> > 
> > Did you try my second suggestion? That clearly works for me 
> (provided
> > it's available in the list of stocks you are testing...what I 
just 
> about
> > using "filter" or "all symbols")
> > 
> > --
> > Terry
> > -----Original Message-----
> > From: amibroker@xxxxxxxxxxxxxxx 
[mailto:amibroker@xxxxxxxxxxxxxxx] 
> On
> > Behalf Of herrfrechdax
> > Sent: Friday, July 07, 2006 02:05
> > To: amibroker@xxxxxxxxxxxxxxx
> > Subject: [amibroker] Re: How to BUY a FOREIGN?
> > 
> > Hi Terry,
> > 
> > no it is not working that way either. Those parameters have a 
> > different meaning (fixup, tradeprice).
> > 
> > enzo
> > 
> > 
> > 
> > --- In amibroker@xxxxxxxxxxxxxxx, "Terry" <MagicTH@> wrote:
> > >
> > > Just modify the last line:
> > > SetForeign(item,True,True);
> > > 
> > > 2nd argument True or False at your discretion.
> > > 3rd argument True changes tradeprices too.
> > > 
> > > If by chance that does not work then do this:
> > > 
> > > Buy = True AND Name() == item;
> > > 
> > > 
> > > In both cases, make sure you have "filter" checked are 
filtering 
> on 
> > the
> > > same Watchlist otherwise it can't find the stock. 
> > > --
> > > Terry
> > > 
> > > -----Original Message-----
> > > From: amibroker@xxxxxxxxxxxxxxx 
> [mailto:amibroker@xxxxxxxxxxxxxxx] 
> > On
> > > Behalf Of herrfrechdax
> > > Sent: Tuesday, July 04, 2006 10:21
> > > To: amibroker@xxxxxxxxxxxxxxx
> > > Subject: [amibroker] How to BUY a FOREIGN?
> > > 
> > > i am getting nuts... i am unable to backtest a strategy that 
buys 
> > > certain symbols of watchlist. 
> > > 
> > > following simple example of a loop through the symbols of a 
> > > watchlist I found in AL library. Will someone please fill in 
the 
> > > code to buy the ticker. It is so appreciatetd! Thanks in 
advance. 
> > > enzo
> > > 
> > > listNum=0 ;//enter watchlist number
> > > list = GetCategorySymbols( categoryWatchlist, listnum );
> > > for( j = 0; ( item = StrExtract( list, j ) ) != ""; j++ )
> > > {
> > > SetForeign(item);
> > > 
> > > 
> > > //BUY=1; // will only buy first symbol of the watchlist
> > > 
> > > 
> > > RestorePriceArrays();// to get out the influence of SetForeign
> > > }
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 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 other support material please check also:
> > > http://www.amibroker.com/support.html
> > > 
> > >  
> > > Yahoo! Groups Links
> > >
> > 
> > 
> > 
> > 
> > 
> > 
> > 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 other support material please check also:
> > http://www.amibroker.com/support.html
> > 
> >  
> > Yahoo! Groups Links
> >
> 
> 
> 
> 
> 
> 
> 
> 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 other support material please check also:
> http://www.amibroker.com/support.html
> 
>  
> Yahoo! Groups Links
>







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 other support material please check also:
http://www.amibroker.com/support.html

 
Yahoo! Groups Links