Comments (4)
1日1回必ずpost_create
これは、恐らく再起動されていますね。Herokuのhobbyプランはそのような仕様だったと記憶しています。
1.post_createされた直後の一番最初のnext_tickは、ただレートを受け取るだけで、前日の最後のnext_tickのレートと比較してCross upやdownの判断をすることはない
その通りです。restore_state(state)
で状態を復元する等しないと、一番最初のnext_tickは値を返却しません。
- それを回避する方法
Herokuの有料プランを使用して再起動を抑制する以外に、 書かれている通り、restore_state(state)
で状態を復元する方法でも対応可能です。state()
, restore_state(state)
をエージェントのメソッドで定義すれば停止/再開時に呼び出されますので、そこで状態を保存、復元するようにしてみてください。
from jiji2.
ありがとうございます。納得しました。
教えていただいた、状態の保存と復元をエージェントのメソッドで定義するには、具体的にはどのようにすれば良いのでしょうか。
デフォルトのmoving averageのエージェントの最後の方に、以下のような部分がありそのままにしているのですが、このままでもこれらはもしかして機能しているのでしょうか?
エージェントの状態を返却
def state
{
mvs: @mvs.map { |mv| mv.state }
}
end
永続化された状態から元の状態を復元する
def restore_state(state)
return unless state[:mvs]
@MVS[0].restore_state(state[:mvs][0])
@MVS[1].restore_state(state[:mvs][1])
end
from jiji2.
はい、これでよいはずです。
from jiji2.
ありがとうございます。うまくいっているようで良かったです。
from jiji2.
Related Issues (20)
- How does the future works? HOT 2
- Rake spec should include sample_agents/spec HOT 4
- what's the benefits using process.post_exec{...}.value? HOT 1
- Question about tradeReduced. HOT 5
- CADJPYだけエージェントが動作しない。 HOT 6
- 現在の足のN本前から(N+M)本前までの期間Mの移動平均求める方法 HOT 2
- one spec in back_test_repository_spec failed when run isolated spec. HOT 1
- Can you support an agent in simple ruby file instead of text in mongo HOT 1
- next_tickの間隔について HOT 25
- If I create buy_limit order, where can I saw it? HOT 1
- Can I specific interval for agent in live trade? HOT 1
- リアルトレードとバックテスト実施中にMongoDBのエラーが発生しました HOT 2
- 通貨違いのエージェントを複数実行させた時にそれぞれ通貨でグラフを描画することは可能でしょうか HOT 3
- Herokuでデプロイ出来ない。 HOT 1
- 初期設定:証券会社の設定 でエラー HOT 2
- MARKET_IF_TOUCHED_ORDER_REJECT HOT 4
- AWSとDockerを利用したシステムのセットアップにて躓きます HOT 10
- Docker for WindowsでOANDAに接続できない HOT 2
- [include Mongoid::Document]でエラーが発生 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jiji2.