← すべてのサンプル
サンプル 26
Hook on fill log
a hook for "order filled": print what was filled, from the event.
- カテゴリ
- Host:ターミナルのデータとエンジンが必要
- 権限
- なし
- 実行する前に
- attached to "Order filled" (or "Order rejected", "Order
- 何をするか
- none
- 実行方法
- in Script Hooks, "+ Add script" under "Order filled", choose this
- 言語
>=0.1.1, <0.2.0- ホスト
>=0.1.5, <0.2.0- 必要なもの
- event >=0.1.0, <0.2.0
ソース
// Purpose: a hook for "order filled": print what was filled, from the event. // Category: host // Permissions: none // Preconditions: attached to "Order filled" (or "Order rejected", "Order // cancelled") in the Script Hooks window // Side effects: none // Run: in Script Hooks, "+ Add script" under "Order filled", choose this // file. The log shows what it printed; it needs no permission. lang ">=0.1.1, <0.2.0"; host "ttt" ">=0.1.5, <0.2.0"; requires "event" ">=0.1.0, <0.2.0"; fn main() { let e = event.current(); print(e.kind + " at " + to_string(e.time)); for line in e.data { print(" " + line); } }