DEV Community

hmza
hmza

Posted on

Trading Game 69: Unlocking the Dynamics of Random Price Movements for Realistic Market Simulation

Modeling Random Price Movements in Trading Game 69

Abstract

  • This paper describes how prices in Trading Game 69 change randomly yet realistically, capturing essential market behaviors like momentum, random fluctuations, and sudden jumps.
  • The objective is to create a price simulation that feels dynamic and lifelike, enhancing player experience for strategy testing or casual play.

Introduction

  • Trading Game 69 is designed to simulate financial asset prices to provide an engaging and educational trading environment.
  • Instead of using purely random values, the game models price movements that show short-term trends, randomness, and occasional large shocks — similar to real financial markets.

How Price Movement Works

  • At each time step, the price updates based on the previous price plus a percentage change, denoted as Δ.
  • This change is influenced by several factors:

Momentum:

  • Prices often continue moving in the same direction for short periods.
  • If the price just rose, it’s more likely to rise again next step.

Random Noise:

  • Small, unpredictable ups and downs occur constantly, adding excitement and avoiding boring, linear price movement.

Time-Based Cycles:

  • Price volatility follows gentle cycles, mimicking real-world trading patterns like market open and close times.

Drift:

  • A slight upward or downward bias represents general economic growth or decline, preventing the price from wandering aimlessly.

Big Jumps:

  • Occasionally, large sudden price changes simulate major news or events affecting the market.

Mathematical Formula

  • The updated price P_t is calculated from the previous price P_{t-1} by:

P_t = P_{t-1} \times (1 + \Delta_t)

Enter fullscreen mode Exit fullscreen mode
  • where the price change Δ_t is composed of:

Δ_t = M_t \times N_t + D + C_t + J_t

Enter fullscreen mode Exit fullscreen mode
  • M_t: Momentum factor, influenced by the previous price direction
  • N_t: Random noise component, sampled from a small uniform range
  • D: Drift, a small fixed bias representing economic trend
  • C_t: Cyclical term, such as A × sin(ωt) where A is amplitude and ω frequency
  • J_t: Big jump term, mostly zero but occasionally ±0.25 or ±0.50 to represent sudden market events

  • The momentum factor M_t is probabilistic, encouraging price trends to continue:


P(M_t = +1) = p,  if the last move was up  
P(M_t = -1) = 1 - p

Enter fullscreen mode Exit fullscreen mode
  • where p > 0.5 ensures a tendency to keep moving in the same direction.

Why This Matters

  • By combining momentum and noise, Trading Game 69 creates a realistic yet unpredictable trading experience.
  • Players face periods of steady trends and sudden swings, making strategy and timing meaningful.

Future Improvements

  • Simulate trading volume and order books for enhanced realism

  • Add multiple correlated assets to simulate market interactions

  • Model dynamic volatility changes due to market news and events

Conclusion

  • Trading Game 69 uses a simple but powerful model for price movements.
  • The mix of momentum, noise, drift, and occasional big jumps generates a lively market environment that is both challenging and fun for players.

GitHub Repository

Top comments (0)