Indicator with fewer points than the DataSeries
Author: pejacobson
Creation Date: 11/30/2018 8:01 PM
profile picture

pejacobson

#1
I want to plot an indicator, but my indicator does not have a point at each and every point of the underlying data series. There may be anywhere from one to several periods between indicator points.

Is there a way I can plot such a series, or does Wealth Lab require that any series you plot have the same number of data points as the underlying series?
profile picture

Eugene

#2
Wealth-Lab must synchronize your indicator to plot it. Quoting the WealthScript Programming Guide > DataSeries > Characteristics of DataSeries:

QUOTE:
All DataSeries contain the same number of values as bars in the chart.


As a workaround, you might want to specify Color.Transparent in SetSeriesBarColor to hide the items that you don't want to see. As the QuickRef example shows (F11 key with WLP open, then start typing in SetSeries...), this overlay is added after plotting the DataSeries as a cosmetic method.
profile picture

pejacobson

#3
Thank you for that answer.

Would it also be possible to pad some places with zeroes or negative values, and WealthLab would just ignore those when plotting?
profile picture

Eugene

#4
For indicators, a zero or negative value may be perfectly valid and thus will not be ignored by Wealth-Lab. Also, assigning Double.NaN (not a number) will cause indicator display issues.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).