Jocimar Lopes / プロファイル
This article describes the use of CSV files for backtesting portfolio weights updates in a mean-reversion-based strategy that uses statistical arbitrage through cointegrated stocks. It goes from feeding the database with the results of a Rolling Windows Eigenvector Comparison (RWEC) to comparing the backtest reports. In the meantime, the article details the role of each RWEC parameter and its impact in the overall backtest result, showing how the comparison of the relative drawdown can help us to further improve those parameters.
This article proposes using Rolling Windows Eigenvector Comparison for early imbalance diagnostics and portfolio rebalancing in a mean-reversion statistical arbitrage strategy based on cointegrated stocks. It contrasts this technique with traditional In-Sample/Out-of-Sample ADF validation, showing that eigenvector shifts can signal the need for rebalancing even when IS/OOS ADF still indicates a stationary spread. While the method is intended mainly for live trading monitoring, the article concludes that eigenvector comparison could also be integrated into the scoring system—though its actual contribution to performance remains to be tested.
This article describes two additional scoring criteria used for selection of baskets of stocks to be traded in mean-reversion strategies, more specifically, in cointegration based statistical arbitrage. It complements a previous article where liquidity and strength of the cointegration vectors were presented, along with the strategic criteria of timeframe and lookback period, by including the stability of the cointegration vectors and the time to mean reversion (half-time). The article includes the commented results of a backtest with the new filters applied and the files required for its reproduction are also provided.
In this article, we propose a scoring system for mean-reversion strategies based on statistical arbitrage of cointegrated stocks. The article suggests criteria that go from liquidity and transaction costs to the number of cointegration ranks and time to mean-reversion, while taking into account the strategic criteria of data frequency (timeframe) and the lookback period for cointegration tests, which are evaluated before the score ranking properly. The files required for the reproduction of the backtest are provided, and their results are commented on as well.
This article proposes an asset screening process for a statistical arbitrage trading strategy through cointegrated stocks. The system starts with the regular filtering by economic factors, like asset sector and industry, and finishes with a list of criteria for a scoring system. For each statistical test used in the screening, a respective Python class was developed: Pearson correlation, Engle-Granger cointegration, Johansen cointegration, and ADF/KPSS stationarity. These Python classes are provided along with a personal note from the author about the use of AI assistants for software development.
本記事では、共和分関係にある株式バスケットを対象とした、シンプルでありながら包括的な統計的アービトラージのパイプラインについて解説します。データのダウンロードと保存を行うPythonスクリプト、相関検定、共和分検定、定常性検定、さらにデータベース更新用のMetatrader 5サービスの実装およびそれに対応するエキスパートアドバイザー(EA)も含まれています。また、いくつかの設計上の判断については、参考情報および実験の再現性向上のために本記事に記録しています。
本記事では、新しく作成したデータベースを更新するためのMQL5 Serviceのサンプル実装を紹介します。このデータベースはデータ分析や、共和分関係にある株式バスケットの取引に利用されます。データベース設計の根拠についても詳しく説明し、参照用としてデータディクショナリを文書化します。さらに、データベースの作成、スキーマ初期化、市場データ挿入のためのMQL5とPythonのスクリプトも提供します。
この記事では、ナスダックの4銘柄のバスケットを対象としたサンプルのエキスパートアドバイザー(EA)実装を紹介します。銘柄はまずピアソン相関係数に基づいてフィルタリングされました。その後、フィルタリングされた銘柄群について、ジョハンセン検定を用いて共和分関係の有無を検証しました。最後に、共和分関係から得られたスプレッドについて、ADF検定およびKPSS検定を用いて定常性を検証しました。ここでは、このプロセスに関する補足と、小規模な最適化後のバックテスト結果について説明します。
本記事は、トレーダー向けに、最も一般的な共和分検定を優しく紹介し、その結果の理解方法を簡単に解説することを目的としています。エングル=グレンジャーおよびジョハンセンの共和分検定は、長期的なダイナミクスを共有する統計的に有意な資産のペアやグループを特定するのに有効です。特にジョハンセン検定は、3つ以上の資産を含むポートフォリオに対して有用で、複数の共和分ベクトルの強さを一度に評価できます。
本記事では、ポートフォリオレベルの統計的アービトラージの基本的な概念を紹介します。数学の深い知識がない読者にも理解しやすく説明し、実際の運用を始めるためのコンセプトフレームワークを提案することを目的としています。記事には、動作するエキスパートアドバイザー(EA)と、1年間のバックテストに関する注記、再現用の設定ファイル(.iniファイル)も含まれています。
この記事は、MQTT 5.0プロトコルのネイティブMQL5クライアントの開発ステップを説明する連載の最終回です。ライブラリはまだ製品化されていませんが、この部分では、他の証券会社から入手したティック(またはレート)でカスタム銘柄を更新するためにクライアントを使用します。ライブラリの現在の状況、MQTT 5.0プロトコルに完全に準拠するために足りないもの、可能なロードマップ、そしてその開発をフォローし貢献する方法についての詳細は、この記事の最後をご覧ください。
この記事は、MQTT 5.0プロトコル用のネイティブMQL5クライアントの開発ステップを説明する連載の第6部です。今回は、私たちの最初のリファクタリングにおける主な変更点、私たちがどのようにしてパケット構築クラスのための実行可能な設計図にたどり着いたか、どのようにPUBLISHとPUBACKパケットを構築しているか、そしてPUBACK Reason Codeの背後にあるセマンティクスについてコメントします。
この記事は、MQTT 5.0プロトコルのネイティブMQL5クライアントの開発ステップを説明する連載の第5回です。今回は、PUBLISHパケットの構造、Publishフラグの設定方法、Topic Name文字列のエンコード方法、必要な場合のPacket Identifierの設定方法について説明します。
この記事は、MQTTプロトコルのネイティブMQL5クライアントの開発ステップを説明する連載の第4回です。このセクションでは、MQTT v5.0のプロパティとは何か、そのセマンティクス、いくつかのプロパティの読み方について説明し、プロトコルを拡張するためにプロパティをどのように使用できるかの簡単な例を示します。
この記事は、MQTTプロトコルのネイティブMQL5クライアントの開発手順を説明する連載の第3部です。今回は、CONNECT/CONNACKパケット交換の操作時の動作部分を実装するために、テスト駆動開発をどのように使用しているかについて詳しく説明します。この手順の最後に、クライアントは、接続の試みから生じる可能性のあるサーバー結果のどれに対しても、絶対的に、適切に振る舞うことができなければなりません。
この記事は、MQTTプロトコルのネイティブMQL5クライアントの開発ステップを説明する連載の一部です。今回は、コードの構成、最初のヘッダーファイルとクラス、そしてテストの書き方について説明します。この記事には、テスト駆動開発(Test-Driven-Development)の実践と、それをこのプロジェクトにどのように適用しているかについての簡単なメモも含まれています。
この記事では、MQL5のネイティブMQTTクライアント開発における最初の試みについて報告します。MQTTは、クライアントサーバーのパブリッシュ/サブスクライブメッセージングトランスポートプロトコルです。MQTTは軽量、オープン、シンプルで、簡単に実装できるように設計されています。これらの特性により、さまざまな状況での使用に最適です。
この記事では、MQL5コードをPostgresデータベースに接続するための4つの方法について説明し、そのうちの1つであるREST APIの開発環境をWindows Subsystem For Linux (WSL)を使用して設定するためのステップバイステップのチュートリアルを提供します。APIのデモアプリが、データを挿入してそれぞれのテーブルにクエリを実行するための対応MQL5コード、このデータを使用するためのデモエキスパートアドバイザー(EA)とともに提供されます。