Closed dib542 closed 6 months ago
Previously the price in ["open", "high", "low", "close"] tick index format (price = 1.0001^tickIndex) would not make sense if viewing a price timeseries where the tokens are in the reversed order from how they are stored in the database.
["open", "high", "low", "close"]
price = 1.0001^tickIndex
Example: excerpt from /timeseries/price/A/B
/timeseries/price/A/B
{ "shape": [ ["time_unix", ["open", "high", "low", "close"]] ], "data": [ [1703705820, [-12080, -4829, -12080, -4829]] ] }
reversed: /timeseries/price/B/A
/timeseries/price/B/A
{ "shape": [ ["time_unix", ["open", "high", "low", "close"]] ], "data": [ [1703705820, [12080, 4829, 12080, 4829]] ] }
This PR changes this behavior to give the correct high and low values with the token ratio viewed in both directions.
Previously the price in
["open", "high", "low", "close"]
tick index format (price = 1.0001^tickIndex
) would not make sense if viewing a price timeseries where the tokens are in the reversed order from how they are stored in the database.Example: excerpt from
/timeseries/price/A/B
reversed:
/timeseries/price/B/A
This PR changes this behavior to give the correct high and low values with the token ratio viewed in both directions.