From 56e750c4eee9788977db5ea55b4486a6d7c7f9d5 Mon Sep 17 00:00:00 2001 From: "Sean Kessler (Europa)" Date: Fri, 11 Jul 2025 09:08:44 -0400 Subject: [PATCH] commit latest --- .../Renderers/BollingerBandRenderer.cs | 52 +++++++------------ PortfolioManager/Renderers/FontFactor.cs | 7 +++ .../Renderers/OffsetDictionary.cs | 32 ++++++++++++ PortfolioManager/Renderers/SizeFactor.cs | 9 ++++ 4 files changed, 66 insertions(+), 34 deletions(-) create mode 100644 PortfolioManager/Renderers/FontFactor.cs create mode 100644 PortfolioManager/Renderers/OffsetDictionary.cs create mode 100644 PortfolioManager/Renderers/SizeFactor.cs diff --git a/PortfolioManager/Renderers/BollingerBandRenderer.cs b/PortfolioManager/Renderers/BollingerBandRenderer.cs index cfc844a..4b3568f 100644 --- a/PortfolioManager/Renderers/BollingerBandRenderer.cs +++ b/PortfolioManager/Renderers/BollingerBandRenderer.cs @@ -20,45 +20,29 @@ using MarketData.Numerical; namespace PortfolioManager.Renderers { - public static class SizeFactor + public class TextPlot { - public const float Small = 0.09375f; - public const float Normal = 0.125f; - public const float Large = 0.15625f; - } - public static class FontFactor - { - public const int FontSize = 11; - } - - public class OffsetDictionary - { - public enum OffsetType + public TextPlot() { - VerticalOffset15PC, VerticalOffset10PC, VerticalOffset7PC, VerticalOffset6P5PC, VerticalOffset6PC, VerticalOffset5PC, VerticalOffset3PC, VerticalOffset1PC, HorizontalOffset5PC, HorizontalOffset3PC, HorizontalOffset1PC, - MinBollingerDate, MaxBollingerDate, MinBollingerValue, MaxBollingerValue - }; - - private Dictionary offsetDictionary = new Dictionary(); - - public void Add(OffsetType offsetType, double value) - { - if (offsetDictionary.ContainsKey(offsetType)) - { - offsetDictionary[offsetType] = value; - } - else - { - offsetDictionary.Add(offsetType, value); - } } - - public double Offset(OffsetType offsetType) - { - return offsetDictionary[offsetType]; - } + Coordinates Coordinates { get; set; } + SKRect BoundingRect { get; set; } } + public class TextPlots : List + { + public TextPlots() + { + } + } + +// xp, yp = point + // for rect in rectangles: + // x1, y1, x2, y2 = rect + // if x1 < xp < x2 and y1 < yp < y2: + // return True + // return False + public class BollingerBandRenderer : ModelBase { diff --git a/PortfolioManager/Renderers/FontFactor.cs b/PortfolioManager/Renderers/FontFactor.cs new file mode 100644 index 0000000..cf60a7e --- /dev/null +++ b/PortfolioManager/Renderers/FontFactor.cs @@ -0,0 +1,7 @@ +namespace PortfolioManager.Renderers +{ + public static class FontFactor + { + public const int FontSize = 11; + } +} \ No newline at end of file diff --git a/PortfolioManager/Renderers/OffsetDictionary.cs b/PortfolioManager/Renderers/OffsetDictionary.cs new file mode 100644 index 0000000..37b8419 --- /dev/null +++ b/PortfolioManager/Renderers/OffsetDictionary.cs @@ -0,0 +1,32 @@ +using System.Collections.Generic; + +namespace PortfolioManager.Renderers +{ + public class OffsetDictionary + { + public enum OffsetType + { + VerticalOffset15PC, VerticalOffset10PC, VerticalOffset7PC, VerticalOffset6P5PC, VerticalOffset6PC, VerticalOffset5PC, VerticalOffset3PC, VerticalOffset1PC, HorizontalOffset5PC, HorizontalOffset3PC, HorizontalOffset1PC, + MinBollingerDate, MaxBollingerDate, MinBollingerValue, MaxBollingerValue + }; + + private Dictionary offsetDictionary = new Dictionary(); + + public void Add(OffsetType offsetType, double value) + { + if (offsetDictionary.ContainsKey(offsetType)) + { + offsetDictionary[offsetType] = value; + } + else + { + offsetDictionary.Add(offsetType, value); + } + } + + public double Offset(OffsetType offsetType) + { + return offsetDictionary[offsetType]; + } + } +} \ No newline at end of file diff --git a/PortfolioManager/Renderers/SizeFactor.cs b/PortfolioManager/Renderers/SizeFactor.cs new file mode 100644 index 0000000..03d4c08 --- /dev/null +++ b/PortfolioManager/Renderers/SizeFactor.cs @@ -0,0 +1,9 @@ +namespace PortfolioManager.Renderers +{ + public static class SizeFactor + { + public const float Small = 0.09375f; + public const float Normal = 0.125f; + public const float Large = 0.15625f; + } +} \ No newline at end of file