Git Product home page Git Product logo

zaifbot's People

Contributors

akira-taniguchi avatar dependabot[bot] avatar hhatto avatar rossywhite avatar ttskmnj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zaifbot's Issues

[優先度高][バグ]actiuve_ordersの戻り値がおかしい

BotBotTradeApiのactiuve_ordersなぜか今回は有効な注文があってもNoneを返す様になってました。先週試した時は有効な注文がある時は、有効な注文一覧を配列で返してたんですけど。ちょっと見てもらっていいですか。

とのこと

他のメソッドも見ておいてください。

[優先度高][バグ][RossyWhite]ADXの算出方法が間違っている

_get_tr()の中で本日高値、底値、前日終値の差分をmax()で選別していますが、abs()を使っていないので正しく差分が最大のものが選出出来ていません。

_get_di()でDIを算出する際に"DMの合計 / TRの合計 * 100"としていますが、1件目はそれでいいのですが、2件目以降は"(前日のDM - (前日のDM/14) + 本日のDM) / (前日のTR - (前日のTR/14) + 本日のTR)"で算出してください。

23行目のADXも1件目は普通にDXの平均値を計算すれば良いのですが、2件目以降は"(前日のADX * 13 + 本日のDX) / 14"で算出して下さい。

*上記の計算は全て期間を14で算出しています。

以下のエクセルシートを参考にしてみてください。
http://stockcharts.com/school/data/media/chart_school/technical_indicators_and_overlays/average_directional_index_adx/cs-adx.xls

API実行時のリトライ機能を実装する

以下、Slackでの会話

@daikishiroi zaifapiのZaifPrivateApiの仕様を変更しました

[3:23] 
APIの実行自体がエラーをだしたときは今まで通りExceptionをraiseします。

[3:24] 
APIの実行が成功したものの、結果がエラー(cancel orderで指定したorder idが存在しない等)はZaifApiErrorをraiseするようにしたので、zaifbot側でZaifApiErrorが発生した時は、BotPrivateApi内の処理でリトライしないように修正お願いします。

[3:25] 
また、nonceが不正(指定したnonceがlatestのnonceより小さかったり、nonceの最大値を超えていた時)はZaifApiNonceErrorをraiseするようにしたので、

[3:26] 
それが発生した際はnonceをよしなにインクリメントして再実行するよう、BotPrivateApiに機能を追加しましょう。

[3:26] 
zaifapiのカレントバージョンは1.5.1なので、次出社された時にまたsetup.pyの修正お願いします。

[優先度高][要望]逆指値注文ができるようにする

`今 317775円で、318000になったら買い注文入れる、とか

[1:01]
逆に310000円になったら売り注文入れる、とか、それが逆指値`

https://github.com/techbureau/zaifbot/wiki/%E6%B3%A8%E6%96%87%E3%81%AE%E8%87%AA%E5%8B%95%E3%82%AD%E3%83%A3%E3%83%B3%E3%82%BB%E3%83%AB

こんな感じでスレッド回して待機して、思った通りの値段になった時にtrade実行するみたいなイメージ

値段が飛び越えたりしたらどうするかとか、値段が離れてしまった時にどうするかとか
そのあたりは引数で調整できるように

init処理のついか

zaifbotはsqliteにデータを保存しています。
なので、動作時にテーブルが存在しない場合、テーブルをクリエイトする処理を行っています。

あまりスマートな方法ではないので、init処理を作成し、そのタイミングでテーブルを作成するようにしましょう。

実行イメージ
1.virtualenv zaif_bot_venv
2.source zaif_bot_venv/bin/activate
3.(zaif_bot_venv)pip install zaifbot
//zaifbotをインストールした環境で「init_datebase」コマンドを実行すると、sqliteにテーブルが作成される
4.(zaif_bot_venv)init_datebase

コマンドに関してはsetup.pyのentry_pointsやconsole_scriptsを調べるとわかると思います。

[優先度高][バグ][どちらでも]init_databaseを実行してもテーブルが作成されない

init_databaseを実行したのですが、テーブルが作成されないっぽい

【再現手順】
1.新しい仮想環境でpip install zaifbotを実行
2.その後、init_databaseを実行
3.下記コードを実行

from zaifbot.bollinger_bands import get_bollinger_bands
print(get_bollinger_bands('xem_jpy'))

出たエラー

sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: bollinger_bands [SQL: 'SELECT bollinger_bands.time AS bollinger_bands_time, bollinger_bands.currency_pair AS bollinger_bands_currency_pair, bollinger_bands.period AS bollinger_bands_period, bollinger_bands.length AS bollinger_bands_length, bollinger_bands.sd1p AS bollinger_bands_sd1p, bollinger_bands.sd2p AS bollinger_bands_sd2p, bollinger_bands.sd3p AS bollinger_bands_sd3p, bollinger_bands.sd1n AS bollinger_bands_sd1n, bollinger_bands.sd2n AS bollinger_bands_sd2n, bollinger_bands.sd3n AS bollinger_bands_sd3n, bollinger_bands.closed AS bollinger_bands_closed \nFROM bollinger_bands \nWHERE bollinger_bands.time <= ? AND bollinger_bands.time > ? AND bollinger_bands.currency_pair = ? AND bollinger_bands.period = ? AND bollinger_bands.length = ? AND bollinger_bands.closed = ? ORDER BY bollinger_bands.time'] [parameters: (1495465200, 1409065200, 'xem_jpy', '1d', 100, 1)]

api.pyでエラーをraiseしているが、exceptでキャッチしていないためプロセスが止まる

api.pyの60行目でエラーをraiseしているのですが、exceptでキャッチしていないためプロセスが止まってしまってます。
このクラスは最新値取得で使われてると思うのですが、エラーががあって最新値取得が取れなくても、また次回取得すれば良いので、プロセスを止めない様にexceptでキャッチして処理してもらえませんか。

売買一時停止機能

ボットを運用していると、色んな理由から売買を一時停止させたいことがよくあります。
ですので、実装されることを希望します。まあ、ライブラリ利用側で実装すれば良いのですが。。

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.