From 93296d7ef57cf7c06dea6ca761bfe2547aef6d57 Mon Sep 17 00:00:00 2001 From: Brian Fink Date: Tue, 28 Oct 2014 21:54:14 -0400 Subject: [PATCH] ENH: Add serialization to account --- zipline/protocol.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/zipline/protocol.py b/zipline/protocol.py index 06b807ee..409dcd2a 100644 --- a/zipline/protocol.py +++ b/zipline/protocol.py @@ -165,6 +165,12 @@ class Account(object): def __repr__(self): return "Account({0})".format(self.__dict__) + def serialize(self): + return 'Account', self.__dict__ + + def reconstruct(self, saved_state): + self.__dict__.update(saved_state) + class Position(object):