-
Notifications
You must be signed in to change notification settings - Fork 14
/
interfaces.go
51 lines (35 loc) · 945 Bytes
/
interfaces.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package ewa
import "time"
//Mover - interface for move
type Mover interface {
//Duration of the wave
Duration() time.Duration
//Len length of the price move of the wave
Len() float64
// Up - uptrend = true, downtrend = false
Up() bool
//Retrace - price level of retracement - Len()*float64
Retrace(float64) float64
//Begins - time when wave begins
Begins() time.Time
//Begins - time when wave ends
Ends() time.Time
//Starts - price where wave starts
Starts() float64
//Tops - price where wave tops
Tops() float64
//Slope - slope of the wave = Len() / Duration()
Slope() float64
}
//Waver - interface for wave object inside markup
type Waver interface {
Mover
//Next - ref to obj representing next wave following after this
NextWave() Waver
//Prev - ref to obj representing prev wave following after this
PrevWave() Waver
//Parent - ref to parent wave obj
ParentWave() Waver
//Has subwaves
Sub() bool
}