Data update
This commit is contained in:
parent
ed705008a8
commit
0df55f9f24
2196 changed files with 32999 additions and 3075 deletions
|
|
@ -20,10 +20,10 @@ class SMA
|
|||
var count := theList.Length;
|
||||
count =>
|
||||
0 { ^0.0r }
|
||||
: {
|
||||
! {
|
||||
if (count > thePeriod)
|
||||
{
|
||||
theList.removeAt:0;
|
||||
theList.removeAt(0);
|
||||
|
||||
count := thePeriod
|
||||
};
|
||||
|
|
@ -35,19 +35,21 @@ class SMA
|
|||
}
|
||||
}
|
||||
|
||||
// --- Program ---
|
||||
|
||||
public program()
|
||||
{
|
||||
var SMA3 := SMA.new:3;
|
||||
var SMA5 := SMA.new:5;
|
||||
var SMA3 := SMA.new(3);
|
||||
var SMA5 := SMA.new(5);
|
||||
|
||||
for (int i := 1, i <= 5, i += 1) {
|
||||
console.printPaddingRight(30, "sma3 + ", i, " = ", SMA3.append:i);
|
||||
console.printLine("sma5 + ", i, " = ", SMA5.append:i)
|
||||
for (int i := 1; i <= 5; i += 1) {
|
||||
console.printPaddingRight(30, "sma3 + ", i, " = ", SMA3.append(i));
|
||||
console.printLine("sma5 + ", i, " = ", SMA5.append(i))
|
||||
};
|
||||
|
||||
for (int i := 5, i >= 1, i -= 1) {
|
||||
console.printPaddingRight(30, "sma3 + ", i, " = ", SMA3.append:i);
|
||||
console.printLine("sma5 + ", i, " = ", SMA5.append:i)
|
||||
for (int i := 5; i >= 1; i -= 1) {
|
||||
console.printPaddingRight(30, "sma3 + ", i, " = ", SMA3.append(i));
|
||||
console.printLine("sma5 + ", i, " = ", SMA5.append(i))
|
||||
};
|
||||
|
||||
console.readChar()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue