* 설치
1. 이걸 먼저 설치해주고 https://www.microsoft.com/en-us/download/confirmation.aspx?id=44266
2. anaconda prompt 로 들어가서 pip install zipline
3. 문제는 eclipse (pydev) 들어가면 zipline을 인식을 못한다. 여기서 한 반나절 까먹었다.
아무리 찾아봐도 해결방법이 안나오다가 우연찮게 Windows -> Preference -> Interpreters -> Python Interpreter
가서 아래 Forced Builtins 에 New -> zipline 을 등록해준다. 이러면 된다. (참 골때린다 파이썬의 module import 는)
* 참조
1. 간단한 개념
https://wikidocs.net/4429
2. 이평선 예제
https://wikidocs.net/4583
3. 콴토피안 : Zipline 공식 사이트
https://www.quantopian.com/posts
* 에러
1. zipline Period start fails after period end
-> 위 에러가 발생 시 sort 시켜서 첫번째 인덱스가 작은걸로 바꾸기.
2. dataframe value가 object 였는데 numeric 으로 변경 (df.convert_objects(convert_numeric=True)) 사용
3. KeyError: 'the label [2014-10-03 00:00:00+00:00] is not in the [index]'
이건 버그임. 1.0.1 에서 이 버그가 나옴. 0.9.0 으로 바꾸기.
0.9.0 설치 URL : pip install https://pypi.python.org/packages/source/z/zipline/zipline-0.9.0.tar.gz
(https://www.versioneye.com/python/zipline/0.9.0 참조)
4. History 로 이평선 구할 때 에러 (index out of ...)
http://mtsparrow.blogspot.kr/2016/07/zipline.html 참고
결론은 우리나라와 미국이 쉬는날이 달라 날짜 Index 를 맞춰야한다는거지
'Language > Python' 카테고리의 다른 글
[python zipline 2] 개념 (0) | 2016.08.19 |
---|---|
python pip, conda 간단한 명령어 (설치, 버전 확인, 삭제 등) (0) | 2016.08.17 |
Python에서 효율적인 String Concatenation 방법 (0) | 2016.06.30 |
Python Naming rule (0) | 2016.06.27 |
파이썬이 느린 이유? (0) | 2016.06.15 |