Commit Latest

This commit is contained in:
2025-06-28 23:49:24 -04:00
parent 0d8402b234
commit 6bf92a14f2
10 changed files with 293 additions and 1397 deletions

View File

@@ -107,7 +107,7 @@ namespace PortfolioManager.Renderers
Plotter.Plot.Axes.Left.TickGenerator = new ScottPlot.TickGenerators.NumericAutomatic()
{
LabelFormatter = (double value) => value.ToString("C") // "C" format specifier formats as currency
};
};
Plotter.Plot.Axes.DateTimeTicksBottom();
Plotter.Plot.Axes.AutoScale();
Plotter.Plot.XLabel("Date");
@@ -166,11 +166,11 @@ namespace PortfolioManager.Renderers
bollingerBands = BollingerBandGenerator.GenerateBollingerBands(prices);
CalculateOffsets();
GenerateBollingerBands();
GenerateLeastSquares();
GenerateInsiderTransactions();
GenerateStopLimits();
GenerateTradePoints();
GenerateZeroPoint(zeroPrice);
GenerateLeastSquares();
}
/// <summary>
@@ -335,7 +335,7 @@ namespace PortfolioManager.Renderers
sb.Append("@");
sb.Append(Utility.FormatCurrency(portfolioTrade.Price));
Image image = TextMarkerImageGenerator.GenerateImage(sb.ToString(), 150, 24, FontFactor.FontSize);
Image image = TextMarkerImageGenerator.GenerateImage(sb.ToString(), 130, 24, FontFactor.FontSize);
Coordinates coordinates = new Coordinates(portfolioTrade.TradeDate.ToOADate(), portfolioTrade.Price - offsets.Offset(OffsetDictionary.OffsetType.VerticalOffset5PC));
ImageMarker imageMarker = Plotter.Plot.Add.ImageMarker(coordinates, image);
}
@@ -455,7 +455,7 @@ namespace PortfolioManager.Renderers
Close = BollingerBandModel.Close(bollingerBands);
SMAN = BollingerBandModel.SMAN(bollingerBands);
Volume = BollingerBandModel.Volume(bollingerBands);
LeastSquares = BollingerBandModel.LeastSquares(bollingerBands);
// LeastSquares = BollingerBandModel.LeastSquares(bollingerBands);
Scatter scatter = default;
{
@@ -507,13 +507,6 @@ namespace PortfolioManager.Renderers
scatter.LineWidth = 2;
}
{
(DateTime[] dates, double[] values) = LeastSquares.ToXYData();
scatter = Plotter.Plot.Add.ScatterLine(dates, values, ScottPlot.Color.FromSKColor(SKColors.Orange));
scatter.LegendText = "LeastSquares";
scatter.LineWidth = 2;
}
{
(DateTime[] dates, double[] values) = SMAN.ToXYData();
scatter = Plotter.Plot.Add.ScatterLine(dates, values, ScottPlot.Color.FromSKColor(SKColors.Purple));