From 029f8a2d87749f6f0c79b013f4f0c9db001ac965 Mon Sep 17 00:00:00 2001 From: Sean Date: Sun, 29 Jun 2025 08:17:56 -0400 Subject: [PATCH 1/2] Commit Latest --- PortfolioManager/Renderers/BollingerBandRenderer.cs | 2 +- PortfolioManager/UIUtils/TextMarkerImageGenerator.cs | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/PortfolioManager/Renderers/BollingerBandRenderer.cs b/PortfolioManager/Renderers/BollingerBandRenderer.cs index a0c7bd9..a057f2a 100644 --- a/PortfolioManager/Renderers/BollingerBandRenderer.cs +++ b/PortfolioManager/Renderers/BollingerBandRenderer.cs @@ -214,7 +214,7 @@ namespace PortfolioManager.Renderers double parityOffsetPercent = (latestPrice.Close - zeroPrice.Close) / zeroPrice.Close; sb.Append("(").Append(parityOffsetPercent < 0 ? "" : "+").Append(Utility.FormatPercent(parityOffsetPercent)).Append(")"); image = TextMarkerImageGenerator.GenerateImage(sb.ToString(), 130, 24, FontFactor.FontSize); - coordinates = new Coordinates(dates[0].ToOADate() - offsets.Offset(OffsetDictionary.OffsetType.HorizontalOffset3PC), values[0] - offsets.Offset(OffsetDictionary.OffsetType.VerticalOffset5PC)); + coordinates = new Coordinates(dates[0].ToOADate() - offsets.Offset(OffsetDictionary.OffsetType.HorizontalOffset1PC), values[0] - offsets.Offset(OffsetDictionary.OffsetType.VerticalOffset5PC)); imageMarker = Plotter.Plot.Add.ImageMarker(coordinates, image); } diff --git a/PortfolioManager/UIUtils/TextMarkerImageGenerator.cs b/PortfolioManager/UIUtils/TextMarkerImageGenerator.cs index 1206708..5574a77 100644 --- a/PortfolioManager/UIUtils/TextMarkerImageGenerator.cs +++ b/PortfolioManager/UIUtils/TextMarkerImageGenerator.cs @@ -20,7 +20,6 @@ public static class TextMarkerImageGenerator imageHelper.DrawLine(SKColors.Black,1, new SKPoint(0,height-1), new SKPoint(width-1,height-1)); // top left to right imageHelper.DrawLine(SKColors.Black,1, new SKPoint(0,height-1), new SKPoint(0,0)); // left hand side top to bottom imageHelper.DrawText(text, new SKPoint(width / 2, height-8), SKColors.Black, align, font); - using MemoryStream memoryStream = new MemoryStream(); imageHelper.ToStream().CopyTo(memoryStream); return new ScottPlot.Image(memoryStream.ToArray()); @@ -41,6 +40,5 @@ public static class TextMarkerImageGenerator imageHelper.Fill(color); Avalonia.Media.Imaging.Bitmap avBitmap = new Avalonia.Media.Imaging.Bitmap(imageHelper.ToStream()); return avBitmap; - // avBitmap.Save("c:\\3\\mybitmap.jpg"); } } } From 3215fd04d9f3a70ce7895eb477cd1297210b1c0e Mon Sep 17 00:00:00 2001 From: Sean Date: Sun, 29 Jun 2025 08:52:11 -0400 Subject: [PATCH 2/2] Commit Latest --- .../Renderers/BollingerBandRenderer.cs | 1 - .../ViewModels/BollingerBandViewModel.cs | 18 +++++------------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/PortfolioManager/Renderers/BollingerBandRenderer.cs b/PortfolioManager/Renderers/BollingerBandRenderer.cs index c8cec53..5e5974b 100644 --- a/PortfolioManager/Renderers/BollingerBandRenderer.cs +++ b/PortfolioManager/Renderers/BollingerBandRenderer.cs @@ -455,7 +455,6 @@ namespace PortfolioManager.Renderers Close = BollingerBandModel.Close(bollingerBands); SMAN = BollingerBandModel.SMAN(bollingerBands); Volume = BollingerBandModel.Volume(bollingerBands); - // LeastSquares = BollingerBandModel.LeastSquares(bollingerBands); Scatter scatter = default; { diff --git a/PortfolioManager/ViewModels/BollingerBandViewModel.cs b/PortfolioManager/ViewModels/BollingerBandViewModel.cs index 5fdbf2d..f725713 100644 --- a/PortfolioManager/ViewModels/BollingerBandViewModel.cs +++ b/PortfolioManager/ViewModels/BollingerBandViewModel.cs @@ -41,21 +41,12 @@ namespace PortfolioManager.ViewModels PropertyChanged += OnViewModelPropertyChanged; Initialize(); } - - // public BollingerBandViewModel(bool loadedFromParams) - // { - // DisplayName = "Bollinger"; - // OnPlotterLoadedEventHandler += PlotterLoadedEvent; - // PropertyChanged += OnViewModelPropertyChanged; - // Initialize(); - // base.OnPropertyChanged("SelectedSymbol"); - // } protected override void OnDispose() - { - MDTrace.WriteLine(LogLevel.DEBUG, $"Dispose BollingerBandViewModel"); - base.OnDispose(); - } + { + MDTrace.WriteLine(LogLevel.DEBUG, $"Dispose BollingerBandViewModel"); + base.OnDispose(); + } public override String Title { @@ -229,6 +220,7 @@ namespace PortfolioManager.ViewModels { base.OnPropertyChanged("SelectedWatchList"); base.OnPropertyChanged("SelectedSymbol"); + base.OnPropertyChanged("Title"); }); } catch (Exception exception)