- Threshold is set to:
$\text{threshold} \sim \mathcal{U}(0, 1)$ - Strategy is set to: 0 (inactive).
- Holdings are set to: 100.
The threshold is updated with a probability of s
, a parameter in the model, explained as the average update frequency.
The strategy is updated according to: $$ \text{strategy} = \begin{cases} 1 & \text{if } |\text{signal}| > \text{threshold} \text{ and signal > 0} \ -1 & \text{if } |\text{signal}| > \text{threshold} \text{ and signal < 0} \ 0 & \text{otherwise} \end{cases} $$
- Create number of agents, N.
- Set common signal to 0.
- Set price change to 0.
- Set asset price
$\text{threshold} \sim \mathcal{U}(0, 1)$ - Choose the number of agents to track.
- Generates a common noise signal.
- Updates agent strategies.
- Executes trades.
- Calculates price change.
- Updates agent thresholds.
- Records data.