Strategy gives error in Strategy Monitor but runs fine in Strategy Window
Author: Shourui
Creation Date: 9/24/2010 2:35 PM
profile picture

Shourui

#1
Hi,
My startegy is running fine on a watchlist, but it threw out error when I click "Run this strategy now" in Strategy Monitor(SM). The msg is " Error(4): Index was out of range. Must be non-negative and less than the size of the collection. Parameter name:index"

What causes this problem? I have no GetExternalSymbol in the code.
profile picture

Eugene

#2
Is that an exception message box or you're seeing it elsewhere like in the "Actions" column?

Which data provider is in use?
profile picture

Shourui

#3
It is in the Actions column. I collect data from Bloomberg and save them in CSV files, which are read by WL6.
profile picture

Eugene

#4
Which data provider are you using?
profile picture

Shourui

#5
I am a BB customer and have downloaded data to csv files for Wealthlab in last 3 years.

I tried to open "other Extensions", but no provider is available, except the "Aronow software watchlist static data provider".

It is not one-time occurence. It happend each time when I run it in SM, but it is working fine when I open strategy and run it on the watchlist.

What do you mean "the error break your CSV data saving routine or not"?

It happened when I ran SM both normally and manually.

The code does some calculation and then exports results to a new CSV files.

It happend with every DataSet
profile picture

Eugene

#6
QUOTE:
What do you mean "the error break your CSV data saving routine or not"?

Your provider is ASCII and not Bloomberg, got it. By asking, I was just trying to understand what's the real problem except than getting an error message in Strategy Monitor? Now I see - you're trying to run a Strategy using the ASCII provider. However, it's probably not working because the ASCII provider currently does not support Strategy Monitor. It may be a good idea to support it though, so I'd appreciate a support ticket.
profile picture

Sammy_G

#7
While you are looking into this, can you also revisit this issue I reported previously as it may be related: /Forum/Posts/GetExternalSymbol-and-Strategy-Monitor-bugs-or-is-it-just-me-30816 Two upgrades/patches for WLPro have been released since my post but the issue is still there.
In brief, the strategy runs fine by itself but throws off an error in the Strategy Monitor. The strategy references data (for certain calculations only, not for placing trades) from an external symbol - its a futures symbol in Metastock format; if you need the symbol data file, let me know.
Its frustrating to run the strategy manually on symbols individually and feed the alerts to Quotes Manager.
profile picture

Eugene

#8
Well, this is related. As I said, the ASCII provider does not support Strategy Monitor. Likewise, the Metastock provider does not support it.
profile picture

Sammy_G

#9
Can you explain what you mean by "Metastock provider does not support it."? Its not that I want SM to download the data or anything; its just that some number crunching needs to be performed on that data (which has already been updated).
profile picture

Eugene

#10
It means that Strategy Monitor will never request updates after initially running a strategy. This is what's called "to support Strategy Monitor in provider" and requires some extra code (if applicable i.e. when the provider supports on demand data update).
profile picture

Sammy_G

#11
Well, I don't know where the problem lies but the fact is that the strategy won't run in SM, and throws off that error. Which is surprising because all that I am doing is referencing a price series (on an external symbol) for some number crunching; no trade is being placed on the external symbol. The fact that the symbol is a futures symbol or that the provider is Metastock should be irrelevant as all I am doing is getting a price series - a series comprised of double precision numbers like any other series. So theoretically it should work, but it doesn't.

A properly designed SM would not request data updates when Data on Demand is turned OFF, as in my case, or fail to execute even if it couldn't find any updates. Unfortunately, it does appear that it DOES request data updates as one can verify by monitoring internet activity after activating a strategy. At the very least, this is unexpected behavior; whether this is also ultimately responsible for the failed execution I don't know.
profile picture

Eugene

#12
You got it wrong. SM does request data updates by design, regardless of data on demand state, using its own logic.
profile picture

Sammy_G

#13
Then I must say the design is unexpected, and possibly even wrong. And may be at the root of the problem.
profile picture

Eugene

#14
The SM is designed is to load the requested data loading range at first and then only the required updated intraday data. This applies to intraday time frames and effectively reduces the amount of data loaded and processing required on interval updates. On demand data updates have nothing to do with it.

Just give it a thought: if user could break the SM from interval updates by disabling an option (on demand data update) in the menu, what would it be? :) In addition to that, I'm speaking about the regular updates, not on demand. For ASCII or Metastock, on demand update isn't supported and simply can't be guaranteed, so there's nothing to update (and to support regular update at intervals). Hope this makes it more clear.
profile picture

Sammy_G

#15
Ok, I see your point of view about intraday data, but I was thinking from the non-intraday (daily, weekly) perspective. I think you can change SM to use a "smart" routine so that it updates intraday data only, leaving it to the user to update all data before running the non-intraday strategies.

Think about it from my situation: I can run my strategy (it uses daily bars) in the strategy window w/o any hiccup. But when run inside the SM using identical settings, it causes an error. What's the main diff between the two? - SM goes out and tries to collect the data, and after failing to do so (its a futures symbol, hence no data from Fidelity) it causes the error.

Cone had mentioned in the other thread I referenced above that there's a known issue with GetExternalSymbol in SM; while that may be a contributing factor, I am not sure if that can explain the complete failure of this strategy to run successfully in SM, as I have other strategies that also use GetExtSymbol, and they run OK inside SM; their main diff from this strategy that fails to run? - the latter uses a futures symbol, they don't. Which goes back to my original thought - that somehow the (unnecessary) download routine in SM is to blame.
profile picture

Eugene

#16
QUOTE:
Think about it from my situation: I can run my strategy (it uses daily bars) in the strategy window w/o any hiccup. But when run inside the SM using identical settings, it causes an error. What's the main diff between the two? -

By design, static data providers that do not support requesting data updates, are out of luck with Strategy Monitor - they can't be employed there (example: ASCII, MetaStock).
profile picture

Sammy_G

#17
I think the forced data update routine in SM for EOD data is rather unnecessary.
But I am going to move on since I have bigger issues on my mind.
Atleast I can run the script in the strategy window and generate alerts that way - though the inability to save, and retrieve, alerts for the Quote Manager means alerts need to be generated afresh after each time the strategy window is closed, and that's another point of frustration.
profile picture

ecorderob

#18
Hi,

I am facing the same problem that Sammy, but using Yahoo as a data provider. As I have understood in this thread, it should work with yahoo, but I have exactly the same error than Sammy: It works ok when running it from the designing window, but it returns that " Error(4): Index was out of range. Must be non-negative and less than the size of the collection. Parameter name:index" from the Strategy Monitor...

Thanks,

Enrique
profile picture

ecorderob

#19
I have checked that I have "GetExternalSymbol" in my code... Is that a problem?

Thanks again,
Enrique
profile picture

Eugene

#20
Hi Enrique,

Which provider gets requested for the external symbol's data?
profile picture

ecorderob

#21
Also Yahoo
profile picture

Eugene

#22
It shouldn't be a problem with Yahoo. Chances are, the data can be delivered from a different provider's DataSet with identical symbol name. Could you double check that?
profile picture

ecorderob

#23
Checked. The only provider is Yahoo... But I have to check sth because working against some packages it works and against some other it does not.
Maybe when it fails, it is because it is failing for some symbol in that package...