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

Class Defibrillator

Defibrillator.cs:13–232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11 using Color = System.Drawing.Color;
12
13 [DisplayName("Defibrillator")]
14 public class Defibrillator : Indicator
15 {
16 private float fFontSize = 9;
17 private int _highBar;
18 private int _lowBar;
19 private decimal _highest = 0;
20 private decimal _lowest = 0;
21
22 private decimal A05 = 0;
23 private decimal A113 = 0;
24 private decimal A150 = 0;
25 private decimal A1618 = 0;
26 private decimal A200 = 0;
27 private decimal A213 = 0;
28 private decimal A250 = 0;
29 private decimal A2618 = 0;
30
31 private decimal nA113 = 0;
32 private decimal nA150 = 0;
33 private decimal nA1618 = 0;
34 private decimal nA200 = 0;
35 private decimal nA213 = 0;
36 private decimal nA250 = 0;
37 private decimal nA2618 = 0;
38
39 private String _highS = "Euro High";
40 private String _lowS = "Euro Low";
41
42 private bool bShowEuro = false;
43 private bool bShowOvernight = true;
44
45 [Display(Name = "Line", GroupName = "Misc")]
46 public PenSettings defibPen { get; set; } = new()
47 {
48 Color = DefaultColors.Red.Convert(),
49 Width = 1,
50 LineDashStyle = LineDashStyle.Dot
51 };
52
53 [Display(Name = "Font Size", GroupName = "Misc", Order = int.MaxValue)]
54 [Range(1, 90)]
55 public float TextFont
56 {
57 get => fFontSize; set { fFontSize = value; RecalculateValues(); }
58 }
59
60 [Display(GroupName = "Misc", Name = "Show Overnight Session", Description = "Show lines for overnight session (1700 - 800 CST")]
61 public bool Show_Overnight { get => bShowOvernight; set { bShowOvernight = value; RecalculateValues(); } }
62
63 [Display(GroupName = "Misc", Name = "Show Euro Session", Description = "Show lines for Euro session (first hour, 2am - 3am CST. Credit: FighterOfEvil on Discord")]
64 public bool Show_Euro { get => bShowEuro; set { bShowEuro = value; RecalculateValues(); } }
65
66 private void DrawString(RenderContext context, string renderText, int yPrice, Color color)
67 {
68 var textSize = context.MeasureString(renderText, new RenderFont("Arial", fFontSize));
69 context.DrawString(renderText, new RenderFont("Arial", fFontSize), color, Container.Region.Right - textSize.Width - 5, yPrice - textSize.Height);
70 }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected