PureBytes Links
Trading Reference Links
|
DM,
I don't think it matters if you stipulate Fri or not.
Fri Close is the *default* close for weekly bars.
In 2006 only one week did not close on a Fri (public holiday?) in the
US market (4/13/2006 was a Thursday weekly close).
I think that if you accepted the weekly close for all weeks your
backtests would not be adversely affected.
The only week that is compromised is the current week, so for
backtesting if you set the range to avoid the current week you should
be OK.
If you are in weekly bars that would leave you with:
sell = C < HHC(C,52) * 0.96;
If you are using daily bars:
WC = TimeFrameCompress(Close,inWeekly);
sell = WC < HHV(WC,52) * 0.96;
WC code courtesy of Ami AFL reference.
BrianB2
--- In amibroker@xxxxxxxxxxxxxxx, Dave McLeod <dmcleod1981@xxx> wrote:
>
> I am trying to code the Zweig 4% reversal system but I am not
catching on as to how to limit the buys and sells from each week.
>
> Your supposed to buy if the Close drops 4% below the HHV of the
last 52 weeks and buy if the Close is greater than the LLV of the
last 52 weeks based on Fridays close.
>
> Here is what I have so far.
>
> DOW=DayOfWeek()==5;
> Hi=HHV(Close,52);
> Lo=LLV(Close,52);
> VBuy = Close*1.04>=Ref(Lo,-1) AND DOW;
> VSell = Close*.96<=Ref(Hi,-1) AND DOW;
> Buy = ExRem(VBuy,VSell);
> Sell = ExRem(VSell,VBuy);
>
> This buys and then sells each week. I am obviously not using
exrem correctly and it still buys weekly wether I have DOW in or out.
>
> If someone could point out my mistakes that would be great.
>
> Thanks
> DM
>
>
> ---------------------------------
> We won't tell. Get more on shows you hate to love
> (and love to hate): Yahoo! TV's Guilty Pleasures list.
>
------------------------ Yahoo! Groups Sponsor --------------------~-->
Check out the new improvements in Yahoo! Groups email.
http://us.click.yahoo.com/4It09A/fOaOAA/yQLSAA/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 NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
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/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/amibroker/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:amibroker-digest@xxxxxxxxxxxxxxx
mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx
<*> 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/
|