Market neutral portfolio sample code
Author: SimhaD04
Creation Date: 1/28/2013 4:43 PM
profile picture

SimhaD04

#1
I want to create a system which will generate a score for each stock in my database. Based on that scoring the system will then determine what to buy (long) and what to sell (short) etc.

I have the program that computes the score. I wanted to see whether you have a sample program with library calls etc, that will use the selected (scored) stocks from my program to generate a market neutral portfolio that I could then test in WL.

Thanks.
profile picture

Eugene

#2
profile picture

SimhaD04

#3
thanks, Eugene. I downloaded the strategy you suggested, but it compiles with errors:

Error processing symbol AA Object reference not set to an instance of an object.
Error processing symbol AXP Object reference not set to an instance of an object.
Error processing symbol BA Object reference not set to an instance of an object.
Error processing symbol BAC Object reference not set to an instance of an object.
Error processing symbol CAT Object reference not set to an instance of an object.
Error processing symbol CSCO Object reference not set to an instance of an object.
Error processing symbol CVX Object reference not set to an instance of an object.
Error processing symbol DD Object reference not set to an instance of an object.
Error processing symbol DIS Object reference not set to an instance of an object.
Error processing symbol GE Object reference not set to an instance of an object.
Error processing symbol HD Object reference not set to an instance of an object.
Error processing symbol HPQ Object reference not set to an instance of an object.
Error processing symbol IBM Object reference not set to an instance of an object.
Error processing symbol INTC Object reference not set to an instance of an object.
Error processing symbol JNJ Object reference not set to an instance of an object.
Error processing symbol JPM Object reference not set to an instance of an object.
Error processing symbol KO Object reference not set to an instance of an object.
Error processing symbol MCD Object reference not set to an instance of an object.
Error processing symbol MMM Object reference not set to an instance of an object.
Error processing symbol MRK Object reference not set to an instance of an object.
Error processing symbol MSFT Object reference not set to an instance of an object.
Error processing symbol PFE Object reference not set to an instance of an object.
Error processing symbol PG Object reference not set to an instance of an object.
Error processing symbol T Object reference not set to an instance of an object.
Error processing symbol TRV Object reference not set to an instance of an object.
Error processing symbol UTX Object reference not set to an instance of an object.
Error processing symbol VZ Object reference not set to an instance of an object.
Error processing symbol WMT Object reference not set to an instance of an object.
Error processing symbol XOM Object reference not set to an instance of an object.

Thanks.
profile picture

Eugene

#4
Pay a visit to the Errors section of the Wiki. In Errors | Strategy, I hope you'll find a solution: at the very bottom, there's a paragraph dedicated to it.
profile picture

SimhaD04

#5
from what I can see in the code, the suggested strategy, ActiveTrader 2010-10 | Market-neutral VIX-based pair, does not contain the code I am looking for. Specifically, I want to be able to load a universe of stocks, and then assign a score to each one.

If you have a strategy which does both, that's great, but even the first portion should suffice.

Once you scored the stocks, how would you do the neutralization? E.g. you could subract the mean score.

Finally, can WL process industry classification information to be able to do this by the industry? I believe databases usually have it.

thanks,
profile picture

Eugene

#6
QUOTE:
Specifically, I want to be able to load a universe of stocks, and then assign a score to each one.

Have you looked into rotational strategies i.e. the ones from the "Symbol Rotation" folder? This looks closest to your description.

QUOTE:
Finally, can WL process industry classification information to be able to do this by the industry?

Fidelity provides users with GICS classification. For more information, check out the WealthScript Guide and search the forums: you should find a number of code examples on how to deal with GICS.