try this
a couple of note:
-About the lag: The indicator lags by HalfLength bars, not specifically 10. With the default HalfLength=12, it lags 12 bars. If you set HalfLength=10, then yes, it would lag 10 bars.
-About recalculation: The last HalfLength bars ALWAYS recalculate internally, regardless of the DrawExtrapolatedPart setting. DrawExtrapolatedPart only controls the VISUALIZATION, not the calculation itself. So it doesn't actually prevent recalculation, it just hides the recalculating portion from the chart
+C+