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

Calculating the historical performance of each month



PureBytes Links

Trading Reference Links


This simple code 
uses the optimizer to determine the historical returns of each 
month.
It is so easy to 
write this in AFL!
And the results are 
interesting too.
<SPAN 
class=250220004-06102002> 
<SPAN 
class=250220004-06102002>-Steve
<SPAN 
class=250220004-06102002> 
<SPAN 
class=250220004-06102002>========================================
/*Usethe 
optimizer to find the historical performance of each 
month.*/
 
calendarMonth = 
Optimize("Month", 1, 1, 12, 1);
 
Buy = (Month() 
== calendarMonth) AND (Day() < Ref(Day(), -1));Sell = Ref(Month(),1) != 
calendarMonth;