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

Re: [amibroker] Re: TJ: plotting the same indicator in different charting windows



PureBytes Links

Trading Reference Links

 Hi jayson

 I havent used that  function yet.
 My data vendor does not supply sector values in the data.

 Looking at it, i would probably need to use the function many times 
in a backtest for the buy and sell conditions.

  I have 24 sectors, and my buy/sell conditions are very simple e.g. 

SECTORNUM=	Foreign("~SECTNUM","C");
Buy=IIf(OI==SECTORNUM AND OTHER CONDITIONS AND V>1,1,0) ;
Sell=OI!=SECTERNUM OR OTHER CONDITIONS AND V>1; ;

  The  ~SECTNUM  in this formula, is a conditional composite of of 
all my 24 sector composites,  the values in this composite will range 
from 1 to 24, depending which is the best performing sector....  

 

To do the same using the InWatchList() function ,and having 
24 sectors, where all the stocks corresponding to that sector are in 
there own watchlist,
wouldn't i need to repeat this 24 times (in the buy condition 
formula)  e.g.

SECTORNUM=foreign("~SECTNUM","C");
Buy= iif( InWatchList( 1 ) and SECTORNUM==1 and other buy cond's,1,iif
( InWatchList( 2 ) and SECTORNUM==2 and other buy cond's,1,iif( 
InWatchList( 3 ) and SECTORNUM==3and other buy cond's ,1, and repeat 
this 24 times 


 Cheers.





-- In amibroker@xxxxxxxxxxxxxxx, "Jayson" <jcasavant@xxxx> wrote:
> Nirv,
> If you move the individual stocks into the appropriate watch lists 
(cap
> goods stocks into a capgoods watch list etc) then you could easily 
use
> inwatchlist() . Depending on the data vendor you use you may also 
have a
> look at sectorid() as the sector information may already be stored 
in the
> stock. I know this is the case quotes plus and tc2000, not sure 
about the
> free vendors.....
> Regards,
> 
> Jayson
> 
>   -----Original Message-----
>   From: nirvana1x [mailto:nirvanaiam@x...]
>   Sent: Wednesday, May 19, 2004 8:24 AM
>   To: amibroker@xxxxxxxxxxxxxxx
>   Subject: [amibroker] Sector rotation query, can Ami ?
> 
> 
>   Hi members.
> 
>      I am trying to create a sector rotation system, so when you 
run a
>   backtest,the only stocks it will run the test on will be only the
>   ones which belong to that sector.
> 
>      At the moment i have created an excel macro that modifies all 
my
>   data files and adds a sector number in the OI field. It also fills
>   the holes in the data for more accurate composites, the data where
>   the holes are filled have a volume value of 1, this is so when i 
run
>   a back test i add the formula ( and v>1) so i cannot by when 
there is
>   a hole, or sell when there is a hole.
>      Then, in ami i creat composites of the sectors.
> 
>      Then run a scan of these composites, to create a single 
composite
>   of the best performing sector as compared to the other sectors.
>      The result of this scan is a composite of the sector numbers, 
e.g.
>   if sector 7 is the best performer the composite result is 7.
> 
>      Finally i can do a backtest, and 1 of the conditions is for the
>   stock OI field to be eqaul to the best performing sector value.
> 
>   e.g SECToRNUM=      Foreign("~SECTNUM","C") ;
> 
>     Buy = IIf(OI==SECTERNUM AND V>1,1,0) and whatever other buy
>   condition you want;
> 
>   The above idea, will in single backtest select only the stocks 
from
>   each sector when the sector is the best performer. e.g . if 
sector 2
>   is outperforming the other sectors it will only buy stocks with 
the
>   OI field having a value of 2 e.t.c. .
> 
> 
>       Is there onother way to do this in ami, without me having to 
use
>   excel to modify the data files to place the sector code value in 
the
>   OI field.
> 
>       Thanks.
> 
> 
> 
> 
>   Send BUG REPORTS to bugs@xxxx
>   Send SUGGESTIONS to suggest@xxxx
>   -----------------------------------------
>   Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
>   (Web page: http://groups.yahoo.com/group/amiquote/messages/)
>   --------------------------------------------
>   Check group FAQ at:
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> 
> 
>         Yahoo! Groups Sponsor
>               ADVERTISEMENT
> 
> 
> 
> 
> 
> --------------------------------------------------------------------
--------
> --
>   Yahoo! Groups Links
> 
>     a.. To visit your group on the web, go to:
>     http://groups.yahoo.com/group/amibroker/
> 
>     b.. To unsubscribe from this group, send an email to:
>     amibroker-unsubscribe@xxxxxxxxxxxxxxx
> 
>     c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
Service.



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.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/