Divide, Subtract, Add Series with Named Series
Author: novendeh
Creation Date: 6/28/2011 9:25 PM
profile picture

novendeh

#1
In WL4 I could use DivideSeries(s1,s2) etc. but can not seem to figure out how to do it in WL6. For example, here is beginning portion of code, which compiles fine but has a problem when running. Suggestions?
CODE:
Please log in to see this code.


The last line causes the problem when running. If this is not included, it appears to run fine.
profile picture

Eugene

#2
I renamed the somewhat misleading title "Divide, Subtract, Add Series in .NET" to something more appropriate:

"Divide, Subtract, Add Series with Named Series in 6.2"

Because it's not a ".NET" thing, it's a known bug. For the open issues list and a workaround, please refer to the Wiki:

Open Issues >
Math operations (*,-,+ etc.) throw exception on Named DataSeries
profile picture

novendeh

#3
Eugene - doesn't quite work. Compiles fine but I get a runtime error. Here is revised start of code. Thanks.
CODE:
Please log in to see this code.
profile picture

Eugene

#4
Mistake:
CODE:
Please log in to see this code.

Strategy parameter descriptions should be unique.
QUOTE:
a runtime error

This indicates that for some reason, your FindNamedSeries could not be found. First are foremost, check the case: the series should be defined in your source exactly as "MTI" and not "Mti" or "mti" (case sensitive).

If you're absolutely sure you've made no error, let's collect more details in a new ticket:

* Does the issue depend on data loading range? Compare with All Data, Number of Bars, Most recent, Date range
* Data provider (if WatchList provider, the underlying data provider(s) too)
* The data file(s)
* DataSet definition files (XML)
profile picture

novendeh

#5
Eugene - I'm beginning to believe problem is in data. It is a csv file created by myself. In WL4, there were ascii characters in the first to lines, but when I created it in WL6.2, I wasn't sure I needed them and didn't know how to do it. The first three lines of my data set are:

12/28/1999,22.75,1.38,23.90,23.30,0.00,,,,,,
12/29/1999,22.75,1.53,26.30,22.00,0.00,,,,,,
12/30/1999,22.77,1.47,26.90,21.30,0.00,,,,,,

and many more similar lines follow.

Also, I don't know how to get DataSet definition files - please let me know and I can send it to you, if needed.

With regard to mistake, this portion was created by the Wizard and converted to code. It occurs when one use the ma crossover exit and entry rules. I've seen this before and code runs OK, but gets a little confusion with optimization. I don't know if this is something that should be changed in a future update.

Comments?

Thanks.
profile picture

Eugene

#6
Let's first comment on this invalid data:
CODE:
Please log in to see this code.

In short, ",,,,," is too ambiguous to be accepted by the ASCII provider. In the forum thread below, I outlined the problem and possible ways of fixing it:

ASCII provider import data problem

But my question still remains: have you checked the named series case? If you're not sure, this snippet will help you visualize it:
CODE:
Please log in to see this code.
profile picture

novendeh

#7
Eugene - Thanks for the script - I wouldn't have known how to do this easily. I ran the script and things look correct - I get in debug window the following

CODE:
Please log in to see this code.


This resolved the problem. The problem was I named parameters Buys and Sells and used in my script BUY and Sell.

Also, it runs fine with or without the commas removed.

I appreciate all your help.
profile picture

Eugene

#8
Good to know it worked.
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).