Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,19 @@
|
|||
Procedure.d SMA(Number, Period=0)
|
||||
Static P
|
||||
Static NewList L()
|
||||
Protected Sum=0
|
||||
If Period<>0
|
||||
P=Period
|
||||
EndIf
|
||||
LastElement(L())
|
||||
AddElement(L())
|
||||
L()=Number
|
||||
While ListSize(L())>P
|
||||
FirstElement(L())
|
||||
DeleteElement(L(),1)
|
||||
Wend
|
||||
ForEach L()
|
||||
sum+L()
|
||||
Next
|
||||
ProcedureReturn sum/ListSize(L())
|
||||
EndProcedure
|
||||
Loading…
Add table
Add a link
Reference in a new issue