Menu

#300 Running average (etc.?)

Backlog
open
nobody
feature (44)
4Urgent
2025-06-25
2024-05-29
Steve Keen
No

Sorry to whack this into the fray so close to the launch, but knowing the size of the stock market speculator audience, we should make it straightforward to be able to calculate moving averages (and sums and products).

This post gives a reasonable overview of how speculators using MA charts:

https://www.investopedia.com/articles/active-trading/052014/how-use-moving-average-buy-stocks.asp

This explains how it's done in Excel:

https://www.exceldemy.com/moving-average-excel-chart/

We're close with the capacity to determine a running sum or product for a specified number of periods. A similar function for an average would get us there, though there is one curly: if you're developing a seven day moving average, then for the first 6 entries you'd be dividing by 1,2,...6 rather than 7.

1 Attachments

Discussion

  • Steve Keen

    Steve Keen - 2024-05-29

    Rvl file mucking around with that csv file

     
  • High Performance Coder

    running sum Σ+ does exactly that. The window is the numerical argument given in the operation
    Note - it is not documented in the manual.
    I also would expect that if no dimension need be specified for vectors, but it didn't start working until I selected the dimension to sum over.

     
  • Steve Keen

    Steve Keen - 2024-05-29

    It doesn't quite though, for the reason I gave earlier that the first 6 entries in a 7 day MA should be divided by 1,...6 rather than 7--see attached. A moving average function which deliberately applied that "fix" would be better than trying to alter the running sum in the same way.

    It would also help if there was a second input so that the same number could be used for both the internal sum range and the divisor. But I am guessing this will raise the computational issue we discussed over another ticket.

     
  • Steve Keen

    Steve Keen - 2024-05-29

    OK, your process works, so we're fine for the first release. A running average tool would be great for the next release though.

     
  • High Performance Coder

    • Milestone: Pascal --> Backlog
     
  • High Performance Coder

    • Priority: 2Critical --> 3ReallyUrgent
     
  • High Performance Coder

    • Priority: 3ReallyUrgent --> 4Urgent
     
  • High Performance Coder

    Ticket moved from /p/minsky/ravel/574/

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.