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

[amibroker] Re: Seasonal Charts



PureBytes Links

Trading Reference Links

Randall, due to the facts that (1) calendar years have different 
quantity of days (but average about 252), (2) that the same calendar 
days are not the same markets days in each year, and (3) that 
specific calendar days are not always market days, you are going to 
have to live with some "jitter" in your year-by-year comparisons.  
You will have to decide what type of jitter is acceptable to you 
based on what you are trying to accomplish.

If you are trying to get a representation of where we are in the 
annual cycle, then "resetting" your count at the start of each year 
would probably work (ie when DayOfYear == 1).

If you want finer granularity (resetting each quarter or each month), 
then you need to add additional conditions.  Whatever granularity you 
decide on, you need to be aware the the last few data points will be 
based on fewer samples than the bulk of your data (there are only a 
few years with 254 market days and so the 254th entry in your array 
will be based on fewer samples).

If you are trying to look at month-end seasonality then you may want 
to build your arrays based on # days preceeding month and and # days 
after month end.

However, if you are trying to look at behavior before and after 
certain holidays, then the task becomes much more difficult.

For very general application, I think your approach will work fine if 
you make the following changes.  You need to fix your variable name 
(DaysPerYear versus DayPerYear) and you probably want to use a ROC 
from Day 1 each year instead of C so that you can better visualize 
the results.

I would be interested in seeing whatever you come up with.


--- In amibroker@xxxxxxxxxxxxxxx, "rwrayr" <rwrayr@xxx> wrote:
>
> I am wanting to code a seasonal chart where I can over lay three 
over 
> four months on one chart from sequential years.  Say September 1st 
of 
> the last 3 years all starting at the same location on one chart.  
(I am 
> looking at plotting bar ranges from one array.)  Any suggestions or 
> examples would be appreciated...
> 
> I have used the following and it seems close...
> 
> DaysPerYear = 252;
> 
> CurrentYear = C;
> LastYear = Ref(C,-dayperyear);
> 2YearsBack = Ref(C,-dayperyear*2);
> 3YearsBack = Ref(C,-dayperyear*3);
> 
> My problem is I want to trim the beginning day of the chart to 
start on 
> the same day of the year. Been looking and I just have not found a 
> simple solution so I ask for help.
> 
> Randall
>




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/