|  | Dave W. 2015-02-05 14:25:20
 
 
 
 |  | 
	 Hi. I'm trying to add some output statements in a money management script to help me troubleshoot a trading system. One of the statements is in the OnEndPeriod event and I want it to tell me if the period is the last day of the month. I'm using the following code, but I'm doing something wrong - the result should be either a 0 or a 1, but it isn't. Can you point me in the right direction / show me how to do it? Also, in the formula below I used "SPY" in one of the statements -- I'd prefer not to hard-code a symbol name.
 OnEndPeriod Event Code
 
 MMParser parser = Data.ParseFormula("a = (ref(Month(),-1) != Month());");
 Divers.Output("Last Day of Month?: " + parser.GetTimeSeries("SPY","a") );
 
 
 
 
 |  |