Jocimar Lopes
Jocimar Lopes
developer free worker
Jocimar Lopes
已发布文章Statistical Arbitrage Through Cointegrated Stocks (Part 5): Screening
Statistical Arbitrage Through Cointegrated Stocks (Part 5): Screening

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.

Jocimar Lopes
已发布文章Statistical Arbitrage Through Cointegrated Stocks (Part 4): Real-time Model Updating
Statistical Arbitrage Through Cointegrated Stocks (Part 4): Real-time Model Updating

This article describes a simple but comprehensive statistical arbitrage pipeline for trading a basket of cointegrated stocks. It includes a fully functional Python script for data download and storage; correlation, cointegration, and stationarity tests, along with a sample Metatrader 5 Service implementation for database updating, and the respective Expert Advisor. Some design choices are documented here for reference and for helping in the experiment replication.

Jocimar Lopes
已发布文章Statistical Arbitrage Through Cointegrated Stocks (Part 3): Database Setup
Statistical Arbitrage Through Cointegrated Stocks (Part 3): Database Setup

This article presents a sample MQL5 Service implementation for updating a newly created database used as source for data analysis and for trading a basket of cointegrated stocks. The rationale behind the database design is explained in detail and the data dictionary is documented for reference. MQL5 and Python scripts are provided for the database creation, schema initialization, and market data insertion.

Jocimar Lopes
已发布文章Statistical Arbitrage Through Cointegrated Stocks (Part 2): Expert Advisor, Backtests, and Optimization
Statistical Arbitrage Through Cointegrated Stocks (Part 2): Expert Advisor, Backtests, and Optimization

This article presents a sample Expert Advisor implementation for trading a basket of four Nasdaq stocks. The stocks were initially filtered based on Pearson correlation tests. The filtered group was then tested for cointegration with Johansen tests. Finally, the cointegrated spread was tested for stationarity with the ADF and KPSS tests. Here we will see some notes about this process and the results of the backtests after a small optimization.

Jocimar Lopes
已发布文章Statistical Arbitrage Through Cointegrated Stocks (Part 1): Engle-Granger and Johansen Cointegration Tests
Statistical Arbitrage Through Cointegrated Stocks (Part 1): Engle-Granger and Johansen Cointegration Tests

This article aims to provide a trader-friendly, gentle introduction to the most common cointegration tests, along with a simple guide to understanding their results. The Engle-Granger and Johansen cointegration tests can reveal statistically significant pairs or groups of assets that share long-term dynamics. The Johansen test is especially useful for portfolios with three or more assets, as it calculates the strength of cointegrating vectors all at once.

Jocimar Lopes
已发布文章Statistical Arbitrage Through Mean Reversion in Pairs Trading: Beating the Market by Math
Statistical Arbitrage Through Mean Reversion in Pairs Trading: Beating the Market by Math

This article describes the fundamentals of portfolio-level statistical arbitrage. Its goal is to facilitate the understanding of the principles of statistical arbitrage to readers without deep math knowledge and propose a starting point conceptual framework. The article includes a working Expert Advisor, some notes about its one-year backtest, and the respective backtest configuration settings (.ini file) for the reproduction of the experiment.

1
Ishtiaq Ahmad
Ishtiaq Ahmad 2025.04.11
Mystery solved. 😊😊😊
Jocimar Lopes
已发布文章为 MetaTrader 5 开发 MQTT 客户端:TDD 方法 - 最终篇
为 MetaTrader 5 开发 MQTT 客户端:TDD 方法 - 最终篇

本文是介绍我们针对 MQTT 5.0 协议的本机 MQL5 客户端的开发步骤系列文章的最后一部分。尽管该库尚未投入实际使用,但在此部分中,我们将使用我们的客户端来更新来自另一个经纪商的报价(或利率)的自定义交易品种。请参阅本文底部以获取有关该库的当前状态的更多信息、它与 MQTT 5.0 协议完全兼容所缺少的内容、可能的路线图以及如何关注和促进其发展。

Jocimar Lopes
已发布文章为 Metatrader 5 开发 MQTT 客户端:TDD 方法 - 第 6 部分
为 Metatrader 5 开发 MQTT 客户端:TDD 方法 - 第 6 部分

本文是介绍我们针对 MQTT 5.0 协议的本地 MQL5 客户端的开发步骤的系列文章的第六部分。在本部分中,我们会讨论我们第一次重构中的主要变化,我们如何为我们的数据包构建类得出可行的蓝图,我们如何构建 PUBLISH 和 PUBACK 数据包,以及 PUBACK 原因代码背后的语义。

Jocimar Lopes
已发布文章为 Metatrader 5 开发 MQTT 客户端:TDD 方法 - 第 5 部分
为 Metatrader 5 开发 MQTT 客户端:TDD 方法 - 第 5 部分

本文是系列文章的第五部分,介绍了我们为 MQTT 5.0 协议开发本地 MQL5 客户端的步骤。在这一部分中,我们将介绍 PUBLISH 数据包的结构、如何设置其发布标志(Publish Flag)、如何对主题名称(Topic Name)字符串进行编码,以及在需要时如何设置数据包标识符(Packet Identifier)。

Jocimar Lopes
已发布文章为 Metatrader 5 开发MQTT客户端:TDD方法——第4部分
为 Metatrader 5 开发MQTT客户端:TDD方法——第4部分

本文是一系列文章的第四部分,介绍了我们为 MQTT 协议开发本机 MQL5 客户端的步骤。在这一部分中,我们将描述什么是 MQTT v5.0 属性,它们的语义,以及我们如何阅读其中的一些属性,并提供一个如何使用属性来扩展协议的简短示例。

Jocimar Lopes
已发布文章为 MetaTrader 5 开发MQTT客户端:TDD方法——第3部分
为 MetaTrader 5 开发MQTT客户端:TDD方法——第3部分

本文是一系列文章的第三部分,介绍了我们为MQTT协议开发本机MQL5客户端的步骤。在这一部分中,我们详细描述了如何使用测试驱动开发来实现CONNECT/CONNACK数据包交换的操作行为部分。在这一步骤结束时,我们的客户端必须能够在处理连接尝试可能产生的任何服务器结果时表现得正常。

Jocimar Lopes
已发布文章为 MetaTrader 5 开发一款 MQTT 客户端:TDD 方式 - 第2部分
为 MetaTrader 5 开发一款 MQTT 客户端:TDD 方式 - 第2部分

本文是描述 MQTT 协议的本机MQL5客户端开发步骤系列文章的一部分。在这一部分中,我们将描述我们的代码组织、第一个头文件和类,以及我们如何编写测试。本文还包括关于测试驱动开发实践以及我们如何将其应用于该项目的简要说明。

Jocimar Lopes
已发布文章为 MetaTrader 5 开发一款 MQTT 客户端:TDD 方式
为 MetaTrader 5 开发一款 MQTT 客户端:TDD 方式

本文汇报为 MQL5 开发原生 MQTT 客户端的首次尝试。MQTT 是一种客户端-服务器之间发布/订阅消息的传输协议。它轻巧、开放、简单,并且易于实施。这些特性令其非常适合在多种情况下使用。

Jocimar Lopes
已发布文章如何将 MetaTrader 5 与 PostgreSQL 连接
如何将 MetaTrader 5 与 PostgreSQL 连接

本文讲述了将 MQL5 代码与 Postgres 数据库连接的四种方法,并提供了一个分步教程,指导如何使用 Windows 子系统 Linux (WSL) 为 REST API 设置一个开发环境。 所提供 API 的演示应用程序,配以插入数据并查询相应数据表的 MQL5 代码,以及消化此数据的演示智能系统。

· 2 1050
Jocimar Lopes
已在MQL5.community注册