langs a-z
This commit is contained in:
parent
db842d013d
commit
d066446780
11389 changed files with 98361 additions and 1020 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