@@ -0,0 +1,1141 @@
+%0A%0A%0A# just playing.. not working (yet)%0A%0A%0A%0Afrom datetime import datetime%0Aimport pytz%0Afrom zipline import TradingAlgorithm%0Afrom zipline.utils.factory import load_from_yahoo%0Afrom zipline.api import order, symbol, history%0A%0A%0Adef example_init(self):%0A    self._buy_above = 400.0%0A%0A%0Aclass with_intrinsic_optimization(object):%0A%0A     def __new__(cls, name, bases, attrs):%0A        attrs%5B'__init__'%5D = example_init%0A        return super().__new__(cls, name, bases, attrs)%0A%0A%0Aclass OptimizedAlgorithm(TradingAlgorithm,%0A                       metaclass=with_intrinsic_optimization):%0A%0A    def initialize(self):%0A        self._buy_above = 500.0%0A%0A    def handle_data(self, data):%0A        if data%5B0%5D%5B'price'%5D %3E self._buy_above:%0A            print(%22We buy above %22 + self._buy_above)%0A            order(symbol('GOOG'), 1)%0A%0A%0Aif __name__ == '__main__':%0A%0A    start = datetime(2015, 1, 1, 0, 0, 0, 0, pytz.utc)%0A    end = datetime(2015, 5, 31, 0, 0, 0, 0, pytz.utc)%0A    data = load_from_yahoo(stocks=%5B'GOOG'%5D,%0A                           start=start,%0A                           end=end)%0A    data = data.dropna()%0A    algo = OptimizedAlgorithm()%0A    results = algo.run(data)%0A%0A

work in progress