For example if I have 2 Bond ETF's:
-HYLD
-SHY
In my strategy, I need to create a 20 day Simple Moving Average of the ratio of the daily close prices:
SMA(HYLD Close Price / SHY Close Price)
Do I need to manually create a new DataSeries with the price ratio and pass that to SMA in the OnBarUpdate event? I would also like to plot this SMA.
Any sample code would be greatly appreciated.

Comment