By Armando Rodriguez

The purpose of such a definition is to capture the randomness of the FOREX market for a given pair in a single number. The random walker statistic have been proved to describe both: the motion of pollen particles on the surface of a liquid, called the Brownian motion and the quotes in the FOREX market. In the Brownian motion, observed variances of the position in any given time interval are proportional to the temperature of the liquid that suspends them. Following the analogy, the variance of the FOREX quotes may be related to some “market temperature” for a given pair.

Yet, this variances refer to a still liquid, so if there
was a flow, the frame of references for those positions must move with the
liquid. Assume **v** is the velocity of the liquid and **x _{0}**
the position of the frame of reference at t=0, then the temperature
proportionality may be expressed as:

**T = C * var(x – (x _{0} + v*t))**

Where T is the absolute temperature, x is the position of
the Brownian particle in a fixed frame of reference and C is a constant with
dimensions Degrees/Velocity^{2}

What does a position variance mean in a Brownian experiment? Since the Brownian particle is moving continuously, it goes through infinite positions. For the experiment, a large but finite number N of snapshots are needed, then the variance of the position in those N snapshots with show to be proportional to the temperature. The variance though, will also be proportional to the number N of snapshots, so the constant C must be inversely proportional to N. Pulling N out of the constant, we get:

**T = C _{1} * Var_{N}(x_{n} – (x_{0}
+ v*t_{n}))/N**

**C _{1}** here is a constant that is independent
of the number N of snapshots, but not of the particles mass. The heavier the
particle, the smaller the variance will be at the same temperature. If the mass
is pulled out of the constant, then:

**T = B * M * Var _{N}(x_{n} – (x_{0}
+ v*t_{n}))/N**

The above can be expressed as:

**T = B * K**

Where:

**K = M * Var _{N}(x_{n} – (x_{0} +
v*t_{n}))/N**

is the average kinetic energy of the Brownian particle. **
B** is one of the constants of nature called the Boltzmann constant with
dimensions (degree / unit of kinetic energy).

The fluid velocity **v** and the t=0 intercept **x _{0}**
may be estimated by applying linear regression to the set of points (x

**v = (avg(x _{n
}* t_{n})- avg(t_{n})*avg(x_{n}))/(
avg( t_{n}^{ 2})
– (avg(t_{n}))^{2})**

**x _{0} = avg(x_{n})
– v* avg(t_{n})**

Following the analogy, allow the **x** to be the quote
values **q**; **v** and **q _{0}** the quote slope in time and
intercept respectively and

**K’** = **M’ * Var _{N}(q_{n} – (q_{0}
+ v*t_{n}))/N**

Where**:**

**v = (avg(q _{n
}* t_{n})- avg(t_{n})*avg(q_{n}))/(
avg( t_{n}^{ 2})
– (avg(t_{n}))^{2})**

**q _{0} = avg(q_{n})
– v* avg(t_{n})**

Since the variance will grow with the square of the average value of the quotes, the smaller this quote average, the “heavier” they will behave. So we may analog the mass of a pair to the inverse of its average squared:

**M’ = 1/(avg(q _{n}))^{2}**

Finally:

**T = B’ * K’**

The constant **B’** is totally arbitrary, since we are
free to choose any temperature scale. The straight forward choice would be an
absolute temperature scale like the Kelvin scale, though a more familiar one
would be the Fahrenheit scale, for which the absolute zero is -459.67 F and the
average room temperature is 77. The Celsius scale is another possible choice,
with an absolute zero of -273.15 C and room temperature of 25 C. So all is
needed is taking the average **K’** for a typical period and assigning it the
average room temperature.

**(77 - (-459.67)) = B _{F} * avg(K’)**

Or:

**B’ _{F}** =

For a Celsius scale:

**B’ _{C} = (25 -(-273.15)) / avg(K’)**

This is as far as the analogy goes because there is a basic difference between a physical Brownian system and a FOREX market pair. In the first, the internal energy of the system is conserved, meaning that for cooling or heating it, energy must be drained from or supplied to the system and this involves time. On the other hand, quotes energy may disappear or appear without any draining/supplying involved, this because the market has no such thing as inertia. For making a market temperature behave as a Brownian system the stability must be artificially built in by using a running average instead of a sequence of values.

The above is not the only difference, another is that molecules are so small and numerous, that any practical time interval or space would still be large when compared to the microscopic world. Not so with the market, where a second is already microscopic, so ten minutes would be about the smallest macroscopic interval.

Still more differences: the kinetic energy distribution in an ideal gas follows the Maxwell-Boltzmann distribution, but the quotes don’t distribute the same. In the first, the average kinetic energy is always about twice the standard deviation, the quotes distribution exhibit standard deviations several times greater than the average. This advises against selecting long intervals for averaging, since it may disperse widely.

Contrary to molecules that are always in motion, the market pauses for the weekends and holidays. Any algorithm for calculating a pair’s temperature must avoid the resulting holes in the data by enforcing the condition that the average time within the interval must be around the middle of the interval. Also, stray values, may be encountered in the quote stream, so any quote differing beyond x%, from the average within the interval should be ignored. For ten minute intervals the chosen percentage was 0.1% (10 pips)

The ten minute average kinetic energies of each pair will
be calculated every ten minutes to affect an exponential moving average (K_{ema})
with a characteristic time of approximately 24 hours. Let the present time be
**t _{n},** the time ten minutes ago be

**
K _{ema}(t_{n})
= K_{ema}(t_{n-1}) + (K_{n} - K_{ema}(t_{n-1}))
/ 144**

The number 144 comes from the number of 10 minute intervals in 24 hours. These values will be stored time stamped in the Temperatures table, one row for each pair every 10 minutes.

The actual temperature in the Kelvin, Fahrenheit or Celsius scale, will be computed on demand using the expressions:

**T _{F} = B’_{K}** *

**T _{F} = B’_{F}** *

Or

**T _{C} = B’_{C}** *

**The constants (B’ _{X})
will be calculated so that temperatures average about the typical room
temperature.**