DataSeries do not have equal number of values for mathematical operation
Author: kyokushin
Creation Date: 10/18/2015 6:40 AM
profile picture

kyokushin

#1
I keep getting the error "DataSeries do not have equal number of values for mathematical operation" with some symbols when executing my strategy. I suppose this is due to the data not being synchronized correctly. What am I doing wrong?

CODE:
Please log in to see this code.
profile picture

Eugene

#2
No problem with that code, it's about the data. Don't hesitate to visit the Wiki (and also search the forum). This error has been documented there years ago:

Wiki:

Errors section > Strategy > "DataSeries do not have equal number of values for mathematical operation"

Forum:

Error Message: Data Series do not have equal number of values for mathematical operation
ASCII DataSet error: DataSeries do not have equal number of values for mathematical operation
Error: DataSeries do not have equal number of values
DataSeries do not have equal number of values for mathematical operation
profile picture

kyokushin

#3
I did that already before posting but cannot not find a solution for my problem. I'm getting the error with these symbols: KHC, LILA, LILAK. They are actual symbols and I'm working with end of day data so update or interval problems should not be it.

profile picture

Eugene

#4
Still, please double check all of your data. Including but NOT limited to those symbols. Like Cone said in this thread:

QUOTE:
It's very common for symbols not to have the same number of bars - missing bars due to zero volume, different start (IPO) or end (bankrupcy) dates, etc.
profile picture

Eugene

#5
P.S. You might want to use the Data Tool to verify your data and also wipe out symbols that stopped updating.
profile picture

kyokushin

#6
Are symbols with these error messages generally excluded from trading signals?
profile picture

Eugene

#7
What is your experience? Why are you asking?
profile picture

kyokushin

#8
I ran both tools. No problem with my data was found. Only LILAK came up with a 5 bars gap at 20150701.

Maybe there was just no trading signal for these 3 symbols so far because I found that they are new since beginning of July 2015. I was just asking because I want to be sure about the consequences of these error messages.

But the synchronizing in my code is done right?
profile picture

Eugene

#9
One of your DataSeries is shifted 100 bars to the right and some of the symbols do not have even 100 bars of history (only 90 daily bars since July up until now). I think you should troubleshoot in this direction.
profile picture

Eugene

#10
Confirmed. This line is the culprit for LILAK:

CODE:
Please log in to see this code.


Neither you could do the same operation on LILAK's .Low, naturally.
profile picture

kyokushin

#11
Just to be sure that I understand you correctly. Since LILAK doesn't have 100 bars of history this operation causes an error.
profile picture

Eugene

#12
Right.