Market Wave Dynamics

An agent-based financial market simulation that delves into the intricate dynamics of trading behaviors, highlighting the influence of psychological factors like FOMO on market outcomes.

View the Project on GitHub wolkenmilch/market-wave-dynamics

Market Wave Dynamics

Dive into the intricate world of financial markets with the Market Wave Dynamics model! Inspired by Bitcoin trading dynamics, this simulation explores the behaviors and strategies of financial agents and how they shape the market landscape.

Eager to experiment with the model or contribute to its growth? Dive into the Documentation for detailed guidance and insights!

Table of Contents

What is it?

Dive into the intricate world of financial markets! This model, inspired by the bustling realm of Bitcoin trading, simulates how individuals decide their financial strategies. From cautious savers to strategic traders, we explore how each player influences market dynamics. The model introduces a unique agent, the ‘saver’, who doesn’t trade but holds onto their savings. By studying behaviors like the ‘Fear of Missing Out’ (FOMO), we aim to understand the inflow of new investors and its impact on market prices. As waves of new investors pour into the market, the dynamics of price changes become more pronounced, leading to intriguing fluctuations and trends. Whether you’re intrigued by the complexity of Bitcoin bubbles or the subtle dance of supply and demand, this simulation offers a window into the world of financial ebbs and flows.

How it Works

Imagine a financial playground, bustling with activity, strategies, and interactions. Here’s the breakdown:

Agents & Their Roles:

Interactions & Dynamics:

Market Behavior & Price Dynamics:

How to Use it

This model provides an interactive simulation to understand the behavior of financial agents in a market scenario inspired by Bitcoin trading dynamics. The interface consists of several controls that allow you to manipulate the agents’ behaviors, market conditions, and view the results in real-time.

Controls:

  1. Buttons:
    • Setup: Click this button to initialize the model with the specified parameters.
    • Start: Begins the simulation. Once clicked, the agents will start their trading or saving activities based on their strategies.
  2. Sliders:
    • perc-talk: Adjusts the percentage of agents that talk or communicate with each other.
    • return-on-savings: Determines the return on savings for the saver agents.
    • save-react-param & chart_react_param: Adjusts how reactive savers and chartists are to market changes.
    • rand-chart-shocks, rand-deviat-fund, rand-price-flucts, rand-savings: Introduce randomness to respective agent strategies and market conditions.
    • price-adj-coeff, prob_talk_change, prob-indep-change, memory: Fine-tune various agent behaviors and memory effects.
  3. Switches:
    • save2fund & fund2save: Toggles the ability for savers to become fundamentalists and vice versa.
  4. Plots:
    • Price-Chart: Visualizes the price changes over time.
    • Agent-Weights: Shows the distribution of agent strategies over time.
    • Market Participants & Traders Inflow: Displays the number of active participants and new entrants in the market.
  5. InputBox:
    • steps: Define the total number of steps the simulation should run for.

Example Use Case:

  1. Click the Setup button to initialize the simulation.
  2. Adjust the perc-talk slider to 30%. This means 30% of the agents will communicate with each other.
  3. Set return-on-savings to 0.02, implying savers get a 2% return on their savings.
  4. Turn on the save2fund switch, allowing savers to become fundamentalists.
  5. Click the Start button to begin the simulation.
  6. Observe the Price-Chart. As the simulation progresses, you might notice price fluctuations based on agent interactions and their strategies.
  7. Experiment by adjusting other sliders and observing the effects on the plots.

By manipulating the controls and observing the outcomes, you can gain insights into how different factors influence market dynamics, agent behavior, and price fluctuations.

Things to Notice

1. Price Changes and Endogenous Responses

2. Regime Switches and Trading Strategies

3. Saver Impact and Market Flow

4. Return on Savings

5. Saver Reactions

Things to Try

1. Adjust Market Dynamics

2. Experiment with Trader Behavior

3. Influence Market Inflow and Outflow

4. Simulate Extreme Scenarios

5. Replicate Real-world Phenomena

6. Robustness Checks

7. Visual Analysis

Extending the Model

While the current implementation captures many features of financial markets, there are several avenues for further enhancement and refinement:

1. Agent Activation Mechanism

2. Enhanced Inflow Scenarios

3. New Agent Behaviors

4. Modelling Real-world Phenomena

5. Analysis Tools

6. Parameter Optimization

7. Model Complexity and Realism

Remember, while extending the model adds depth and detail, it’s essential to ensure that the added complexity serves a clear purpose and enhances the understanding of the system being modeled.

NetLogo Features

This model showcases several notable features and techniques in its NetLogo implementation:

1. State Memory:

The model maintains memory of previous states for several variables, such as last-price2 and last-price. This feature allows the model to perform calculations based on past values, such as returns.

2. Randomness:

The model introduces various random elements (random-normal) to simulate uncertainty and fluctuations in factors like chartist shocks (beta), deviations for fundamentalists (yota), factors for savers (sigma), and price fluctuations (alpha).

3. Agent Interaction:

The talk-and-learn procedure lets agents interact, share their strategies, and potentially adapt others’ strategies based on certain conditions, mimicking real-world scenarios where investors share insights and adjust their trading behaviors.

4. Conditional Operations:

The code uses several conditional checks (if, ifelse) to determine agent behaviors, strategy switches, and market mechanics. For example, agents compare their current strategy to a received strategy and may adopt it based on certain conditions.

5. Dynamic Weight Calculation:

The model dynamically calculates weights for each trading strategy based on the number of agents following that strategy, adjusting the influence of each strategy in market mechanics.

6. Market Dynamics:

The market-mechanics procedure bundles several crucial market operations, such as order calculations, weight calculations, price dynamics, fitness calculations, and strategy change probability calculations.

7. Strategy Transition Probabilities:

The change-probability procedure calculates the likelihood of agents switching between different strategies. This procedure dynamically adjusts these probabilities based on the fitness of each strategy, providing a dynamic interplay between agent behaviors.

8. Modularity:

The model’s code is modular, with different functionalities encapsulated in separate procedures, making it easy to read, understand, and extend.

9. Optimization Opportunities:

While the model is comprehensive, there’s an opportunity to introduce more efficient coding techniques. For instance, the repeated calculation of weights and orders for various agents could be optimized.

Workarounds:

The model seems optimized for the current functionalities. However, as with any simulation, there’s always room for further refinement or the addition of new features to enhance its predictive capabilities or realism.

It’s essential to understand these features when extending or adapting the model, as they form the backbone of the simulation’s mechanics and behaviors.

Several agent-based models (ABMs) have been proposed in the literature to investigate and understand the phenomenon of asset price bubbles. Here are some models and studies of related interest:

Brock & Hommes (1998):

This model allows market participants to select among different trading strategies based on past profits. The model explores how agents’ orders influence price, which in turn affects the success of a strategy and its selection probability. This mechanism can lead to the emergence of bubbles and crashes.

Kirman (1993):

This model is inspired by the behavior of ant colonies choosing between two food sources. It applies a stochastic learning process to the foreign exchange market. The model explores how agents change groups based on the majority opinion and the success of their strategy.

Westerhoff (2010):

This model combines the herding mechanism from Kirman’s ant model with the success-dependent switching probabilities from Brock & Hommes (1998). It shows the interaction between different types of traders leading to the emergence of bubbles and crashes.

For implementation in NetLogo, users can refer to the official NetLogo library and specifically the models developed by Wilensky (1999).

Credits and References

For a detailed understanding and deeper dive into the topics discussed, readers can refer to the following references:


Contributing

If you’d like to contribute to the project, please fork the repository and make changes as you’d like. Pull requests are warmly welcome.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

If you have any questions or run into issues, please open an issue and we’ll do our best to help.