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

Class TripleStochastic

TripleStochastic.cs:13–204  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11 using Pen = System.Drawing.Pen;
12
13 [DisplayName("TripleStochastic")]
14 public class TripleStochastic : Indicator
15 {
16 #region Fields
17
18 private struct days
19 {
20 public int bar;
21 public string label;
22 public decimal price1;
23 public decimal price2;
24 public Color c;
25 }
26 private List<days> lsDays = new List<days>();
27 private int iBarHigh = 90;
28 private int iBarWidth = 13;
29
30 private readonly Highest _highest9 = new() { Period = 9 };
31 private readonly Lowest _lowest9 = new() { Period = 9 };
32 private readonly Highest _highest14 = new() { Period = 14 };
33 private readonly Lowest _lowest14 = new() { Period = 14 };
34 private readonly Highest _highest40 = new() { Period = 30 };
35 private readonly Lowest _lowest40 = new() { Period = 30 };
36 private readonly Highest _highest60 = new() { Period = 60 };
37 private readonly Lowest _lowest60 = new() { Period = 60 };
38
39 private readonly SMA _ksma9 = new() { Period = 1 };
40 private readonly SMA _sma9 = new() { Period = 3 };
41 private readonly SMA _ksma14 = new() { Period = 1 };
42 private readonly SMA _sma14 = new() { Period = 3 };
43 private readonly SMA _ksma40 = new() { Period = 1 };
44 private readonly SMA _sma40 = new() { Period = 4 };
45 private readonly SMA _ksma60 = new() { Period = 1 };
46 private readonly SMA _sma60 = new() { Period = 10 };
47
48 private readonly ValueDataSeries _k1 = new("DId1", "%D14");
49 private readonly ValueDataSeries _k2 = new("DId2", "%D40");
50 private readonly ValueDataSeries _k3 = new("DId3", "%D60");
51 private readonly ValueDataSeries _k4 = new("DId4", "%D60");
52
53 #endregion
54
55 #region Properties
56
57 [Display(GroupName = "Settings", Name = "Highlight Height")]
58 public int BarHigh { get => iBarHigh; set { iBarHigh = value; RecalculateValues(); } }
59
60 [Display(GroupName = "Settings", Name = "Highlight Width")]
61 public int BarWidth { get => iBarWidth; set { iBarWidth = value; RecalculateValues(); } }
62
63 public LineSeries UpLine { get; set; } = new("UpLine", "Up")
64 { Color = Color.White.Convert(), LineDashStyle = LineDashStyle.Solid, Value = 89, Width = 1 };
65
66 public LineSeries DownLine { get; set; } = new("DownLine", "Down")
67 { Color = Color.White.Convert(), LineDashStyle = LineDashStyle.Solid, Value = 11, Width = 1 };
68
69
70 #endregion

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected