Hi zipliners,
I need to run a loop of backtesting via Zipline, butI could not implement even a simple Algorithm as
attachment (buy APPL and print 2 comments)
There isn’t unfortunately any Tutorial about it. The Link here seems to be deleted, which was a Notebook in folder “Tutorials and Documentation” of Quantopian account.
Thank you in advance!
from zipline.api import order
from zipline.api import history
def initialize(context):
print('initialize ran')
context.test = 'It is just a test. \n'
def handle_data(context,data):
order('AAPL',10)
print(context.test)
if __name__ == '__main__':
algo = TradingAlgorithm(initialize=initialize, handle_data=handle_data)
data = history('AAPL','price', 10, '1d')
algo.run(data=data)
--
You received this message because you are subscribed to the Google Groups "Zipline Python Opensource Backtester" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zipline+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi Ed,
Thanks for the answer by return.
I want to run something as same as my first algorithm.
I would better ask, how I can run the algorithm in
IPython Notebook, namely Research environment of Quantopian.
best regards
Ahmad
--
You received this message because you are subscribed to the Google Groups "Zipline Python Opensource Backtester" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zipline+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi Freddie
As I said before I want to run a loop of backtests, something like the work of Justin Lent over here, in order to apply various optimization methods (Metaheuristics and Mathematical) based on various parameters (technical and fundamental Factors, Risk metrics as Scharpe, Alpha, Return). To implement my exposé, I found Research environment more compatible. Am I right?
About of the error I think it is coming from invocation and
making an object of TradingAlgorithm, their Arguments (such as initialize,
handle data, capital base, etc.) are all deleted from constructor. Cloned version
of Justins work has the same problem.
I really appreciate any help you can provide
Regards
Ahmad
--
You received this message because you are subscribed to the Google Groups "Zipline Python Opensource Backtester" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zipline+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.