I wrote the following code that seems like it should work:
if (ToTime(Time[0]) == ToTime(15, 30, 0)
&& ToDay(Time[0]) == 20070601)
{
FileInfo fi = new FileInfo("c:/stats.txt");
StreamWriter sw = fi.CreateText();
sw.WriteLine("Trading Statistics for " + ToDay(Time[0]));
sw.WriteLine("Swap: " + GetAtmStrategyRealizedProfitLoss("Swap").ToString());
sw.WriteLine("CTL: " + GetAtmStrategyRealizedProfitLoss("CTL").ToString());
sw.WriteLine("CTS: " + GetAtmStrategyRealizedProfitLoss("CTS").ToString());
sw.WriteLine("S36L: " + GetAtmStrategyRealizedProfitLoss("S36L").ToString());
sw.WriteLine("S36S: " + GetAtmStrategyRealizedProfitLoss("S36S").ToString());
sw.WriteLine("Total Realized PnL:" + Performance.AllTrades.Performance.Currency.CumProf it);
sw.Close();
}
However, the output I'm getting is:
Trading Statistics for 20070601
Swap: 0
CTL: 0
CTS: 0
S36L: 0
S36S: 0
Total Realized PnL:-1000
Where there should be some profit on the individual strategies, and the PnL should be positive. Any ideas?
Comment