Hi, I'm a beginner in using amibroker.
I would like to use rotaitonal trading. My problem is that I would like to buy the 5 best stocks every third month. But I do not know how to do that. Is there anybody who could help me with this.
Hi XXX star....
You need to start by quantifying WHAT IS A BEST STOCK. For example, is a best stock based on a fundamental filter? Or is it based on a momentum filter? Also, i'm not sure that the 5 best stocks is an adequate diversification of the capital....perhaps the 10 or 20 best stocks....
Thats my![]()
Well, I said that I would like to buy the 5 best stocks according to the best performance every third month.
my code:
newMonth = Month() != Ref(Month(), -1);
Nmonths = 3;
rotate = newMonth AND Cum(newmonth) % Nmonths == 0
Does it work like that?
http://www.amibroker.com/kb/2016/04/17/long-only-rotational-back-test/
Set the AA window to backtest on monthly periodicity,
then something like this will be getting close.
SetBacktestMode( backtestRotational );
SetOption("MaxOpenPositions",5);
SetOption("WorstRankHeld",5);
SetPositionSize( 20, spsPercentOfEquity );
PositionScore = ROC( Close, 3); // highest 3 month ROC
You'll want to run this on say ASX50, not across the whole market. afaik, you can't specify turnover as a condition in rotational trading.
thank you very much for your answer.
What does SetPosistionSize(20,spsPercentOfEquity) do?
positionsize is set to 20% of available equity.
see: https://www.amibroker.com/guide/afl/setpositionsize.html
Not sure about the rest of it. I've never had much luck with rotational trading, but there are some quite advanced threads on 'AB Yahoo Groups forum'.
11pm Saturday night and I'm answering a forum question ... :bonk:
Hello and welcome to Aussie Stock Forums!
To gain full access you must register. Registration is free and takes only a few seconds to complete.
Already a member? Log in here.