Docs: Python custom slippage model — implement get_slippage_approximation, don't subclass ISlippageModel
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 88/100
- issue の種類
- ドキュメント
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- python
調査の方向性
skill-templates/orders/SKILL.md と、03 Writing Algorithms/24 Reality Modeling/03 Slippage/01 Key Concepts 配下の Slippage Model Structure ページから始めます。両方のセクションを更新し、指定された組み込みモデルを推奨するとともに、ISlippageModelを継承せず、正確に get_slippage_approximation を使用する単純な Python クラスをドキュメント化します。両方のページにこの修正、価格単位に関するガイダンス、および例が含まれ、矛盾するメソッド名がないことを完了条件とします。
索引モデルが issue の本文から書いたものです。
説明
Gap. A Python custom slippage model is a plain class with one method, get_slippage_approximation(self, asset, order) -> float. Generated code guesses the method name (get_slippage, get_slippage_approx, get_price_adjustment, GetPriceChange) or subclasses the interface (class M(ISlippageModel)). Both fail at set_slippage_model: "ISlippageModel must be fully implemented. Please implement these missing methods …: GetSlippageApproximation" or "interface takes exactly one argument". The Model Structure page shows the correct class, but nothing warns about these forms or points to the built-in models that cover most needs.
Evidence (Sep 24–29). ISlippageModel must be fully implemented / object does not implement ISlippageModel: 34 errors from 34 users, plus interface takes exactly one argument: 7 errors from 7 users. In 8 sampled cases, every one used a wrong method name or inherited from ISlippageModel. Fee, fill and buying-power models show no equivalent errors.
Proposed change. In skill-templates/orders/SKILL.md (the "Fee / slippage / fill / buying-power models" section) and 03 Writing Algorithms/24 Reality Modeling/03 Slippage/01 Key Concepts/05 Model Structure:
Prefer a built-in model:
ConstantSlippageModel(0.0005)(a percent of price),VolumeShareSlippageModel(), orNullSlippageModel.instance(zero slippage).
For a custom model, write a plain class. Don't inherit fromISlippageModel. Implement exactlyget_slippage_approximation, which returns the slippage in price units:class HalfSpreadSlippageModel: def get_slippage_approximation(self, asset: Security, order: Order) -> float: return (asset.ask_price - asset.bid_price) / 2 self.securities[symbol].set_slippage_model(HalfSpreadSlippageModel())
- 主要言語
- HTML
- スター
- 261
- フォーク
- 191
- 平均マージ
- 4時間 42分
- マージ済み PR(30日)
- 65
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
QuantConnect/Documentation のほかの issue
-
missing content writing algorithms
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
QuantConnect/Documentation#2739 ·
メンテナーはふだん 1 日以内に返信
-
missing content writing algorithms
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
QuantConnect/Documentation#2738 ·
メンテナーはふだん 1 日以内に返信
-
missing content writing algorithms
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
QuantConnect/Documentation#2735 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
missing content writing algorithms
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
QuantConnect/Documentation#2733 ·
メンテナーはふだん 1 日以内に返信
-
missing content writing algorithms
難易度 2/5 1〜3時間 初心者へのやさしさ 92/100
QuantConnect/Documentation#2732 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
QuantConnect/Documentation の issue をすべて見る
似ている issue
-
bug documentation
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
ClickHouse/clickhouse-cs#638 ·
メンテナーはふだん 1 日以内に返信
-
Création-JDV
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
-
documentation
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
githubnext/gh-aw-workshop#4046 ·
メンテナーはふだん 1 日以内に返信
-
specification
難易度 1/5 1〜3時間 初心者へのやさしさ 78/100
WICG/webmonetization#751 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
stratum-mining/sv2-ui#294 ·
メンテナーはふだん 7 日以内に返信