Profile Picture

Beta Indicator

Posted By DrKoch 10 Years Ago
Message
Posted Tuesday September 04 2007
Today I had the "funny" idea to look at the "beta" indicator, which is the slope of the regression line through a number of (log) returns of a symbol (say AAPL) and the broader market (say QQQQ).

So I created a LogReturns indicator. And a linear regression indicator which accepts two series as inputs.

First try: Drag and Drop:
I can calculate log returns here, but can't find a way to access QQQ at the same time. Would be nice if I can drag "QQQ" on an existing Chart and use QQQQ's close prices as an input for the dragged indicatrors.

Second try: System Desginer:
Here I can build a similar chain of indicators:
LinReg2Slope
|- LogReturn(AAPL.Close)
|- LogReturn(???.Close)

but again I have no idea how to soecify "Close prices of QQQQ" in this context.

Third try:
I created a strategy in C# code. Now I am able to access QQQQ:

// in Startup
   foreach (Symbol symbol in Symbols)
{   
         if(symbol.Name == "QQQQ")
         {
            mktSymbol = symbol;
         }
   }

// in NewSymbolBar

      ISeries lnRetX = Indicators["LNRetX"][mktSymbol];



but now I am stuck. How can I feed these values into the LinReg indicator?


      Indicators["Beta"].CreateIndicator(new LinReg2Slope(period));
      Indicators["Beta"].SetInputs(
       new object[] {Indicators["LNRetY"], "LNRetX"});

does not do the job... Sad




www.finantic.de

Our Trading System at C2: Topaz
Posted Tuesday September 04 2007
Question on the code below.  You're passing in a series and then a name.

Indicators["Beta"].SetInputs(
new object[] {Indicators["LNRetY"], "LNRetX"});

Also, what is happening?  Is it just not working or not compiling?

DrKoch (9/4/2007)
Today I had the "funny" idea to look at the "beta" indicator, which is the slope of the regression line through a number of (log) returns of a symbol (say AAPL) and the broader market (say QQQQ).

So I created a LogReturns indicator. And a linear regression indicator which accepts two series as inputs.

First try: Drag and Drop:
I can calculate log returns here, but can't find a way to access QQQ at the same time. Would be nice if I can drag "QQQ" on an existing Chart and use QQQQ's close prices as an input for the dragged indicatrors.

Second try: System Desginer:
Here I can build a similar chain of indicators:
LinReg2Slope
|- LogReturn(AAPL.Close)
|- LogReturn(???.Close)

but again I have no idea how to soecify "Close prices of QQQQ" in this context.

Third try:
I created a strategy in C# code. Now I am able to access QQQQ:

// in Startup
foreach (Symbol symbol in Symbols)
{
if(symbol.Name == "QQQQ")
{
mktSymbol = symbol;
}
}

// in NewSymbolBar

ISeries lnRetX = Indicators["LNRetX"][mktSymbol];



but now I am stuck. How can I feed these values into the LinReg indicator?


Indicators["Beta"].CreateIndicator(new LinReg2Slope(period));
Indicators["Beta"].SetInputs(
new object[] {Indicators["LNRetY"], "LNRetX"});

does not do the job... Sad

Posted Tuesday September 04 2007
billb (9/4/2007)
You're passing in a series and then a name.


This is just one of the "permutations" I tried. Obviously RE's indicator system (class Indicators) is not prepared to read from two different symbols at the same time. The code above just feeds data from the same symbol into my LinReg2Slope indicator.


www.finantic.de

Our Trading System at C2: Topaz
Posted Tuesday September 04 2007
You're right, there's currently no real way to create an Indicator that uses data from more than one symbol.  You are kind of stuck doing these calculations in your system code.

We do want to support cross symbol indicators eventually.  We didn't actually have an item for it in our tracking system, so I added one (bug 1142).

Thanks,
Daniel

Posted Tuesday September 06 2011
Hi,

I'm new to RE. Just wondering if the cross symbol indicator support that you mentioned in the last message was ever incorporated?

Thanks,
Aziz


Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems