- ago
Hello community, I have a double variable, new value updated every month. What function can I use to convert that as a time series for plotting or is there a function to plot a double variable in the chart? Much appreciated!
0
200
Solved
7 Replies

Reply

Bookmark

Sort
Glitch8
 ( 12.72% )
- ago
#1
How is your data stored right now? There are several options ranging from doing it in C# Code or creating/commissioning a custom indicator. Ultimately you’ll create a TimeSeries instance, populate it with your data, use TimeSeriesSynchronizer to sync it to the chart, then PlotTimeSeries to plot it.
0
- ago
#2
Thank you for your insight, right now I have created a double variable, when month changes, I try to store the open of the first bar of month, to compare the % changes at a later time point (e.g. 15th day of month)

So I wanna plot to make sure I have the right number stored for computation. Happy for other suggestions if there is a simpler way to achieve that, thanks!!
0
- ago
#3
If you're plotting your double variable over time, it might make sense to convert it to a TimeSeries and plot it with PlotTimeSeries. You're only plotting one point a month? Hmm.

If you're not plotting it over time, then I would use ScottPlot instead, which is installed with WL8. https://scottplot.net/cookbook/4.1/ ScottPlot is pretty easy to use and very flexible and can generate scatter plots. If you have a question particular to ScottPlot, start a new topic.
0
- ago
#4
QUOTE:
I have created a double variable, when month changes, I try to store the open of the first bar of month, to compare the % changes at a later time point (e.g. 15th day of month)
Just to clarify, you're plotting only two points per month?

Well, in that case, you might look at doing it with ScottPlot as a scatter plot. Take a look at the ScottPlot link above for scatter plots. Setting up a time axis will be a little more complicated than with WL, but it can be done. If you're using ScottPlot, I would buy the extension https://www.wealth-lab.com/extension/detail/finantic.InteractiveGraphics for display; otherwise, you can write out the plot as a *.png file.

---
Another option would be to use DrawDot on an existing WL Chart. But that only works if you don't want to connect lines between the dots.
0
- ago
#5
Thank you that looks interesting! I would image let say if I stored value 10 by start of month, when i plot that series it is showing 10 across the month until the next month when new value is stored. Is there any function which i can convert that variable as timeseries or I have to change my way of storing?
0
- ago
#6
QUOTE:
I would image let say if I stored value 10 by start of month, when i plot that series it is showing 10 across the month until the next month when new value is stored.
I believe TimeSeriesSynchronizer(...) backfills that way if you want to go that route with WL Charting. Have you looked at those docs?

If you employ ScottPlot, you can use cubic splines to interpolate between the plotted points. https://scottplot.net/cookbook/4.1/#miscellaneous But that might be an overkill.
0
Best Answer
- ago
#7
Thank you for the ideas, let me test that out, thanks a lot!
1

Reply

Bookmark

Sort