How to run zipline in a class

48 views
Skip to first unread message

John Sumner

unread,
Apr 27, 2018, 5:10:04 AM4/27/18
to Zipline Python Opensource Backtester
I am creating a genetic algorithm using zipline as the trading platform but for the genetic algorithm I need to setup zipline in a class which I thought I did correctly but my implementation gives different data than running it the standard way in the tutorial. Returning a sortino ratio of 102.397 with a ending portfolio value of -80000

While if i run the same logic in the standard way it gives a sortino ratio -0.84 of and portfolio value of 98000.

So my question is how is the correct way to setup zipline in a python class?

Zipline with class attempt: https://pastebin.com/pKXqzUjA

Zipline without class but same logic: https://pastebin.com/CNVbw29Q


I've tried removing the context in the function calls but then it gives the error saying initialize expects 2 arguments and only one was given.


Reply all
Reply to author
Forward
0 new messages