I'm constructing money-neutral spread by this formula:

Spread = log(P1) - log(P2), where P1 and P2 is prices of two instruments

But sometimes spread can get into negative zone, when log(P1) < log(P2). How to avoid this and make spread always positive?

• Adding additional information may help us understand your needs. I mean: why not a simple value? – pincopallino Apr 10 '14 at 6:57
• spread sign is not important. P&L will be determined by change in equity line. – Wisentgenus Apr 10 '14 at 7:17
• My backtesting program accepts only data with positive quotes. I want to backtest this spread like standalone instrument. – Eldar Agalarov Apr 10 '14 at 8:05
• Multiply it by $-1$. – user2763361 Apr 10 '14 at 8:48
• but if spread sometimes is positive, sometimes is negative? – Eldar Agalarov Apr 10 '14 at 9:17

Solution is following: