Lobster Reversion

Mean-reversion on the price of OldSchool Runescape Lobsters.

Mean-reversion refers to a financial market assumption that as asset's price will converge to its average value given enough time. This assumption is best applied to stable data, for example body temperature; even though there may be spikes in temperature it will always evetually return to it's true average. Or, a more topically stable asset prices. Lobster prices on the Grand Exchange in OldSchool Runescape are stable around a slow moving average. If nothing fundamental changes their price will remain relatively samey. Their avaiablility means they will never climb too high in price, and because of their usefullness the price will never drop too low. This makes them a good asset for the mean-reversion algorithm. The alogorithm is implemented (see Maths section below) so that when the price drops far enough below the moving average, we buy. And when it climbs far enough above, we go short. Finally, when the price returns to the middle, it closes and waits.

It may be worth noting that this is impossible to replicate in game because there is no broker in game from whom you can borrow the lobster asset thus making shorts impossible.\n Prices come from the OSRS Wikipedia real-time API.

Connecting to the Grand Exchange…

Position

Started with 10,000 coins.
Holding
0
lobsters long
Shorting
0
lobsters short
Bank
10,000
gold coins
Total
10,000
value
Waiting...

Curent Strategy

Current price
Buy at
Sell at
Monthly average

Graph depicting the price of lobsters. The dashed line is the 2-hourly average; the blue band is the entry threshold (corresponding to a Z-score of 1.5) and the green band is the exit threshold (corresponding to a Z-score of 0.3). The centre dashed line depicts the monthly average.

Trade log

Waiting for the first price tick…

The Maths
    The price is averaged over the past 120 minutes. Let \(lobster(t)\) be the price of lobsters at time \(t\) minutes in the past. E.g., \(lobster(54)\) is the price of lobsters 54 minutes ago. Then we let, \[h_i = \max_{t\in(i-5,i]}lobster(t),\qquad l_i = \min_{t\in(i-5,i]}lobster(t) \] in other words \(h_i\) is the highest value from the \(i\)th 5-minute interval, and \(l_i\) the lowest. And let \[p_i=\frac{h_i+l_i}{2}\] be the average price from the \(i\)th most recent 5-minute interval.

    We define the sample mean as \[\bar x=\frac 1 n \sum_{i=1}^{24}p_i,\] the sample standard deviation as \[s= \sqrt{\frac 1 n \sum_{i=1}^n(p_i-\bar x)^2},\] and the Z-score as\[z=\frac{p_1-\bar x}{s}\]
    Then the algorithm works simply by buying whenever this Z-score exceeds positive 1.5, sells when the Z-score is lower than negative 1.5, and closes the position and waits whenever the Z-score is lower in absolute value than 0.3. This Z-score is recalculated every 5 minutes by a scheduled job running independently of any visitor, and every visitor sees the same shared position and trade log.
Lobster Reversion item 379 never updated
MICRODESK II