Discussing the article: "Application of Nash's Game Theory with HMM Filtering in Trading"

 

Check out the new article: Application of Nash's Game Theory with HMM Filtering in Trading.

This article delves into the application of John Nash's game theory, specifically the Nash Equilibrium, in trading. It discusses how traders can utilize Python scripts and MetaTrader 5 to identify and exploit market inefficiencies using Nash's principles. The article provides a step-by-step guide on implementing these strategies, including the use of Hidden Markov Models (HMM) and statistical analysis, to enhance trading performance.

Nash Equilibrium is a concept in game theory where each player is assumed to know the equilibrium strategies of the other players, and no player has anything to gain by changing only their own strategy.

In a Nash equilibrium, each player's strategy is optimal given the strategies of all other players. A game may have multiple Nash equilibria or none at all.

The Nash equilibrium is a fundamental concept in game theory, named after mathematician John Nash. It describes a state in a non-cooperative game where each player has chosen a strategy, and no player can benefit by unilaterally changing their strategy while the other players keep theirs unchanged.

Application of Nash's Game Theory with HMM Filtering in Trading

Author: Javier Santiago Gaston De Iriarte Cabrera

 

I spent a whole day trying to figure out your code. The instructions in the Python section were clear, and I was able to replicate almost the exact same backtest results as yours. However, the later part of the article was quite obscure, with little explanation of the logic behind pairs trading statistical arbitrage and how exactly game theory was applied.

Here are two examples of problems I encountered with your code:

  1. The isPositiveDefinite() function is intended to check if a single 3×3 covariance matrix is positive definite. However, in InitializeHMM , you pass the entire emissionCovs array to isPositiveDefinite() instead of individual 3×3 matrices.

  2. The way you quantify the strategy signal is also flawed. Both the strategy log-likelihood and strategy trend output the exact same signal, while the HMM signal seems irrelevant. Turning off the HMM signal literally doesn’t change anything, yet your entire article centers around the HMM implementation.

Your strategy is based on arbitrage, and lot size should be a crucial part of it. You do have a calculateLotSize() function, but it isn’t used in your demonstration. And do you seriously believe retail traders will be trading almost every single 4hr candle? The later backtest result wasn’t profitable, yet you claim it should be optimized every couple of months. But what exactly would be optimized? The indicator period?

I’ve read many of your articles, and they’re mostly interesting. However, I think this one is not well-constructed and I would advise the readers to not waste too much time on this like I did. I genuinely hope you maintain the quality of your articles in the future.

 
Zhuo Kai Chen #:

I spent a whole day trying to figure out your code. The instructions in the Python section were clear, and I was able to replicate almost the exact same backtest results as yours. However, the later part of the article was quite obscure, with little explanation of the logic behind pairs trading statistical arbitrage and how exactly game theory was applied.

Here are two examples of problems I encountered with your code:

  1. The isPositiveDefinite() function is intended to check if a single 3×3 covariance matrix is positive definite. However, in InitializeHMM , you pass the entire emissionCovs array to isPositiveDefinite() instead of individual 3×3 matrices.

  2. The way you quantify the strategy signal is also flawed. Both the strategy log-likelihood and strategy trend output the exact same signal, while the HMM signal seems irrelevant. Turning off the HMM signal literally doesn’t change anything, yet your entire article centers around the HMM implementation.

Your strategy is based on arbitrage, and lot size should be a crucial part of it. You do have a calculateLotSize() function, but it isn’t used in your demonstration. And do you seriously believe retail traders will be trading almost every single 4hr candle? The later backtest result wasn’t profitable, yet you claim it should be optimized every couple of months. But what exactly would be optimized? The indicator period?

I’ve read many of your articles, and they’re mostly interesting. However, I think this one is not well-constructed and I would advise the readers to not waste too much time on this like I did. I genuinely hope you maintain the quality of your articles in the future.

 I also spent a lot of time , this code is not clear, even some mistakes