Nested Scopes and Cumulative Moving Average

Let me try to define the problem with a question: how to mutate variables defined in an outer scope inside an inner function? Let’s illustrate with an example: cumulative moving averages of real-time price points . In PyQuantLET we define a simple model to read ticks from an inbound endpoint, generate a cumulative moving average, […]