MCPcopy Create free account
hub / github.com/TraderOracle/ATAS / toKAMA

Class toKAMA

toKAMA.cs:12–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10 using Color = System.Drawing.Color;
11
12 [DisplayName("toKAMA")]
13 public class toKAMA : Indicator
14 {
15 #region Fields
16
17 private readonly List<decimal> _closeList = new();
18
19 private int _efficiencyRatioPeriod = 9;
20 private int _lastBar = -1;
21 private int _longPeriod = 109;
22 private int _shortPeriod = 2;
23
24 #endregion
25
26 #region Properties
27
28 [Display(ResourceType = typeof(Resources), Name = "Period", GroupName = "Common")]
29 [Range(1, 10000)]
30 public int EfficiencyRatioPeriod
31 {
32 get => _efficiencyRatioPeriod;
33 set
34 {
35 _efficiencyRatioPeriod = value;
36 RecalculateValues();
37 }
38 }
39
40 #endregion
41
42 #region ctor
43
44 public toKAMA()
45 : base(true)
46 {
47 DenyToChangePanel = true;
48 }
49
50 private Color AMD(int bar)
51 {
52 var candle = GetCandle(bar);
53 var diff = InstrumentInfo.TimeZone;
54 var time = candle.Time.AddHours(diff);
55
56 // Distribution
57 if (
58 (time.Hour == 9 && time.Minute >= 11 && time.Minute <= 47) ||
59 (time.Hour == 10 && time.Minute >= 26 && time.Minute <= 50) ||
60 (time.Hour == 11 && time.Minute >= 19 && time.Minute <= 37) ||
61 (time.Hour == 12 && time.Minute >= 07 && time.Minute <= 25)
62 )
63 {
64 return Color.Lime;
65 }
66
67 return Color.FromArgb(80, 244, 252, 0);
68 }
69

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected