Mysterious invisible plots
Author: fritz
Creation Date: 3/2/2010 2:45 PM
profile picture

fritz

#1
I was just experimenting and tried to plot some data -- and it didn't show. After picking at it for a while, I noticed that adding or removing a plot might cause another plot to appear or disappear. Then I realized that, without changing the code AT ALL, I could cause plots to appear and disappear just by zooming in & out of the chart, or scrolling left & right.

When any plots have vanished, the chart legends (symbol name, plot names, etc) also sometimes disappear.

How can I avoid this??
profile picture

Eugene

#2
In other words, how can I avoid a mysterious error that can't be reproduced and can be caused by an error in unknown code? Sure, easy task :)
profile picture

fritz

#3
Well I can send you the code I'm using. I don't know if the same thing will happen if you run it on your system but it may be worth a try?
profile picture

Eugene

#4
OK, creating a support ticket is a way to send it. Please also describe if it happened in backtest or when streaming, and other relevant details. tia.
profile picture

Eugene

#5
For anyone who stumbles on it.

The reason for a chart plot mysteriously disappearing off the screen was that a DataSeries contained Double.NaN on some bar(s), ceasing to display these whole series until the bad bar of data is gone off the chart.
profile picture

fritz

#6
Aha!! I have a NaN in there somewhere!?

Thanks Eugene. Now I know what to look for.
profile picture

fritz

#7
I found the cause of the problem -- overshoot on a smoother taking some values negative, which then blows up in a Sqrt.Series.

But I can't find the right function to fix it cleanly. Is there a list somewhere of functions that operate on DataSeries?? Obviously there are + - / * << >>. The QuickRef writeup of DataSeries shows one method, Abs. I've also found Sqrt.Series. But I'm picking these up here and there by googling around. Isn't it documented somewhere? (And if it is, why is it so hard to find!?)
profile picture

Eugene

#8
"+ - / * << >>" are probably the most that you can do with data series. Also, you can apply any DataSeries that accepts a DataSeries as a parameter. This is what you see with Sqrt.Series - essentially, it's a wrapper applying Math.Sqrt to each bar in the loop. Same story with Log and Power. Likewise, you can build your own math functions.
profile picture

fritz

#9
OK, not terribly surprising I suppose, but...
* Why is there a DataSeries method for Abs but no other math operation? Why is Abs so special?
* Where can I find lists/source/etc for existing functions that accept DataSeries? I'd like to use the Math.Sqrt &etc wrappers as a starting point but I don't know where to find them.

I scraped the following list of .Series functions off the wiki but that seems like a convoluted way to find what functions are available. And this list doesn't include Sqrt, Log, or Power so obviously it's incomplete. Mostly it's indicators defined in TASC & elsewhere. I'm sure there must be a better way but I don't know what it is -- help?

==

AccelerationDeceleration.Series
AdaptiveLaguerre.Series
AdaptiveLookback.Series
ADX.Series
AroonDown.Series
ARSI.Series
ATR.Series
AveragePrice.Series
AwesomeOscillator.Series
BBandLower.Series
BBandUpper.Series
Beta.Series
CCI.Series
Choppiness.Series
CMO.Series
ConsecDaysDown.Series
CumDown.Series
CumUp.Series
Dat.Series
DIPlus.Series
DPO.Series
ElderSafeStopLong.Series
EMA.Series
Fill.Series
GannSwingOscillator.Series
HACO.Series
Highest.Series
HighestBar.Series
HTDCPhase.Series
HTInPhase.Series
HTPeriod.Series
HTSin.Series
InSyncIndex.Series
KeltnerATR_Lower.Series
LinearReg.Series
Lowest.Series
MACD.Series
MACDEx.Series
MAMA.Series
Momentum.Series
MoneyFlow.Series
NewMax.Series
NRTR_Percent.Series
NRTR_WATR.Series
PBandUpper.Series
Plo.Series
PsychologicalIndex.Series
ROC.Series
RSI.Series
ShiftedMA.Series
SMA.Series
StdDev.Series
StochD.Series
StochK.Series
TASCIndicators.ATRModified.Series
TEMA.Series
TII.Series
TSF.Series
VarianceRatio.Series
VHF.Series
VK_WH_Band.Series
VPT.Series
VWAP.Series
WMA.Series
profile picture

Eugene

#10
QUOTE:
* Why is there a DataSeries method for Abs but no other math operation?

For simplicity's sake? It did not make sense to overload the clean and organized product by throwing in every possible math operation. There are various .NET math libraries, both open and closed source, so motivated individuals can create their in-house math operation series:

Create an Indicator Library (PDF)

QUOTE:
Why is Abs so special?

I don't know exactly, but the designers should have a good reason for including this frequently used shortcut.

QUOTE:
a convoluted way to find what functions are available.

Or you could simply hit Ctrl-F11 to display the Indicators list. The Wiki does not necessarily should have every Community indicator described, sometimes it just points to some known website of the author (i.e. copyright), for example.
profile picture

fritz

#11
Thanks for the PDF link -- hadn't found that yet.

But I wasn't really looking to create an indicator per se. I was looking for operators on series, like >> or Abs -- which are defined in the object, documented, and easy to find -- and Sqrt, Log, and ??who knows what else??, which are not so easy to find.
profile picture

Eugene

#12
The Sqrt & Log series are not operators per se - they are custom indicators added by request, and belong to the Community.Indicators project. That's why you're not going to find information about them in the QuickRef or WealthScript Programming Guide.
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).