NeuroLab and external/named DataSeries
Author: streak
Creation Date: 8/18/2012 2:00 AM
profile picture

streak

#1
Is NL able to accept weekly external series (when training daily data)? (I'm getting an "index was out of range" err)

Is there an issue with .FindNamedSeries in NL? (I can get a "Compile complete" with assigning a FindNamedSeries, however, it will not compile when attempting to add that series to another).

Thanks

profile picture

Eugene

#2
1 - Example?

2 - Example?
profile picture

streak

#3
Topology auto'd to 6 neuron Input layer with 4 hidden neurons. Training rate & momentum left as is.

Output script at this stage is basically as per default although set forward bars from 5 to 8

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

Cone

#4
CODE:
Please log in to see this code.
Does that occur when checking the input script? If so, it's probably okay. Just try to load the training data, and if no error there I suspect it will work just fine.
profile picture

streak

#5

Thanks Robert

The script above compiles as is. Then when applying the training set an err is given: "Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index". Regards the "non-negative" part of the err msg I commented out the dataseries NetFund and NetComm just in case it didn't like negative series values, but there was no difference.

The initial script I'd hoped to kick off with had the dataseries TotalNonn assigned as:-
CODE:
Please log in to see this code.

ie not assigned above as DataSeries TotalNonn = SpecLong * 2;

When attempting to compile this, it throws both a msg: "Input Script Contained Error(s)." and "Runtime error: reference not set to an instance of an object. at NL.ScriptExecutor(WealthScript wealthScript)". Attempting to persist with this a msg is given: "Input Script Contained Error(s)." and when clicking Begin Training an unhandled exception is thrown.


profile picture

Cone

#6
Oh gosh, what happens if you synchronize that weekly data? ;)

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

streak

#7

With just;
CODE:
Please log in to see this code.

There is no error. However,
CODE:
Please log in to see this code.
throws the runtime error (as per below).

Further; without Synchronize() and with commenting out the statement;
CODE:
Please log in to see this code.
a Compile complete is given.

Doing the same with Synchronize() implemented the err is given; "Runtime Error: Index was out of range. Must be non-negative and less than the size of the collection. at NL.ScriptExecutor.Executor(WealthScript wealthScript)"

Is adding the series a problem? (attempting to assign values bar by bar also fails). It seems strange that FindNamedSeries() does not throw an err, but adding series does while negating series does not throw an err, like;
QUOTE:
DataSeries TotalNonn = (FundLong - FundLong);
then if Synchronize() is added next, like;
QUOTE:
TotalNonn = Synchronize(TotalNonn);
the Runtime Error as above is thrown.

Thanks
profile picture

Eugene

#8
If I disable the "WLjonmac.futures" thing, use Yahoo data for the external symbol, and uncomment everything, then it starts working right off the bat w/o having to add one more Synchronize call. Very well could be something about the data that's causing it.
profile picture

streak

#9
Thanks Eugene

The data works fine in a strategy page, and has been for quite some time. However, commenting out my class futures1 and replacing the symbol string with some fixed characters allows the script to Compile complete.

This class I have been using for quite along time in strategy scripts and it works without error in these. Is there a problem that misc libraries cannot be used with Neuro-Lab?
profile picture

streak

#10

Just hard wired the method into the Input Script...
CODE:
Please log in to see this code.


However, the same errs occur until the following statement is commented out;
CODE:
Please log in to see this code.
profile picture

Eugene

#11
QUOTE:
Is there a problem that misc libraries cannot be used with Neuro-Lab?

Honestly, I can't imagine this being the case. There's no difference between say Community.Components and WLjonmac.futures in this aspect (I double checked).
QUOTE:
However, the same errs occur until the following statement is commented out;

Does it still occur after replacing your symbols with Dow 30 symbols (Yahoo data)?
profile picture

streak

#12

Eugene
I'm not understanding this change to Dow30 yahoo data, as I'm only at the entering/compiling Input Script stage ie not at applying a training set etc.

But to follow through; am I correct in assuming that your suggesting using the Dow30 data as the external script data?
profile picture

Eugene

#13
Jon,

I understand your point but as mentioned above, compiling the NL input script (and subsequent steps) pointing at an existing Y! DataSet and w/o references works for me.

Therefore my suggestion was to take your library and the COT data out of the equation for testing purposes.
profile picture

streak

#14

Eugene

yes, that works.... either of the following compile;

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

streak

#15

... but the last script errs when applying the training set, which is no help.

I went through all the external cot data and cannot find anything anomalous, except for a few zeros which I changed to one's.

When 'hard coding' the external cot symbols into the method GetExternalSymbol() each and every one compiles and the training set applies ok, such as;
CODE:
Please log in to see this code.


I cannot understand that there is an issue with this here but not in a 'normal' script. What is it that Neuro-Lab is expecting different from GetExternalSymbol() ?

Thanks
profile picture

Eugene

#16
Errors out, how exactly?

Maybe the DataSet is missing a COTsym( Bars.Symbol ) + "_rel"?
profile picture

streak

#17

The symbol parameter for GetExternalSymbol() fails to accept (and compile) the string COTsymb before the script is directed at the dataset. Or, is it that the script cannot implement the method COTsym() to assign the string COTsymb?

But yes dataset nn_releaseCOT_F does have one extra symbol and one symbol less than the dataset I am hoping to have nn train on. I made up this dataset from another so that it has an equal number of bars and replaced zero values in appropriate fields to 1.

QUOTE:
Errors out, how exactly?
when replacing "AD_rel" with COTsymb the err is: Runtime error: Object reference not set to an instance of an object. at NL.ScriptExecutor.Execute(WealthScript wealthScript)

Thanks
profile picture

Eugene

#18
I couldn't reproduce your issue. After fixing a syntax error in COTsymb above, the input script compiles.
profile picture

streak

#19

What is the
QUOTE:
syntax error in COTsymb
?

Where to from here? Am I able to forward you the script and some data files?

Thanks
profile picture

Eugene

#20
COTsymb is missing an ending ":"

Please do not forward files to me - troubleshooting custom scripts isn't covered by our support policy.

The best you could do is to create a brief, reproducible test case using Yahoo! data and no references to 3rd party libraries.
profile picture

streak

#21
That is a typo. Interesting in that I just checked the .txt I copied it over from and the colon is there, as it is in the script. The library has worked flawlessly for months as I made mention of 8/20/2012 1:44 AM. The method is the same just not in the library. To test; just copied the method out of my Neuro-Lab script into a new strategy script - assigning it to a string - then to PrintDebug() and ran it over every symbol in 3 datasets. These are the results;
CODE:
Please log in to see this code.


I don't believe there is an issue with the method.

Further, I have ascii data which I'd have guessed is supported.

Thanks
Jon
profile picture

Eugene

#22
What has ASCII data to do with a NL input script (rhetorical question)?

I understand that troubleshooting custom scripts can get tedious at times but it's not my duty. So far I was unable to reproduce anything you reported here. If you want us to get going further, please set up a brief, reproducible test case excluding all external routines (even believed to be working for months) pointing at a NL/WL deficiency.
profile picture

streak

#23
Awhile ago there was an issue which did end up being associated with ascii (Wealth-Lab Developer/Pro » Index Manager DataSet isn't up-to-date after updating). I do not know what ascii may have to do with a NL input script, and I am not pointing at a NL/WL deficiency.

I simply wish to move ahead with NL.

I really do not understand Eugene when above you said
QUOTE:
...do not forward files to me - troubleshooting custom scripts isn't covered...
, but now say
QUOTE:
please set up a brief, reproducible test case
. Honestly, I'm lost. Do you mean for me to set it up and try to debug my script, or are you saying to forward such a test case through to this thread? If so, how can that happen without the custom ascii (external) data crucial to the concept/script?

Also, regarding "...excluding all external routines...", are you suggesting to "unpackage" the method() for acquiring the appropriate external symbol into the Execute() method, or by "external" do you simply mean to exclude libraries?

Thanks
profile picture

Eugene

#24
Jon,

Testing procedure:

So I went to CommitmentsOfTraders site and downloaded their ASCII zip file containing all sort of data: positive, zeroes, negative. Picked up an arbitrary file, renamed it to AAPL.CSV, created a new ASCII DataSet (selecting Weekly) with this file, adding one custom field. Having stripped out all your specific code (insignificant for this test), I tried several versions of the TotalNonn DataSeries. I successfully compiled this input script in NL (except for a cosmetic error, see Conclusions below). Then for Training Data, I selected AAPL in one of my Yahoo! DataSets, successfully trained and evaluated the network.

CODE:
Please log in to see this code.


Conclusions:

1. An "Index out of range" is undoubtedly an error in your library/code/whatever: COTsym simply couldn't find a symbol in your Training DataSet. I'm sure you'll find something after careful debugging of your routines/libraries.

2. Including a FindNamedSeries call in the Input Script provokes an "Object reference not set to an instance of an object" runtime error. However, this is a cosmetic error because it does not affect further correct training/evaluation of NL.

Thanks.
profile picture

streak

#25
Eugene

Thanks for your follow through and pursuit of my inability to get this
happening.

Incidentally, I've still been without success in not using a library or method
outside of Execute(). Also you suggested debugging - but that is exactly
what I cannot do in Neuro-Lab?

Please try this in your data and script :-

- Change the name of your 'COT' data to "AAx_rel".
- Duplicate AAx renaming it to "BBx_rel".
- Copy out two of your yahoo(?) symbols to a new dataset to train the script
with (not knowing the 2 symbols I'll reference them here as Sym1 and Sym2).
Make sure the actual symbols are not named like the COT data.
- Ideally your ascii data will be formatted :-
.txt
weekly
yyyyMMdd
comma delimited
period decimal sep
inc headerline
basic fields; DOHLCV
plus 11 custom fields.

(replace Sym1 & Sym2 below with your two Yahoo(?) symbols)

If the following compiles and can train your DataSet (not individual
symbols) would you kindly try the same on a similar ascii DataSet, please?

CODE:
Please log in to see this code.


Hopefully this works for you. And if it does I'll look for a cliff

Appreciate your help
profile picture

Eugene

#26
I've come with bad news Jon.

Did two tests as suggested, using Yahoo and exported ASCII DataSets, precisely following your symbol naming conventions, now in multi-symbol backtest mode. My ASCII COT data does not come with 11 fields but as some of them contain only zeros I had to exclude these series to be able to complete evaluation of the neural network's performance.

Tests using both data providers finished fine except for the cosmetic "object reference" runtime error on FindNamedSeries during compilation time that I just ignored.

Now, please let me concentrate my attention on our top priority project that the whole MS123 team has been working on during the last year. Hopefully, alpha testing goes well and we will start it soon. Good luck to you.
profile picture

streak

#27

That's great Eugene.

Interesting in that I'd changed the zero's to one's (as above 8/21/2012 2:49 AM), but only on the fields being utilized for the input script!

Made a duplicate dataset removing the 'surplus' custom fields and voila, all is working. Made with a date range just for the training ie for in-sample only - 2000 to 2009.

Only thing now (which I haven't understood that I'm doing something adverse per 'help') is that when plotting the nn indicator it only plots changing values for the in-sample date range. Outside this its a flat line. But in view of MS123's priority project it'll be a qu to pursue another day.

Thanks I appreciate your support and persistence very much.
Jon


Also,

I appreciate the time you have put into this with the setting up of data etc. Thanks again.

profile picture

streak

#28

With zeros removed in the unused series of GetExternalSymbol() scripts have been working ok, however, when using the likes of the script above and replacing
CODE:
Please log in to see this code.
with
CODE:
Please log in to see this code.
(works normally), and then making a derived DataSeries such as
CODE:
Please log in to see this code.
an error is thrown; Runtime error: Object reference not set to an instance of an object. at NL.ScriptExecutor.Execute(WealthScript wealthScript)

Is this issue fixable (I've tried workarounds like assigning bars via looping, but cannot resolve it)?

Thanks
profile picture

Eugene

#29
Isn't it the same cosmetic error message during compilation as above.
profile picture

streak

#30

To test I implemented a statement per DataSeries pSpecShort = ... above that caused the message, but did not incorporate it with neuroLab.Input(); then re ran the training without changing any of the variables.

You must be correct again Eugene, thanks. But I'm not sure what to expect it terms of run-running a script, as to whether or not it should be identical? Again, I can only guess that it should not be expected to be identical as data is "...applied to the network in a random fashion..." stated in help.

So the original training graph and output indicator varying (ever so slightly) to the re-trained script as screen captured should be expected?

Original :-

Retrained :-



Original :-

Retrained :-


Thanks again
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).