Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

get_beta correctly queries union of old and new data (missing in 1 pl…

…ace)
  • Loading branch information...
commit 4cbda35b1fb89a473cfb0b08a30af855ec161e75 1 parent e997078
@ajablonski authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 get_beta.pl
View
6 get_beta.pl
@@ -59,8 +59,10 @@
#otherwise get the covariance
- $sql = "select avg((l.$field1 - $mean_f1)*(r.$field1 - $mean)) from ".GetStockPrefix()."StocksDaily l join ";
- $sql.= " (SELECT $field1, timestamp FROM ".GetStockPrefix()."StocksDaily WHERE symbol=rpad('DIA', 16)";
+ $sql = "select avg((l.$field1 - $mean_f1)*(r.$field1 - $mean)) from ";
+ $sql.= " (SELECT $field1, timestamp, symbol FROM ".GetStockPrefix()."StocksDaily ";
+ $sql.= " UNION SELECT $field1, timestamp, symbol FROM $netID.newstocksdaily) l join ";
+ $sql.= " (SELECT $field1, timestamp FROM ".GetStockPrefix()."StocksDaily WHERE symbol='DIA'";
$sql.= " UNION SELECT $field1, timestamp FROM $netID.newstocksdaily WHERE symbol='DIA')";
$sql.= " r on l.timestamp=r.timestamp where l.symbol='$s1'";
$sql.= " and l.timestamp>= $from" if $from;
Please sign in to comment.
Something went wrong with that request. Please try again.