Loading stock symbols into symbol rotation strategies
Author: SimhaD04
Creation Date: 6/27/2013 4:11 PM
profile picture

SimhaD04

#1
To learn how to manipulate/rank stocks I used the two provided sample strategies: Weak-stock Rotation and Dog of the Dow (Rotation) [Rev A]. My main concern is with how to load stock symbols to be processed.

Both programs contain the line:
CODE:
Please log in to see this code.
.
CODE:
Please log in to see this code.
seems to be the array containing stock symbols in both cases. However, in the case of Dogs, irrespectively of what I select when running the program, it somehow always knows to operate on Dow 30 symbols, while the Weak-stock takes whatever you run.

Where in the programs the
CODE:
Please log in to see this code.
is defined?

Thanks.
profile picture

Eugene

#2
QUOTE:
However, in the case of Dogs, irrespectively of what I select when running the program, it somehow always knows to operate on Dow 30 symbols, while the Weak-stock takes whatever you run.

This is a misconception. There is no difference to the way these symbol rotation strategies load the data.

Although DataSet/symbol can be saved with Strategy in WL's Preferences, this is a global option. If you're stuck, you'll have to clarify how did you determine that "it somehow always knows to operate".

QUOTE:
Where in the programs the DataSetSymbols is defined?

For more information on DataSetSymbols, check out the QuickRef.
profile picture

SimhaD04

#3
Thanks, Eugene. I do check all commands by selecting them in the code and clicking QuickRef. Let me try it again.

Here's a step by step what I did, followed by questions:

1. for the Dogs

If I follow the instructions in the Strategy Summary tab, by clicking a single symbol in the Dow 30, all is well (as it should).

Since I am trying to understand how the data is loaded into the program, I wanted to try a couple of other things:

a. Click on the Dow 30 folder, rather than on a single symbol

The program runs, but now it loads each symbol many times

b. Click on a single symbol, but in S&P 100.

You get the Runtime Error: Object reference is not set to an instance of an object.

2. for the Weak-Stock

a. Again, all is well when I run Dow 30 clicking on a single symbol from the Dow 30 set. If I click on the Dow 30 folder, instead of a single symbol, it runs similar to the above, repeating each symbol many times.

b. Click on a single symbol, but in S&P 100.

As w/Dogs, the program produces the Runtime Error: Object reference is not set to an instance of an object.

===================

Q: where in the program the datasets are loaded and how/where it limited working sets to Dow 30 only? (Besides S&P 100, I tried Nasdaq 100 and my own list with identical results.)

I am using WL 6.5.19.0 under W7-64. My programming experience has been w/Fortran, so I am used to clearly defined procedures where you read in/load data into specific arrays before you do the processing. There must be a similar step in C# somewhere...

Thanks.
profile picture

Eugene

#4
QUOTE:
a. Click on the Dow 30 folder, rather than on a single symbol

The program runs, but now it loads each symbol many times


Do this, and the rest of what you're doing stops making sense. Please read this FAQ to avoid repeating the same mistake:

A Rotation strategy isn't working like it should.

Symbol rotation strategies should not be used that way. They are designed to operate on the whole DataSet by running on a single symbol. Also explained in the WealthScript Programming Guide, Programming Trading Strategies > Multi-Symbol Strategies.
profile picture

SimhaD04

#5
I'll read that. Any explanation as to why clicking on a single symbols works only for the Dow 30 set and not other sets?
profile picture

Eugene

#6
In this context, you're getting the error message because you haven't updated the Fidelity fundamental data before running the "Dogs of the Dow". This Strategy depends on the fundamental data (namely "dividend").

For more causes of this error message (in other contexts), check out this FAQ (at the bottom): Object reference not set to an instance of an object

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