chandlercjy / onepy Goto Github PK
View Code? Open in Web Editor NEWPython Backtesting library for OnePiece in trading.
Home Page: https://zhuanlan.zhihu.com/onepy
License: MIT License
Python Backtesting library for OnePiece in trading.
Home Page: https://zhuanlan.zhihu.com/onepy
License: MIT License
"""
Traceback (most recent call last):
File "E:/game/OnePy/examples/tutorial.py", line 2, in
import OnePy as op
File "E:\game\OnePy\OnePy_init_.py", line 2, in
from OnePy.main import OnePiece
File "E:\game\OnePy\OnePy\main.py", line 11, in
from OnePy.sys_module.components.output import OutPut
File "E:\game\OnePy\OnePy\sys_module\components\output.py", line 5, in
from OnePy.utils.awesome_func import dict_to_table
File "E:\game\OnePy\OnePy\utils\awesome_func.py", line 7, in
from retry import retry
ModuleNotFoundError: No module named 'retry'
"""
from retry import retry
should to be
from retrying import retry?
如果全A选股,需要3000多个mongodb连接?
你好,我已经pip安装了dataclasses模块了,但是仍然显示
ModuleNotFoundError: No module named 'dataclasses'
Process finished with exit code 1
请问这个如何解决。
谢谢!
AttributeError Traceback (most recent call last)
in
----> 1 go.sunny(show_process=True)
AttributeError: 'CSVReader' object has no attribute 'sunny'
can you please suggest , how to fix this issue?
thanks a lot,
import OnePy as op
from OnePy.custom_module.cleaner_sma import SMA
class SmaStrategy(op.StrategyBase):
def __init__(self):
super().__init__()
self.sma1 = SMA(3, 40).calculate
self.sma2 = SMA(5, 40).calculate
def handle_bar(self):
for ticker in self.env.tickers:
if self.sma1(ticker) > self.sma2(ticker):
self.buy(100, ticker, takeprofit=15,
stoploss=100)
else:
self.sell(100, ticker)
TICKER_LIST = ['^DJI'] # 多品种
INITIAL_CASH = 20000
FREQUENCY = 'D'
START, END = '2015-08-07', '2018-08-07'
SmaStrategy()
go = op.data_readers.CSVReader('C:\Users\jarod\OnePy-master\data\', file_name='000001', ticker='^DJI')
#go = op.backtest.stock(TICKER_LIST, FREQUENCY, INITIAL_CASH, START, END) # 设置好股票回测的基本配置
#go = op.backtest.stock(TICKER_LIST, FREQUENCY, INITIAL_CASH, START, END)
go.sunny(show_process=True)
你好!
想请教一下,在你的base_reader.py中load方法,从csv或者mongodb读取之后最终返回的是什么内容?是dataframe?dict?
您好,非常感谢您的代码,我对py还不熟悉,类这关卡一直没过... 我运行案例里面的csv_to_MongoDB.py 报错
C:\OnePy\examples>c:\py36\python csv_to_MongoDB.py
Traceback (most recent call last):
File "csv_to_MongoDB.py", line 3, in
from OnePy.tools.to_Mongodb import Forex_CSV_to_MongoDB
File "c:\py36\lib\site-packages\OnePy\tools\to_Mongodb.py", line 11, in
from ..broker import oanda
ModuleNotFoundError: No module named 'OnePy.broker'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.