I am attempting to figure out how to save my algorithms trading state and recover from failure correctly. I have a rather complex algorithm I'm putting together which has different reasons for buying different stocks. I need to save the reason I bought a stock because it tells me what signals I need to use to determine if I should sell a stock.
I don't do day-trading, so I don't really care about minute-data or even minute-based decisions. The minimum time I will ever hold a stock is 7 days (5 bars). The maximum time I might hold a stock is indefinitely. How long I hold a stock is highly dependent on why I bought the stock. If the algorithm is doing live trading, I cannot afford to lose that information. How do I make sure I keep this information around even on restarts of the trading system? Do I need to send the data to my own server somewhere for storage?