Posted 4/15/2012 10:14:22 PM
|
|
|
|
| Does Bars.TotalCount work? When I use it it always comes back with the current amount of bars in the system. If I do: OutputMessage(Bars.TotalCount & " " & Bars.Count) it always has the same values. I need to know the amount of bars in a series so I can exit stocks that have been delisted and aviod opening trades days before a stock gets delisted(normaly after a takeover) Currently a trade will stay in the system for ever as no exit gets triggered after a takeover.
|
|
Posted 4/16/2012 2:09:32 AM
|
|
|
|
Unless you have set a MaxLookBack value, TotalCount will be the same as Count. TotalCount isn't the total number of bars that will be processed for the simulation, it is the total number that have been processed so far for this symbol. Count is the number of bars available in the series, and as such will never go over the MaxLookBack value.
For handling delisted stocks, I'd recommend creating a data file with the dates all the stocks are delisted. You can create one system to write this data file (in the Shutdown method you can look at the last bar date for each symbol), and then read the file from your other systems.
Thanks,
Daniel
|
|
|
|