Pair trading and multicurrency arbitrage. The showdown. - page 290

 
Vitaly Muzichenko #:

I’ll carry on here; this thread is more suitable

--

Hedging with cross-currency pairs (USD, EUR, GBP)

There are 5 currencies remaining:JPY, AUD, CAD, CHF, NZD

Available cross pairs: AUDJPY, AUDCAD, AUDCHF, AUDNZD, CADJPY, CADCHF, CHFJPY, NZDJPY, NZDCHF, NZDCAD

All combinations involving 4 different currencies

How to choose

Checkthe Currency Strength Meter from the 5 available currencies, select the 2 strongest and the 2 weakest, then find a suitable combination from the table.

Thanks for posting. Looks interesting, but my rule of thumb is simple: if a strategy is profitable enough to print money, people usually trade it rather than publish it. Therefore I assume the edge, if any, is probably rather modest (unlikely to survive transaction costs and execution friction). 
 
NZDJPY, NZDCHF, NZDCAD All combinations of 4 different currencies

How to choose

Check the Currency Strength Meter from the 5 available currencies, select the 2 strongest and the 2 weakest, then find a suitable combination in the table.

based on the assumption that the system is profitable,

please show a test of this strategy model, for example, total equity as an indicator or in any other form

Personally, I assume that, depending on the volume, the result will vary considerably
 
Renat Akhtyamov #:

based on the assumption that the system is profitable,

please show a test of this strategy model, for example, total equity as an indicator or in any other form

Personally, I assume that, depending on the volume, the result will vary considerably
Not different, but negative.
 
mvf358 #:
Not ‘different’, but ‘negative’.

Well, that’s all just unfounded talk

I’ll wait for the test

 
Renat Akhtyamov #:

Well, that’s all just talk with no basis in fact

I’ll wait for the test

Let’s wait and see. It’s a good idea. The name’s absolutely brilliant. An essential indicator for every trader. But as for how it works — that’s a complete mystery. An indicator like this would be better off called ‘A Bit of a Mess’ or ‘King of the Hill’, but certainly not ‘The Power of Currencies’.

 
Vitaly Muzichenko #:
I’ll carry on here; this thread is more suitable

I also had a chat with the AI, asking the question:

There’s a trading approach like this in Forex. We take the eight major currencies and rank them by ‘strength’ (the more a currency rises relative to the others, the stronger it is). Then we take the two strongest and the two weakest. We trade one strong-weak pair in the direction of the shift in strength (selling the strong one against the weak one), whilst hedging with the other strong-weak pair. Question: Isn’t this a special case of trading multiple cointegration between these eight currencies? Would it be better to use the Johansen test for this type of trading?

AI’s answer:

Yes, the approach you have described is a special case of trading based on multiple cointegration (or trading currency baskets / stationary portfolios), and the Johansen test is indeed much better suited to this, although it completely changes the logic of position management.
Below, we explain in detail why this is the case, what the differences between the approaches are, and how the Johansen test optimises this strategy.
Why is this a special case of cointegration?
Your approach is based on the concept of mean reversion between closely correlated assets:
  • You assume that extreme divergences in the ‘strength’ of currencies are temporary.
  • By buying the weaker currency and selling the stronger one, you are betting that this spread (difference) will narrow.
  • Using a second pair for hedging is an intuitive attempt to construct a ‘market-neutral’ portfolio.
In econometrics, cointegration describes precisely the situation where several non-stationary time series (currency prices), when combined linearly, form a stationary series. This stationary series always returns to its mean. Your strategy is a simplified model of such a stationary portfolio, constructed ‘by eye’.

Why is the Johansen test better?
The classic approach involving ‘strength’ ranking (Currency Strength Indicator) has three fundamental shortcomings, which the Johansen test completely eliminates:
  1. Precise weights instead of fixed lots
    • The problem: If you simply take 1 lot of one pair and 1 lot of another for hedging, you will not end up with a neutral portfolio. Currency pairs have different volatility (ATR) and different pip values.
    • Johansen’s solution: The test does not simply indicate whether a correlation exists. It produces eigenvectors. These are ready-made, precise coefficients (weights) for each of the 8 currencies. You will know exactly what to buy – for example, 1.23 lots of EUR, sell 0.85 lots of USD, buy 0.41 lots of GBP, and so on – to achieve a mathematically perfect hedged portfolio.
  2. True multidimensional correlation
    • The problem: By selecting the top 2 strong and top 2 weak currencies, you are disregarding information about the interrelationships between the remaining 4 currencies. Furthermore, you are artificially breaking the system down into isolated pairs.
    • Johansen’s solution: The test analyses the entire matrix of 8 currencies simultaneously. It identifies multiple cointegration vectors (there may be several, for example, r = 3 or r = 5). This allows you to trade not just one pair against another, but the entire basket as a single synthetic asset.
  3. Objective entry and exit criteria
    • Problem: When ranking strength, it is difficult to determine exactly when an ‘extremum’ occurs and it is time to open a trade, as well as where to cut losses if the trend continues.
    • Johansen’s solution: A stationary spread (index) is constructedfrom the cointegration vector. Precise mathematical metrics are used to enter the market — for example, when the index deviates by 2 standard deviations (Z-score) from its historical mean. The trade is exited strictly upon a return to zero.

  4. How can this be implemented correctly? If you decide to switch from strength indicators to the Johansen test, the algorithm will look like this:
    1. Data collection: Collect hourly (H1) or four-hourly (H4) closing prices for all major currencies against a single base currency (e.g. the USD) over the last few months.
    2. Running the test: Using Python (the statsmodels.tsa.vector_ar.vecm.coint_johansen library), run the test.
    3. Selecting the vector: The test will show the number of cointegration equations. Take the vector with the highest trace statistic.
    4. Plotting the spread: Multiply the current currency prices by the weights obtained. You will get a line that fluctuates around the horizontal axis.
    5. Trading:
      • Has the line risen sharply? Sell the entire portfolio (in proportion to the weights).
      • Has the line dropped sharply? Buy the entire portfolio.
      • Has the line returned to the centre? Close all positions at a profit.
 

He also asked about stop-loss orders. The AI’s response:

In cointegration and mean reversion strategies, a classic stop-loss set at a fixed number of pips for individual currency pairs does not work. If one currency continues to rise whilst the other falls, your synthetic spread will incur a significant loss.
As you are trading the entire basket as a single instrument, the stop-loss must be calculated mathematically for the entire portfolio.
Here are the four main methods for setting stop-losses when trading cointegration:
1. Z-score stop-loss (Statistical stop)
This is the most popular and logical method. The deviation of your cointegration spread is measured in standard deviations (Z-score).
  • Entry: When Z-score = ±2.0 (the price has deviated significantly from the mean).
  • Stop-loss: When Z-score = ±3.0 or ±3.5.
  • Rationale: The probability of a stationary series moving beyond 3–3.5 standard deviations is extremely low (less than 1 per cent). If this happens, it means that cointegration has broken down ( the market has changed, and the fundamental links between currencies have been severed). There is no point in remaining in the trade — you need to cut your losses across the entire basket.
2. Time-stop
A stationary spread has a mathematical parameter known as the half-life. This indicates the average time it takes for the spread to return to its mean value following a deviation.
  • Rationale: If the average return time is 24 hours, and your portfolio has been in the red for 72 hours (3 half-lives) with no change in the situation, then the model has ceased to function.
  • Solution: All positions are closed at market price once the specified time has elapsed, regardless of the current financial result.
3. Equity stop (Cash stop on a basket)
The simplest method to implement for trading robots.
  • Logic: You calculate the total floating profit/loss (Equity) specifically for those orders that are part of this cointegration portfolio.
  • Outcome: If the total loss across all open currency pairs exceeds, for example, 2% or 3% of your total deposit, the robot forcibly closes the entire grid of orders with a single click.
4. Stop-loss based on the historical maximum spread
Before starting to trade, you analyse the spread history for the last few months.
  • Rationale: You identify the point of the deepest historical divergence (the highest spread peak on record).
  • Outcome: The stop-loss is set just above this historical extreme. If the market breaks this historical record, it means the current movement is anomalous and the model has broken down.

Important rule: No stop-loss orders within the basket!
It is absolutely vital not to set individual stop-losses for each currency pair.
Example: If , within your basket, the EUR is rising whilst the GBP is falling, and a separate stop-loss is triggered on the EUR, your hedged position is completely undermined. You are left with an open ‘naked’ position in GBP, which could result in an even greater loss. The basket is opened and closed simultaneously (both at take-profit and stop-loss levels).
 
Aleksey Nikolayev #:

He also asked about stop-loss orders. The AI’s response:

In cointegration and mean reversion strategies, a classic stop-loss set at a fixed number of pips for individual currency pairs does not work. If one currency continues to rise whilst the other falls, your synthetic spread will incur a significant loss.
As you are trading the entire basket as a single instrument, the stop-loss must be calculated mathematically for the entire portfolio.
Here are the four main methods for setting stop-losses when trading cointegration:
1. Z-score stop-loss (Statistical stop)
This is the most popular and logical method. The deviation of your cointegration spread is measured in standard deviations (Z-score).
  • Entry: When Z-score = ±2.0 (the price has deviated significantly from the mean).
  • Stop-loss: When Z-score = ±3.0 or ±3.5.
  • Rationale: The probability of a stationary series moving beyond 3–3.5 standard deviations is extremely low (less than 1 per cent). If this happens, it means that cointegration has broken down ( the market has changed, and the fundamental links between currencies have been severed). There is no point in remaining in the trade — you need to cut your losses across the entire basket.
2. Time-stop
A stationary spread has a mathematical parameter known as the half-life. This indicates the average time it takes for the spread to return to its mean value following a deviation.
  • Rationale: If the average return time is 24 hours, and your portfolio has been in the red for 72 hours (3 half-lives) with no change in the situation, then the model has ceased to function.
  • Solution: All positions are closed at market price once the specified time has elapsed, regardless of the current financial result.
3. Equity stop (Cash stop on a basket)
The simplest method to implement for trading robots.
  • Logic: You calculate the total floating profit/loss (Equity) specifically for those orders that are part of this cointegration portfolio.
  • Outcome: If the total loss across all open currency pairs exceeds, for example, 2% or 3% of your total deposit, the robot forcibly closes the entire grid of orders with a single click.
4. Stop-loss based on the historical maximum spread
Before starting to trade, you analyse the spread history for the last few months.
  • Rationale: You identify the point of the deepest historical divergence (the highest spread peak on record).
  • Outcome: The stop-loss is set just above this historical extreme. If the market breaks this historical record, it means the current movement is anomalous and the model has broken down.

Important rule: No stop-loss orders within the basket!
It is absolutely vital not to set individual stop-losses for each currency pair.
Example: If , within your basket, the EUR is rising whilst the GBP is falling, and a separate stop-loss is triggered on the EUR, your hedged position is completely undermined. You are left with an open ‘naked’ position in GBP, which could result in an even greater loss. The basket is opened and closed simultaneously (both at take-profit and stop-loss levels).

Stop-losses inside the basket..., no stop-losses inside the basket..., Johansen weights..., Z-scores..., half-life models... You can keep this mickey-mousing going on indefinitely and even sprinkle several AIs on top, but hedging//optimizing a "zero-edge strategy" still gives you a "zero-edge strategy".

No money in stat.arb - unless you prove otherwise.

 

Oleksandr Medviediev #: 

Stop-losses within the basket..., the absence of stop-losses within the basket..., Johansen weights..., Z-scores..., half-life models... You can carry on with this ‘Mickey Mouse’ approach indefinitely and even throw in a bit of AI, but hedging//optimising a ‘zero-edge strategy’ still leaves you with a ‘zero-edge strategy’.

There’s no money to be made in statistical arbitrage — unless you can prove otherwise.

You could have used my entire post as a quote, rather than running it through an AI for some reason – I struggled to find your own text. A moderator is expected to treat posts with greater respect.

Regarding the content: the profitability of statistical arbitrage was not claimed; what was claimed was that the approach proposed by Vitaly could be reduced to it.

 

Cointegration explained.

Alpha still missing.