replicate the indicator for spread trading

 
Hello friends, I would like to recreate this indicator for MT4, or if someone already has it done for MT4, that would be even better :D. Here's a description of the indicator and what I know about it: It's an indicator used to understand when to enter and exit the market in spread trading operations. In the case of the following example, we have ETH/USDT spread with BTC/USDT. As you can see, the logic is like an oscillator ranging from -2 to +2, and this parameter is set in the initial input when loaded. It should represent how the two instruments correlate and correlate with each other over time, like a Pearson formula or something similar. Could someone please indicate if something like this already exists?
Files: