Back to Community
Closing price factor

I need to compare the closing price with the moving average. Is there a factor similar to SimpleMovingAverage(inputs=[USEquityPricing.close], window_length=10), but providing just the closing price.

3 responses

USEquityPricing.close.latest provides the latest close price. Is that what you’re looking for?

Thank you. I think so. Are there any parameters. Can ´t find it in API reference.

You're just retrieving the last close price in this case, so I don't know if there would be any parameters. If you search the API reference page for '.latest' you might find something that you're looking for though?

You could also create your own CustomFactor with your own parameters, if for example you wanted to get the close price from 3 days ago.