---
title: Gold Price Forecasting
url: https://rone.dev/projects/gold-price-forecasting
description: PyTorch LSTM forecasts for Indonesian gold, from one month to five years out.
language: en-US
updated: 2026-09-27
translations:
  id: https://rone.dev/id/projects/gold-price-forecasting
---

# Gold Price Forecasting

PyTorch LSTM forecasts for Indonesian gold, from one month to five years out.

[Projects](https://rone.dev/projects) / [AI](https://rone.dev/projects/category/ai)

Research · Started 2025 · 1 GitHub stars · 0 Forks

A PyTorch time-series pipeline over a decade of Indonesian gold prices: sixty-day sequences, eleven engineered features, and two architectures — a stacked LSTM with a dense head, and a bidirectional variant with an additive attention layer and batch normalisation. Forecasts are generated at horizons from one month to five years and written out as CSV series and plots.

## Project facts

|          |                                                                          |
| -------- | ------------------------------------------------------------------------ |
| Status   | Research                                                                 |
| Category | AI                                                                       |
| Started  | 2025                                                                     |
| Role     | Research and implementation                                              |
| Stack    | Python, PyTorch, pandas, NumPy                                           |
| Licence  | CC0-1.0                                                                  |
| Links    | [Source](https://github.com/ridwaanhall/indonesia-gold-price-prediction) |

## Overview

Ten and fifteen year price histories go in; sequences of sixty days across eleven features come out, normalised and split into train, validation and test. Training uses Adam with weight decay, MSE, and a plateau-triggered learning-rate reduction.

The second architecture is the more interesting one: a bidirectional stack whose outputs pass through an additive attention layer, so the prediction is a weighted sum over the whole window rather than whatever the final timestep happened to hold. Batch normalisation sits between the dense layers.

## What a five-year forecast is worth

The pipeline will happily produce a daily price series five years out, and the plots look convincing. They are not a forecast in any useful sense: each step is fed the model’s own previous output, so error compounds, and nothing in the input describes the things that actually move gold prices over five years.

The companion project that implements an LSTM from scratch put the same class of model through a full evaluation harness and recorded a negative R² and a 25-point loss against buy-and-hold. That result applies here too, and it is the reason both are filed as research rather than as anything to trade on.

<CardGroup cols={2}>
  <Card title="Previous: Shopping Log Bot" href="https://rone.dev/projects/shopping-log-bot">
    A Telegram bot that reads receipt photos with Gemini and files them into a spreadsheet.
  </Card>

  <Card title="Next: LSTM from Scratch" href="https://rone.dev/projects/lstm-from-scratch">
    An LSTM built gate by gate in NumPy, then measured honestly against buy-and-hold.
  </Card>
</CardGroup>
