-
Notifications
You must be signed in to change notification settings - Fork 981
Closed
Labels
Description
This very negatively impacts the cookbook recipes
var plt = new ScottPlot.Plot(600, 400);
// OHLCs are open, high, low, and closing prices for a time range.
OHLC[] prices = DataGen.RandomStockPrices(null, 60);
plt.AddCandlesticks(prices);
plt.SaveFig("finance_quickstart.png");The problem is that start is never mutated, as recently broken by 91ebf73
ScottPlot/src/ScottPlot4/ScottPlot/DataGen.cs
Lines 504 to 520 in dabb9ce
| OHLC[] ohlcs = new OHLC[pointCount]; | |
| DateTime start = new(1985, 09, 24); | |
| for (int i = 0; i < ohlcs.Length; i++) | |
| { | |
| double basePrice = basePrices[i]; | |
| double open = rand.NextDouble() * 10 + 50; | |
| double close = rand.NextDouble() * 10 + 50; | |
| double high = Math.Max(open, close) + rand.NextDouble() * 10; | |
| double low = Math.Min(open, close) - rand.NextDouble() * 10; | |
| open += basePrice; | |
| close += basePrice; | |
| high += basePrice; | |
| low += basePrice; | |
| ohlcs[i] = new OHLC(open, high, low, close, start, TimeSpan.FromDays(1)); | |
| } |
Reactions are currently unavailable
