PureBytes Links
Trading Reference Links
|
AddToComposite would IMO not be of an help here.
You can do it by using 2 runs:
the first would find the top movers and put them either to an internal
table (by using an external tool) or to a watchlist (after clearing the WL),
and the second script would then operate on those selected.
But: putting them to a WL on a per bar basis is obviously slooow.
A faster way is to use array operations.
The bar-by-bar solution you can try to do with some free tools.
OTOH if you are interessted in a fast and ready-to-use commercial solution
using an external tool (ranking using array etc.) then drop me an email.
----- Original Message -----
From: "giggollo99" <giggollo@xxxxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Friday, September 23, 2005 5:51 AM
Subject: [amibroker] Re: buying the biggest movers every day
> Thanks guys,
>
> Uenal: I am trying to run a backtest on a 5-year period, so i cannot
> create a watchlist and apply my system to it for everyday, i need AB
> to do this automatically
>
> Ara: I think Using SetOption("MaxOpenPositions") with Positionscore
> would not do the job because although it would ensure that i dont
> enter more than 30 positions in one day, those 30 positions would
> not necessarily be from the group of stocks which were the 30
> biggest % movers yesterday.
>
> i wonder if addtocomposite can somehow be used to do the job
>
> Any suggestions are much appreciated
>
> g
>
> --- In amibroker@xxxxxxxxxxxxxxx, "Ara Kaloustian" <ara1@xxxx> wrote:
> > you might try limiting number the number of positions to 30.
> >
> > See SetOption("MaxOpenPositions") - search in help files for more
> info
> >
> >
> > ----- Original Message -----
> > From: "giggollo99" <giggollo@xxxx>
> > To: <amibroker@xxxxxxxxxxxxxxx>
> > Sent: Tuesday, September 20, 2005 10:43 PM
> > Subject: [amibroker] Re: buying the biggest movers every day
> >
> >
> > > Thanks to all who replied. However, positionscore doesnt quite
> do the
> > > job. Heres why:
> > >
> > > Everyday, I would like to only trade from the 30 stocks that
> were the
> > > biggest movers yesterday. Thats my "watchlist" for today, and
> then i
> > > apply a certain signal to those 30 stocks today, for example,
> buy if
> > > today's change is 10% or more.
> > >
> > > Now, positionscore doesnt help us code this. Consider using
> > > positionscore as follows:
> > >
> > > pctchg=((c-ref(c,-1))/ref(c,-1))*100; // %chg
> > > positionscore=ref(pctchg,-1); // favor biggest movers
> > > buy=pctchg>10; // buy if up 10% today
> > >
> > > Now, if 100 stocks went up more than 10% today, this code would
> buy
> > > them all, while what i really want is to buy only from
> yesterday's 30
> > > biggest movers.
> > >
> > > Any help on this is much appreciated.
> > >
> > > g
> > >
> > >
> > >
> > > --- In amibroker@xxxxxxxxxxxxxxx, b <b519b@xxxx> wrote:
> > > > Since you are asking a very basic question, I have put a
> > > > lot of "hand holding" into the code below. My apologies if
> > > > too much was put in.
> > > >
> > > > // The extra steps are for clarity of understanding
> > > > // volume filter added to avoid illiquid stocks.
> > > > // Timing filter also added but set to "1" since you
> > > > // did not say what timer you want to use.
> > > > // Tradedelay = 1 lets one use Ref(close,-1) and close
> > > >
> > > > SetTradeDelays(1,1,1,1); //
> > > >
> > > > CloseYesterday = ref(close,-1);
> > > > CloseToday = close;
> > > > Gain = (CloseToday - CloseYesterday) / CloseYesterday ;
> > > > Positionscore = Gain;
> > > >
> > > > Portfoliosize = 20
> > > > Positionsize = -100/Portfoliosize ;
> > > >
> > > > BuyFilters = MA(volume,10) > 100000 ;
> > > > TimerFilter = 1 ;// "1" is always true
> > > > Buy = BuyFilters AND TimerFilter;
> > > > Sell = ...your sell code ...;
> > > >
> > > > // The above will buy the 20 stocks with the largest
> > > > // gains
> > > >
> > > > --- giggollo99 <giggollo@xxxx> wrote:
> > > >
> > > > > Hi all,
> > > > >
> > > > > I would like to write code to do the following,
> > > > >
> > > > > "buy the top 10 stocks that made the biggest % gains
> > > > > yesterday"
> > > > >
> > > > > Whats the easiest way to do this in Amibroker?? I'm
> > > > > hoping there's a
> > > > > simple way to do this...
> > > > >
> > > > > Thanks in advance
> > > > > g
> > > > >
------------------------ Yahoo! Groups Sponsor --------------------~-->
Try Online Currency Trading with GFT. Free 50K Demo. Trade
24 Hours. Commission-Free.
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/GHeqlB/TM
--------------------------------------------------------------------~->
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
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> 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/
|