Skip to content

Dynamic scatterline (SMA, Bollinger) issue #2199

@xenedia

Description

@xenedia

Hi,

I used the scottplot on my own project. there was dynamic candlestick and SMA lines. dynamic candlesticks working good but SMA lines does not calculated and showed as expected. SMA lines working good on first load but when the new candlesticks was added SMA graphics are incorrect like below. I couldn't find a solution to fix this SMA or Bollinger graphics. could this be an issue or am i doing something wrong?

//definition
private List <OHLC> grafik;
private FinancePlot mcp;
private ScatterPlot scp20;


// first load
mcp = formsPlot1.Plot.AddCandlesticks(grafik.ToArray());
var (xs, ys) = mcp.GetSMA(20);
scp20 = formsPlot1.Plot.AddScatterLines(xs, ys, Color.LightCoral, 1);

// timer
grafik.Add(ohlc);
if (scp20 != null) formsPlot1.Plot.Remove(scp20);
var (xs, ys) = mcp.GetSMA(20);
scp20 = formsPlot1.Plot.AddScatterLines(xs, ys, Color.LightCoral, 1);
formsPlot1.Refresh();

image

System Details

  • ScottPlot Version: 4.1.58
  • Operating System: Windows 10
  • Application Type: WinForms
  • .NET Version: .NET 6.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    BUGunexpected behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions