GithubHelp home page GithubHelp logo

gink03 / rnn-bitflyer-predictor Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 0.0 100 KB

kerasでbayesian nuralnetworkを実装し、mona coinの値段を予想します

License: MIT License

Python 100.00%
keras rnn bitflyer bitcoin

rnn-bitflyer-predictor's Introduction

bitflyer auto bit and sell

BIDとASKについて

大規模資本が資本を投下すると、成行きで購入することが多く、えぐるように、多くの板(BidとAskに挿している数)が、溶けて消えるとそうです。

このとき、成行きの範囲に収まっていれば売れて消えるので、戦略的には、この乖離が発生する箇所を予想すればいいとわかります。

モデル1(RNN)

系列情報なので、RNNで予想を行います。

どうせ板情報が複雑過ぎて、上手く行かないので、板情報の次元を予め、FCを通して落としておく

MAEの最小化を目的関数に先の150秒を予想する

40ごとの定点観測の4点についてのASK, BIDの乖離量を計算すると、7holdしたMAEで、1.559程度の差になる

ベンチマークとして平均との差を計算すると、1.896程度であり、学習できていることがわかる。

この時の、平均値からの差を答えとした場合のMAEの計算はとなります。

import pickle
from math import sqrt

tds, Tds, tbs, tas = pickle.load(open('tmp/ds_tuple.pkl', 'rb'))

a1 = Tds[:, 0, 0].mean()
SIZE = len(Tds[:, 0, 0])

print(a1)
print(SIZE)

import numpy as np
from sklearn.metrics import mean_squared_error
from sklearn.metrics import mean_absolute_error

score = 0
for i in range(1):
  #score += sqrt(mean_squared_error(Tds[:, i], zeros[i]))
  score += mean_absolute_error(Tds[:, 0, 0], [ a1 for x in range(SIZE) ] )
  #print( Tds[:, i][:,0] )
  #print( zeros[i].shape )
print( score  )

Next Action

  • どこで売って、どこで買うかのルール策定
  • BitFlyerでの実正試験

rnn-bitflyer-predictor's People

Contributors

gink03 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.