---
title: "Discussion on \"Computing the Gold/Silver Ratio in Python: Alignment, Rolling Z-Scores and a Backtest Sanity Check\" | Hashnode"
description: "Discussion on \"Computing the Gold/Silver Ratio in Python: Alignment, Rolling Z-Scores and a Backtest Sanity Check\". The gold/silver ratio is one of the oldest numbers in commodity markets: the price of one ounce of gold divided by the price of one ounce of silver. It tells you how many ounces of silver one ounce of"
url: "https://hashnode.com/posts/computing-the-gold-silver-ratio-in-python-alignment-rolling-z-scores-and-a-backtest-sanity-check/6ad85930e984ff7e60480a7b"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Computing the Gold/Silver Ratio in Python: Alignment, Rolling Z-Scores and a Backtest Sanity Check](https://13f-insights.hashnode.dev/computing-the-gold-silver-ratio-in-python-alignment-rolling-z-scores-and-a-backtest-sanity-check?utm_source=hashnode&utm_medium=feed)

The gold/silver ratio is one of the oldest numbers in commodity markets: the price of one ounce of gold divided by the price of one ounce of silver. It tells you how many ounces of silver one ounce of

Oct 21 · 5 min read · 13f-insights.hashnode.dev  
Read the article

-   [#python](https://hashnode.com/tag/python)
-   [#pandas](https://hashnode.com/tag/pandas)
-   [#data-analysis](https://hashnode.com/tag/data-analysis)

## Written by

[13F Chat](https://hashnode.com/@chat13f)

@chat13f · Singapore

  
[View profile](https://hashnode.com/@chat13f)

13F filings & institutional holdings data | 13f.chat

I write about 13F filings, institutional investor holdings, asset managers and commodity markets. Explore fund holdings at https://13f.chat

## Responses 1

Markdown supported · ⌘↵ to post

[Arnold Holm](https://hashnode.com/@stratcorealpha)

[Oct 22](https://hashnode.com/posts/computing-the-gold-silver-ratio-in-python-alignment-rolling-z-scores-and-a-backtest-sanity-check/6ad85930e984ff7e60480a7b/comment/6ada4c48e95b49cd3b7fe562)

One boundary I'd make explicit is when a closing signal can actually fill. If that closing value arrives only after the close, shifting the signal one row still assumes a fill at a price already gone. I'd compare that result with the next available tradable quote, with matching timestamps for both legs.
