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

Re: [amibroker] buying the biggest movers every day



PureBytes Links

Trading Reference Links

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@xxxxxxxxxxx> 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
> 
> 
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Put more honey in your pocket. (money matters made easy).
http://us.click.yahoo.com/r7D80C/dlQLAA/cosFAA/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/