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

Re: [amibroker] Backtest and portfolio



PureBytes Links

Trading Reference Links

Hello,

Of course one can implement it in regular mode too:

numstocks = 5;
SetOption("MaxOpenPositions", numstocks );

PositionSize = -100/ numstocks;

YearlyReturn = ROC( C, 252 );

BeginningOfTheYear = Year() != Ref( Year(), -1 );

PositionScore = 1 / YearlyReturn; // lower return -> higher score

Buy = BeginningOfTheYear;
Sell = Ref( BeginningOfTheYear, 1 ); // sell day before switch 

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message ----- 
From: "Tomasz Janeczko" <tj@xxxxxxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Friday, February 18, 2005 4:14 PM
Subject: Re: [amibroker] Backtest and portfolio


> Hello,
> 
> Here is the formula that implements your idea:
> 
> 
> 
> 
> numstocks = 5;
> EnableRotationalTrading();
> SetOption("MaxOpenPositions", numstocks );
> SetOption("WorstRankHeld", numstocks );
> 
> PositionSize = -100/ numstocks;
> 
> YearlyReturn = ROC( C, 252 );
> 
> score = 1 / YearlyReturn; // lower return -> higher score
> 
> BeginningOfTheYear = Year() != Ref( Year(), -1 );
> 
> PositionScore = IIF( BeginningOfTheYear, score , 
>                              scoreNoRotate );
> 
> Best regards,
> Tomasz Janeczko
> amibroker.com
> ----- Original Message ----- 
> From: "supistarde" <supistarde@xxxxxxxx>
> To: <amibroker@xxxxxxxxxxxxxxx>
> Sent: Friday, February 18, 2005 12:49 PM
> Subject: [amibroker] Backtest and portfolio
> 
> 
>> 
>> 
>> 
>> Hi Amibroker community,
>> 
>> I am new in backtesting. I have the following portfolio-problem:
>> I want to filter the 5 lowest yearly-returns from the Dow Jones
>> Industrial on the beginning of a year. Afterwards the system holds the
>> five stocks for 12 months. 
>> Sounds simple, but how do I do it?
>> 
>> Greetings from Germany
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> Check AmiBroker web page at:
>> http://www.amibroker.com/
>> 
>> Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
>> Yahoo! Groups Links
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>>


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Has someone you know been affected by illness or disease?
Network for Good is THE place to support health awareness efforts!
http://us.click.yahoo.com/Rcy2bD/UOnJAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

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/