Pages:
Actions
  • #1 by acollin on 17 Sep 2019
  • Hi All,

    Apologies if this is a repeat question which I've not found the answer to.

    I was wondering what the best way would be to calculate the moving average of the variables back_amount and lay_amount, or any variable for that matter.

    I normally have my refresh rate set to 1 second and looking for a moving average over say the last 60 seconds.

    Thanks,
    Andy
  • #2 by acollin on 19 Sep 2019
  • I've not tried it, but think I might have a solution in mind for this.

    I'm sure it's not the most efficient way, so please let me know if there's any better suggestions.

    Create a trigger set to run every refresh and create several variables, maybe 60 in my case, and one additional variable for the average. 

    Variable1 = Variable2
    Variable2 = Variable3
    Variable3 = Variable4
    Variable4  = Variable5
    So on... 
    Variable60 = back_amount
    Average_variable = (Variable1 + Variable2 +... + Variable60) / 60

    Maybe I'm missing something but I'll give it a try. 
Pages:
Actions