In mathematics, such a transformation from normal (rectangular) coordinate system to a new coordinate system, which has a different angle at the top, shifted to a new beginning (to, Po) and rotated by a certain angle (a in the figure) is called an affine transformation. It is a one-to-one: knowing the pair of numbers (t, P), we define the x, y. Conversely, for x, y and t are uniquely recovered P. So in many ways, both representing a price chart can be considered as equivalent, because they contain the same information.

Therefore, we replace the price P its projection y = Paff and obtain an affine representation of the price schedule. There is no need to move to a new time variable, and replace t by Ox, since it means a change of time scale, and this change is automatically advanced technical analysis package for displaying graphics on the screen.

Construction of affine charts

To create affinity represent a given graph, which is generated by the detected channel it is necessary to measure the geometric parameters of the channel: the coordinates of the initial point (to, Po) and angle a. Almost easier to remove the coordinates of two points - (to, Po), (t1, P1), through which the boundary of the channel, and then calculate the slope: tg (a) = (P1 - Po) / (t1 - to).

Parameters of the two channels on the chart yen shown in the figure and table.

When calculating the difference (t1 - to), as indicated in the table TimeDiff, there must be some caution because of possible distortions due to the presentation date and time fields, with days off, etc. From a geometrical point of view TimeDiff is the distance in time between the specified start and end points of the channel, defined as the number of candles between To and T1.

It is also necessary to take into account the large difference in scale numerical representation of price and time. Division (P1 - Po) / (t1 - to) almost always give zero or close to it a number. To avoid this, the price of the yen multiplied by 100 (tangent values in the table are given this scale factor).

For other assets, with a different scale of prices, we have to take their scale factors. For example, in the case of the Euro is used 100000. This multiplication to avoid errors in calculations, the results of a graphing it is not affected by automatic scaling of the GRU packages. The result is an affine transformation rates obtained by the formula:

Paff = (P - Po) - (t - to) * tg (a).

For a complete schedule of candles (candlestick) to apply the transformation to each candle, substituting in place of P field open, high, low and close.

As in the original schedule had two channels, ascending and descending, then produced two versions of affine representation of a price chart. The figure shows both options hour chart yen generated by the channels that were found in the figure: the upper graph is a projection JPY_RIS JPY chart the upward channel, while the bottom graph JPY_FAL - a projection on the downlink.

## Affine geometry markets

Expert