Has someone written a code for getting a spread data in metatrader?

e.g. If I am trading long Gold and short silver or vice versa, I would like to import 2 data series, one divided by other.

XAUUSD / XAGUSD

This will plot the spread for me.

Thanks
Jeet