Re: Eureqa - Relative Strength

136 views
Skip to first unread message

Dave Nunez

unread,
Apr 25, 2013, 8:02:02 PM4/25/13
to eureqa...@googlegroups.com
"What is missing is a model of the strength of the pattern"

This sounds like the magnitude of the signal.

http://en.wikipedia.org/wiki/Magnitude_%28mathematics%29

hth, -d

On Thu, Apr 25, 2013 at 1:53 PM, <cbr...@cypresspoint.com> wrote:
Hi Michael,

Please help me with a new problem I'm trying to solve.
I want to compute a new relative strength (RS) function on all the stocks that are currently trading.

A description of RS can be found at: http://en.wikipedia.org/wiki/Relative_strength_index.

I think the current definition of RS is obsolete, and we could do much better.

The computation is to be updated every minute of the trading day.
The Relative Strength (RS) function is meant to rank the momentum of all the stocks.  

The top of the RS ranking list are stocks that are moving up under buying pressure,
and likewise, the stocks at the bottom of the list are under selling pressure.

I propose the following new data that could go into the RS function:

  vwap:       Volume weighted average price since the open of the market. See: http://en.wikipedia.org/wiki/VWAP.
  pc:           A vector containing the percent change of "vwap" since the open of the market.
  v1:           A vector containing the percent volume change since yesterdays close.
  rs:            A regression spline curve fitted through the "pc" data points.
  d1:           A vector containing the first derivative of the "rs" curve.
  w1:          The number of time intervals (looking backwards) that "d1" is positive (width).
  h1:           Maximum height of "w1".
  a1:           Integral of "d1" (area).
  slope1:     Last value of the "rs" curve, i.e. the current slope of "rs".
  d2:           Second derivative of the "rs" curve.
  .
  .
  etc.

For example, if d1 has been positive for the last 30 minutes (w1 == 30) then a1 is the area
under the d1 curve for the last 30 minutes. If slope1 > 0, then the stock is still moving higher.

In my experiments, I am encouraged by the use of these derivative terms as a pattern recognition filter.
What is missing is a model of the strength of the pattern.

We then have:   RS = f(pc,v1,rs,d1,w1,a1,slope1,d2,…)

The problem I need help with is how to model the ranking with Eureqa.
Please suggest what the Eureqa Target Expression should be.

I will gladly share the results of this work.

Charles Brauer
Cypress Point Technologies, LLC

--
You received this message because you are subscribed to the Google Groups "Eureqa Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eureqa-group...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
When things get too complicated, it sometimes makes sense to stop and wonder: Have I asked the right question?
-Enrico Bombieri

Dave Nunez

unread,
Apr 30, 2013, 1:35:15 PM4/30/13
to eureqa...@googlegroups.com
Hmm.. you could do it that way(computing the magnitude straight), if you have your RS already, just feed the variables and compute the function that you already stated, "RS = f(pc,v1,rs,d1,w1,a1,slope1,d2,…)" Eureqa will find the simplest answer. -d


On Fri, Apr 26, 2013 at 12:55 PM, <cbr...@cypresspoint.com> wrote:
Hi foo,

The Wikipedia page you referenced talks about Euclidean vectors, Normed vector spaces, Logarithmic magnitudes, etc.  Are you proposing a solution that does not involve Eureqa?

I would be very interested in an example of a Eureqa Target Expression that would derive a "magnitude" formula.

Charles

Charles Brauer

unread,
Apr 30, 2013, 7:35:50 PM4/30/13
to eureqa...@googlegroups.com
Hi Dave,

Thanks for replying.  I don't have a Relative Strength (RS) function already.  I want Eureqa to derive it from the data.
Suppose I give Eureqa a table that contains 3000 rows (one for each stock), and the columns are the first 15 minutes of data for the function: 

   RS = f(pc,v1,rs,d1,w1,slope).

If I give the above equation to Eureqa as the Target Expression, I don't see how Eureqa knows that it is to find the maximum value of RS for each stock, so that I can then sort the ranking from maximum to minimum? The idea is that the top of the ranking list should contain the stock that has the most buying pressure... assuming that RS computes "buying pressure".

To put it another way, I'm obviously confused as to how "the simplest answer" guarantees that RS maximizes f(...) for each stock.
Whew!  I need a drink.

Charles

Dave Nunez

unread,
May 1, 2013, 7:23:12 PM5/1/13
to Eureqa Group
I understand now, hmm.. that's a tough one, not only that but I think you will have to account for the "hfts" also, but that's a different topic all by itself :P.

I will get back to you on this one, -d

Michael Schmidt

unread,
May 2, 2013, 2:34:49 PM5/2/13
to eureqa...@googlegroups.com
I'm not sure if this is exactly what you want, but you could use Eureqa to derive a ranking score. For example, you could enter a search expression like:

(a_result > b_result) = ( f(a1, a2, a3) > f(b1,b2,b3) )

All you need is to structure your data to have variables from random pairs of things you want to rank, in this case a1,a2,a3 and b1,b2,b3 are the same inputs but for different things, put in different columns on the same row.

Then the f(x1,x2,x3) result here would represent a custom heuristic that you could use for score/ranking/comparing.

Michael




Michael Schmidt

unread,
May 15, 2013, 7:24:17 PM5/15/13
to eureqa...@googlegroups.com
So if you had 3000 stocks, there'd be 3000^2 pairs = 9M rows, which is a little high for the GUI version. But, just randomly sampling 1% of these should be enough to give a pretty good ranking function. You'd need some programmatic way to expand out all the pairs of stocks though.


On Thu, May 2, 2013 at 3:39 PM, Charles <charle...@gmail.com> wrote:
Hi Michael,

Thanks for replying.  Please help clarify with a simple example.
Suppose I have 3 Stocks with data like:

   Symbol   a     b
   AAA      1.3   10.2
   BBB      1.2    9.3
   CCC      1.4   11.1

What would the Eureqa spreadsheet look like?
If all the data is in a single row, and if I have 3000 stocks, and 6 variables/stock, would I exceed a row size limit?

Thanks for your help.

Charles
Reply all
Reply to author
Forward
0 new messages