I am trying to use StreamWriter to debug a stock trading application, and my code creates the file but doesnt write anything to it. I know the method is being executed because other stuff is happening but the file remains empty.
I think I am missing something when I create the StreamWriter:
public class SterlingDebug : ResponseTemplate
{
StreamWriter writer = new StreamWriter(@"C:\Documents and Settings\ecoarsey\SterlingIssue10222010.txt");
int i = 0;
public override void GotTick(Tick tick)
{
//StreamWriter writer = new StreamWriter(fs);
//print 10 ticks
i++;
if (i < 11)
{
D(tick.ToString());
writer.WriteLine("Tick #: {0}",i);
}
}
}