PureBytes Links
Trading Reference Links
|
You can do that without the IIF as any condition gives a 0 or 1 answer
(true/false)
Firstday = Year() != Ref(Year(),-1);
--
Cheers
Graham
AB-Write >< Professional AFL Writing Service
Yes, I write AFL code to your requirements
http://e-wire.net.au/~eb_kavan/ab_write.htm
On 1/5/06, Terry <MagicTH@xxxxxxxxxxx> wrote:
> Firstday = IIf(Year() != Ref(Year(),-1),1,0);
> //Will be True on 1st trading day of the year
>
> I just did that since a friend thought it was a high probability day
> from VTOReport.com. They also said last trading day of the year was 90%
> up. It's not. It's 50/50 for the past 21 years on both Nasdaq100 and
> Russell2K and so is the first day of the year.
>
> You really want the last day of the year so you can Buy at the Close
> then and Sell the next day close. Be sure to set trade delays to 0 and
> prices to Close.
>
> Here's all the code. You don't need the Month() part, but it's needed
> for checking last day of the year (with some changes) and it still
> works.
>
> //BEGIN CODE
> "Test first day of the year";
> SetChartOptions(1,chartShowDates);
>
> Lastday = IIf(Month() != Ref(Month(),1) AND Year() !=
> Ref(Year(),1),1,0);
>
> Buy = Lastday;
> Sell = Ref(Lastday,-1);
> Short = Cover = 0;
>
> Plot(C,Name(),colorBlack,styleDots);
>
> Plot(Lastday,"Entry day",colorGreen,styleHistogram|styleOwnScale);
> Plot(Sell,"Exit day",colorRed,styleHistogram|styleOwnScale);
>
> //END CODE
> --
> Terry
>
> -----Original Message-----
> From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On
> Behalf Of dimension@xxxxxxxxxxxxx
> Sent: Wednesday, January 04, 2006 20:45
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] First trading day of the hear
>
> How do I determine the first trading day of the year?
> I'd like to run an exploration to determine the gains on the first
> trading
> day of the past few years?
>
> thanks
>
>
>
>
> 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 other support material please check also:
> http://www.amibroker.com/support.html
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
------------------------ Yahoo! Groups Sponsor --------------------~-->
Try Online Currency Trading with GFT. Free 50K Demo. Trade
24 Hours. Commission-Free.
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/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 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/
<*> 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/
|