Dark
Theme
Light
Theme
Register
Username or Email
Username or Email
Password
Password
Forgot
Signup
Forgot
Browse
Register
Downloads / Indicators
Articles
Upgrade to Elite
Unanswered Posts
My Posts
Return to Homepage
Today's Posts
Trading Reviews and Vendors
Futures Brokers Reviews
Traders Hideout (general)
Platforms and Indicators
Trading Journals
Elite Trading Journals
Psychology and Money Management
Off-Topic
The Elite Circle
Webinars
Trading Articles
Main Trading Articles Index
Article Categories
Help, Tutorials, How-To's
Traders and Trading Methods
Platforms, Tools and Indicators
Terms (Glossary)
Article Tools
List New Articles
List Recent Article Changes
Random Article
Most Popular Articles
Category Groupings
Wanted Articles
Most Linked to from Forum
Go to Page...
Home
>
Info
Full content requires Elite Membership, the below is only a preview of the first post in the discussion.
Zipline running custom algorithm with custom data
Hi,
I'm new to the zipline. I was trying to run this custom algorithm of Paris-trading using my own data from a local csv. Here's the format:
input:
import pandas as pd
import pytz
from collections import OrderedDict
data = OrderedDict()
data['A'] = pd.read_csv('ohlcfetch.csv', index_col=1, parse_dates=['date'])
data['A'].fillna(method="ffill", inplace=True)
print data['A'].head()
Output:
date symbol open high low close volume
2017-09-01 A 64.90 65.180 64.21 64.38 1224667
2017-09-05 A 64.02 64.480 63.81 64.29 910613
2017-09-06 A 64.56 64.810 64.05 64.71 974511
2017-09-07 A 64.85 65.245 64.49 65.14 1075757
2017-09-08 A 65.15 65.680 64.83 65.02 1588439
Link to the algoritm: er/algo.py
I was trying something like this but couldn't figure it out after importing the data:
perf = zipline.run_algorithm(start=pd.to_datetime('2017-09-01').tz_localize(pytz.utc),
end=pd.to_datetime('2017-10-01').tz_localize(pytz.utc),
initialize=initialize,
capital_base=100000,
handle_data=my_handle_data,
data=panel)
Can someone please help me how I should run it now?
Click to create a user account
Already have an account? Sign in
Log in
User Name or Email:
Password:
Forgotten Your Password?
futures io is now NexusFi
Trading Webinars How-to's
Trading Reviews & Products
Join Markets Chat waitlist
NinjaTrader Brokerage (Broker)
Ninja Mobile Trader (Server Hosting)
Apex Trader Funding (Prop Trading)
Tradovate (Trading Platform)
NinjaTrader (Trading Platform)
SharkIndicators (Trading Software)
© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts