This algorithm is cloned from

How do I change the BarPeriod and OnData to be calulated/called every 2 hours for the last 20 Trading Hours (account for weekend, Holiday, etc.)

I want the SMA to be pased on last 10 periods.  Each period will have the price of the position at then end of 2 Hours, else the last price.

I am looking at similar posts to understand how to use this properly, but so far no luck