Hi Larry:
In real like trading, I wanted to explore over the weekend and trade on Monday.
So for back testing, I used to do:
PositionScore = IIf(DayOfWeek() < Ref(DayOfWeek(),-1),Score, scoreNoRotate);
Which traded on Tuesday due to the line
SetTradeDelays( 1, 1, 1, 1 );
That said, you have a good point. I just got too lazy and used "==5"
I think in this case it is OK to look ahead. Better way would be:
PositionScore = IIf(Ref(DayOfWeek(),1) < Ref(DayOfWeek(), Score, scoreNoRotate);
Vandan
---In amibroker@yahoogroups.com, <portfoliobuilder99@...> wrote :
Thanks for the code Vandan. My version has some similarities and some differences. I have a rebalancing CBT and a different interpretation of a few rules.
For example you have rotation only if the DayOfWeek()==5. But what if Friday is a market holiday? Are you deliberately skipping that week? I do not suggest there is anything wrong with skipping a week, but make sure you are aware that is what your code will do.
Larry
Posted by: vandan_tanna@yahoo.com
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (17) |
This group is for the discussion between users only.
This is *NOT* technical support channel.
TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com
TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
EmoticonEmoticon