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

Re: [amibroker] Re: Question about LinearReg



PureBytes Links

Trading Reference Links

you can use
CategoryRemoveSymbol
CategoryAddSymbol
to save the results of scan/explore
see help screens for details on their use


On 7/13/05, Tony Lei <yiupang91@xxxxxxxxx> wrote:
> Hi all,
> 
> This is what i have so far.  When I have these two filters together, AB
> takes a long time to scan through entire database.  So i had to separate
> them into two different scans.  I first filter the stocks based on my
> criteria and then apply my own linreg scan.  Is there a more efficient way
> to do this in one simple code? Like filtering and then copy results into
> watchlist (list 0) and overwriting every time I run it. 
> 
> thank you for your time
> 
> tony
> qitrader
> 
> //*Filtering
> Filter = Close > 10 AND V >= 500000 AND EMA (V, 30) >= 300000 AND ATR (15)
> >= 1.2;
> ATR15 = ATR (15);
> EMA30 = EMA (V, 30);AddColumn (C, "Close");
> AddColumn (V, "Volume");
> AddColumn (ATR15, "Average True Range");
> AddColumn (EMA30, "30 Day Average Volume");
> //*
> //*LinReg Scan
> 
> LinRegVal = LinearReg ( Close, 3 ) ;
> LinRegChanVal=LinearReg (Close, 23);
> LinRegChanSlope = LinRegSlope (Close, 23);
> 
> SDev=StDev (Close,23);
> LowerLinRegChanVal=LinRegChanVal-.85*SDev;
> UpperLinRegChanVal=LinRegChanVal+.85*SDev;
> 
> Cond1 = LinearReg(Close,3) > Ref(LinearReg(Close,3),-1) AND
> LinRegSlope(Close,23) >= 0 AND Close < LowerLinRegChanVal;
> 
> Cond2 = LinearReg(Close,3) < Ref(LinearReg(Close,3),-1) AND
> LinRegSlope(Close,23) <= 0 AND Close > UpperLinRegChanVal;
> 
> Filter = Cond1 OR Cond2;
> 
> Buy = Cond1;
> Short = Cond2;
> 
> ATR15 = ATR (15);
> EMA30 = EMA (V, 30);
> AddColumn (C, "Close");
> AddColumn( Buy, "Buy", 1, colorDefault, IIf( Cond1 == 1, colorGreen, Null )
> );
> AddColumn( Short, "Short", 1, colorDefault, IIf( Cond2 == 1, colorRed, Null
> ) );
> AddColumn (V, "Volume");
> AddColumn (ATR15, "Average True Range");
> AddColumn (EMA30, "30 Day Average Volume");
> //*
> 
> 
> 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 
> 
>  Visit your group "amibroker" on the web.
>   
>  To unsubscribe from this group, send an email to:
>  amibroker-unsubscribe@xxxxxxxxxxxxxxx
>   
>  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 
>  To unsubscribe from this group, send an email to:
>  amibroker-unsubscribe@xxxxxxxxxxxxxxx
>   
>  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 
>  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 
> ________________________________
> 


-- 
Cheers
Graham
http://e-wire.net.au/~eb_kavan/


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Try Online Currency Trading with GFT. Free 50K Demo. Trade 
24 Hours. Commission-Free. 
http://us.click.yahoo.com/DldnlA/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/