I run into a problem that I hope someone may be able to help. When the strategy applied to a dataset, it generates multiple alerts. My strategy writes these alerts into a csv file on the harddisk with C#'s StreamWriter. I have a function called AlertsToFile, similar to one in the QuickRef. This function is called in the "Execute" function. Since Execute runs through each sysmbol in the dataset, the alert for each symbol gets written into the file. I need to close the file handle when all the symbols are done, so that when the next scheduled run starts, it create a new file instead of appending to the last run's alerts. Basically, I need a place that I can call StreamWriter.Close() and StreamWriter.Dispose() at the very end of strategy run for the whole dataset, not at the end of run for each sysmbol. Is this possible ? The last statement in the strategy is the exit point for a single symbol, but where is the strategy execution exit point for multiple symbol dataset ?
Thanks,
Jinye
Size:
Color:
Size:
Color:
Thanks, Eugene. It does exactly what I need.
Size:
Color: