【发布时间】:2016-05-03 12:11:11
【问题描述】:
I'm trying to use PyAlogoTrade's event profiler
但是我不想使用来自 yahoo!finance 的数据,我想使用自己的但不知道如何在 >CSV,格式为:
Timestamp Low Open Close High BTC_vol USD_vol [8] [9]
2013-11-23 00 800 860 847.666666 886.876543 853.833333 6195.334452 5248330 0
2013-11-24 00 745 847.5 815.01 860 831.255 10785.94131 8680720 0
我想做类似的事情:
def main(plot):
instruments = ["AA", "AES", "AIG"]
feed = yahoofinance.build_feed(instruments, 2008, 2009, ".")
然后将yahoofinance.build_feed(instruments, 2008, 2009, ".")替换为我的CSV
我试过了:
import csv
with open( 'FinexBTCDaily.csv', 'rb' ) as csvfile:
data = csv.reader( csvfile )
def main( plot ):
feed = data
但它会引发属性错误。任何想法如何做到这一点?
【问题讨论】:
标签: csv algorithmic-trading quantitative-finance pyalgotrade back-testing