GithubHelp home page GithubHelp logo

binance_f_trade's People

Contributors

tamurajunichi avatar juntar0 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

binance_f_trade's Issues

Readmeの追加

基本的な使い方や、必要なパッケージ及びバージョン情報、よくありそうな問題点を書く。

長期間動作させるorバックテストで処理時間が重くなっていく

以下の部分で長期間動作させる際に処理時間が長くなっていくため,long,short,profitはデータフレームへ直接代入する必要がある。

binance_f_trade/log.py

Lines 79 to 111 in f1ec4d0

df["Long"] = pd.Series()
df["Short"] = pd.Series()
if len(self.long) > 0:
for i in self.long:
try:
l = df.index[df['Close Time'] == i[0]]
if l[0] in df.index:
df.loc[l, "Long"] = 1.0
except IndexError:
pass
self.ax_1.scatter(df.index, df["Long"].mask(df['Long'] == 1.0, df['Low']-20),marker="^",color="r",label="long")
if len(self.short) > 0:
for i in self.short:
try:
l = df.index[df['Close Time'] == i[0]]
df.loc[l, "Short"] = 1.0
except IndexError:
pass
self.ax_1.scatter(df.index, df["Short"].mask(df['Short'] == 1.0, df['High']+20),marker="v",color="b",label="short")
self.ax_1.legend()
# upnlの処理:self.profit[-1]=upnl→df化, cpnl時の処理:self.profit[-1]=cpnl→self.profit.append(None)→df化(一番後ろは例外処理行き)
df["Profit"] = 0
for i in self.profit:
try:
l = df.index[df['Close Time'] == i[0][0]]
df.loc[l,"Profit"] = i[1]
except IndexError:
# APIからのデータが数行遅れた場合の例外処理
pass
except TypeError:
pass
# save_rpnlで一番後ろがNoneになってる例外処理

バックテスト実装

interface.pyにバックテストのクラスを実装する。
実装内容として、本番環境のbot.pyやmanager.py,log.pyが使用できるようにしたい。

requirements.txtを作成

パッケージの書き出し
pip freeze > requirements.txt

一括インストール
pip install -r requirements.txt

学習の高速化

LSTMでは時系列データを1個ずつ読み取って学習していくため,構造上遅い。何かの工夫で高速化しないと1分足のデータを学習できない。

手数料の実装

現状、損益に手数料が加算されていないため実装する。

バックテストのtickを増やす

バックテストが現在4つのtickでOpen,High,Low,Closeと状態遷移させているのでこの4点を線形につなげるorランダムウォークで補完したい。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.