Where is the strategy execution exit point when a strategy applied to a multiple symbol dataset ?
Author: Jinye
Creation Date: 8/12/2011 3:47 PM
profile picture

Jinye

#1
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
profile picture

Eugene

#2
profile picture

Jinye

#3
Thanks, Eugene. It does exactly what I need.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).