# How can I normalize price history between -1 and 1 while keeping the ratio of price differences to each other the same?

I want to normalize a series of numbers to all be between -1 and 1, but I would like to do it in a way where the relative difference between price elements stays the same, if possible.

Example list of price series price_list = np.array([4.8, 7.2, 5.0, 8.1])

I use this equation to normalize between -1 and 1. (2*(price_list - min(price_list)) / (max(price_list) - min(price_list)))-1 This returns array([-1. , 0.45454545, -0.87878788, 1. ])

Let's take the ratio between the 0th and 1st non-normalized values. 4.8 / 7.2 = 0.6666666666666666 But the ratio of the 0th and 1st elements in the normalized list is -1 / 0.45454545 = -2.200000022

I would like the data normalized between -1 and 1 in a way that the ratio is also 0.6666666666666666.

Consider only 2 numbers, $$a$$ and $$b$$. The ratio of one to the other will be $$a/b$$. But after scaling the larger will become 1, the smaller $$-$$1, and the ratio will always be $$-$$1.
Note that ratios change when numbers are added or subtracted. If your extreme values are symmetric around 0, say your largest value is $$a$$ and your smallest is $$-a$$, then you can simply divide everything by $$a$$ to get the desired scaling. But if you have to shift the dataset by addition or subtraction, then ratios will change.