I am using Amibroker and I want to do an Exploration for a Special calendar week in history. For example Performance from Gold in US-Dollar in calendar week 13 each year.
I know how to do Exploration with "Day of Week" or "Monthfunction" and I know how to explore tradingday of the year.
But I think calendar week is more complex. Any ideas how to do? Or is this afl still available?
/// Filter exploration output by number of weeks passed since beginning of year
/// @link [https://forum.amibroker.com/t/exploration-performance-calendar-week-each-year/11319/2](https://forum.amibroker.com/t/exploration-performance-calendar-week-each-year/11319/2)
week = 13;// set week since year start
yr = Year();
dow = DayOfWeek();
new_year = yr != Ref(yr,-1);
new_week = dow < Ref(dow, -1);
sum_weeks = SumSince(new_year, new_week);
Filter = sum_weeks == week-1;
AddColumn( Close, "Price", 1.2);
Once again I'd like to thank you fxshrat for sharing your knowledge and coding abilities with us, I was just wondering how to do this exact task and found that you had already done it and shared it. Just wanted to say a big thank you. I for one truly appreciate it.
Tony