Use access key #2 to skip to page content.

First and Second Derivatives of the SPX



November 23, 2009 – Comments (12)

Here is another off the wall post that will produce a few more interesting
observations. Please see my last post Recipe for Disaster to see where this train of thought came from and I will be linking some conclusions together between this post and that one.

First, what the hell is a derivative?

Maybe you are familiar with this concept on calculus and maybe not. Here is the real background if you are interested (, but here is the 1 paragraph version that gives you an understanding for this post.

A function is a description of how a dependent variable (lets call it y) moves with respect to an independent variable (lets call it x). A straight line is a very simple example: y = slope*x + intercept. Or a parabola: y = x^2. A derivative tells you the instantaneous rate of change of that function as x changes. It is also the slope of the function, but rate of change is the key concept. A straight line is always changing at a constant value, hence its derivative is a constant number. The parabola has a negative slope for x < 0, has a slope of zero at x = 0, and has a positive slope for x > 0. The second derivative tells you the rate of change of the first derivative.

Okay, that was a bit abstract. So lets use a physical example. Position (or displacement) as a dependent variable tells you where you are with respect to time, the independent variable. The first derivative will tell you the rate of change of position with respect to time. This is the velocity, or speed. Everybody is familiar with this concept. The second derivative will tell you the rate of change of velocity with respect to time. This is the acceleration. Another familiar concept.

Now lets apply this concept to the stock market. I will specifically be using the S&P 500 here. The price is analogous to the position, and we will look at the first and second derivatives of price, to help us to understand the behavior of how the price is changing with time.

12 Comments – Post Your Own

#1) On November 23, 2009 at 2:10 PM, binve (< 20) wrote:

First, here is the chart:

The price of the SPX is at the top of the chart in pink (I adjusted the left axis so the price would reside above the velocity and acceleration curves so that the chart would be more readable).  

I did not calculate the velocity directly from the price action. It is too chaotic and would give just a big mess. So I calculated the 10 day Moving Average of the price (based on closing prices) and determined the velocity of that curve. For an additional bit of "smoothing" I am also plotting the 10 day MA of velocity just so the trend is a bit clearer, but I am working with the velocity as described above. The acceleration is calculated directly from the velocity, but I am also plotting a 10 day MA for the acceleration so you can see the trends (since it is also very spiky)

As a side note, the ROC (rate of change) indicator on Stockcharts gives you very similar "velocity" information. I am showing the data plotted myself since I am going through a more in depth study.

Important observations: The middle of last year was the market crash. This is by far the most important price action element on the 2 year chart. The move down was a violent freefall and you can see the associated velocity spike.

When I think about this move and try to assign it a physical corollary, I think of a football kick. A football is initially at rest and then the kicker kicks the ball to put it on its parabolic trajectory toward the goal posts. But what is of interest here is the dynamics and forces right at the time of the kick.

This system can be modeled as a first order Ordinary Differential Equation with a prescribed velocity as the initial condition. And for those who have done first order and second order ODE modeling of physical processes, the disturbance perturbs the system which has natural damping to return it to an equilibrium position. The response is always an exponential function (e^-j*omega*t) or (e^-omega*t) depending on if you are underdamped or overdamped.

The point is that an exponential decay envelop tells you how the response will change over time. And so when when I look at the velocity, I am able to fit an exponential decay envelope very nicely over the peaks.

This works very well describing the velocity behavior from mid last year to mid this year.

The last couple of months up to Now is where things get very interesting.

So for a physical system, the vibrations damp out to zero as time increases. And for very big disturbances, I would expect the market to behave like a physical system (it has mass, inertia, capacitance, etc. Tastylunch and I have had long conversations about this, comments #39-43). The are places where these analogies do not work, but you can get a surprising amount of insight into monetary policy effects and assets price responses if you look at them as signal functions.

So the current large wave up (Primary 2) is a mechanism by the market to dampen out the oscillations caused by Primary 1 (the wave down last year). And from the decay envelopes above, you can see it was doing exactly that. But now the oscillations have begun to increase again. They are no longer being held in by the decay envelope.

And this goes directly to the observations that I made in my last post Recipe for Disaster. The market internals (and breadth is by far the most important internal measure) are becoming more violent up and down even as the price action narrows and starts going sideways / slightly up as it has the past couple of months.

This lets you know that there is a lot of turmoil beneath the surface and another large "step function" in price change is about to occur. Will it be a crash up or a crash down? I obviously have my opinion on the matter. For those who are interested in my opinion, please read this post: My Positions and Projections

But the real point of this post and the last post is to show that things are not as calm as they might appear on the surface.

Report this comment
#2) On November 23, 2009 at 2:39 PM, FoolvsStreet (< 20) wrote:

Another GOOD ONE binve

Report this comment
#3) On November 23, 2009 at 2:48 PM, binve (< 20) wrote:

FoolvsStreet , Thanks man! I really do appreciate that!!..

Report this comment
#4) On November 23, 2009 at 4:41 PM, anchak (99.86) wrote:

You are THINKING my friend ....except as checklist says - this is a market for simplifiers - and not.....

Also seasonality dictates soem support thru Christmas.

Great post as always - System Dynamics!


Report this comment
#5) On November 23, 2009 at 5:03 PM, binve (< 20) wrote:

anchak, Thanks brother!

And I couldn't agree more with regards to the seasonality aspect. That is why I am not predicting a crash here. Things are just getting ready for one.

See this post of mine: Predictions for Minor B and here is the excerpt of a conversation between me and amassafortune:

Because I think this last wave up (Minor C)... assuming of course my count is right and we even get a Minor C up vs. just crashing down here... will be the ultimate window dressing wave. There will be a run up due to Q4 anticipation. There will be a lot of year end run up just before the year end tax loss selling (you see I put a peak in mid December). But I think the participation will be very spotty. I think we will get a lot of non-confirmations. And as per my post last night:, the current divergence between the cumulative NYAD and the SPX and Dow will grow. I think breadth will be very erratic. In fact I think the breadth will be very bad and similar to the run up last month (see these posts: Man SPX, Your Brea(d)th Stinks! and SPX says "Pass Me the Binaca!")

But I will be right along side you at +1115. That is what I will be using this last Wave C for, to add to short positions. It will be a bearish Christmas gift :)

And thank you so much for the props! I really appreciate that man! We have had so many great and useful discussions on Caps and I am so glad we are continuing that here :) Thanks man!!

And here is how I see the end of the year playing out:

Thanks AC! I appreciate that man!!..

Report this comment
#6) On November 23, 2009 at 7:12 PM, Tastylunch (29.54) wrote:

Hah figures you would point to that discussion we had the verys ame week the "AGW" controversy goes nuclear. Thanks dude, I'm sure the lynchmob knows my address. :)

man Binve that is some really nerdy stuff, I like it. :)

This just further evidence of the lack of "high quality" liquidity in the market. We've known it for awhile now. Insiders are dumping left and right, volume pretty much consists of 5 names only,HFT fund, Quants and dark pools now outcrowd investors in daily volume.

Now that the belief "buy and Hold" is more out of vogue than ever, I'm worried it will be dump and panic city if the market moves down a lot. You really need those income investors to keep the market stable

if grandpa and grandma don't think their stock will ever come back.... combined with the generational population gap....

Well This whole market looks like a gigantic air pocket to me.But then again it has for quite awhile.

I think the "what" is fairly established, But it still doesn't tell us the "when".:(

As implausible as it seems I think this makret could continue inflating far longer than we may think if the Fed keeps their foot on the QE gas.

dunno man, thanks for sharing your work.


to be fair to our goodfriend checklist , that was last market. The market before that 2008 afterall was a market for thinkers/extrapolators just like every crash typically in my experience is.The market before that was also pretty easy for simplifiers. Throw a dart in 2003-2007 and you made money.

When this rally ends and eventually it will like they all do, it will be different market.

So if binve is correct then it is time to think more deeply as Chanos is doing with his short "all of china and their dogs too " thesis. Find the names most wedded to last Bull and  look to short them.

It's my take on Munger's famous advice of "invert, always invert"

I'm this close to closing my RINO long to protect gains, but I know I get nervy too quickly and am trying to let it run as long as it will go.

but it's good to keep in mind for the next bear move that it pays to be simple after the juicy part of the down move as Checklist has shown. It would be fun to see if the you get another high beta name bounce in a P4 wave (my guess is i would be more muted tnan P2 if  I read EWP right, but still)

Just my 2cents


Report this comment
#7) On November 23, 2009 at 7:30 PM, binve (< 20) wrote:

Tastylunch, Whoops! Yeah we were both in on that conversation. Looks like the lynchmob will be after both of us :) Yeah, I need to take that conversation and parse our just the signal processing / monetary policy discussion and leave the more controversial discussion behind. I might do exactly that as a comment on my other blog.

We have had so many good coversations / debates over the last 2 years, I could write a massive post called the "Tastylunch / binv dialog". Or, I could write a book, it will be a best-seller! (royalties to you of course) :)

man Binve that is some really nerdy stuff, I like it. :)

binv sits at his desk, looking at his monitor and laughs "heh-heh, heh-heh" while pushing his horn-rimmed glasses closer to his eyes with his index finger

.... now that's nerdy ..... :)

Well This whole market looks like a gigantic air pocket to me.But then again it has for quite awhile.

I think the "what" is fairly established, But it still doesn't tell us the "when".:(

That's exactly right. I have given my latest projection, based on a possible ending pattern in the dollar and an esuing bounce (before it starts heading down long term of course), but it is just another guess. 

And thanks man, I am always happy to share my work :)

Report this comment
#8) On November 23, 2009 at 8:06 PM, panchocharlie (36.15) wrote:

Binve, have you ever considered using your immense chart analyis talents  to the old time honored Point and Figure charting method.  To me, P&F charting seems to get very similar results  although not as precise .  There is a counting element in the method that is helpful in determining price objectives.  I would appreciate your thoughts.


Report this comment
#9) On November 23, 2009 at 9:12 PM, SolarisKing (< 20) wrote:

Binve, as you know, i always think i see weird corrolations that no one else saw. If you go look at my page here on CAPS, and compare my chart to yours, you will see what i mean.

Now we have a private joke.

To me, i think that signifies a major correction is coming..



Report this comment
#10) On November 23, 2009 at 10:12 PM, binve (< 20) wrote:

panchocharlie, Hi! Thanks! I am not done any P&F charting. Not because of any predjudice against it, it is just an oversight. Never really picked it up. But you are the second person to mention it to me, so I think I will start to read up on it :) Thanks!

SolarisKing, LOL! Thats awesome man! :) Yep, here's to a nice healthy correction :) Thanks man!!..

Report this comment
#11) On November 24, 2009 at 2:12 PM, leohaas (35.73) wrote:

You ARE a nerd.

Fundamental question I have here: are you sure that what we see in your chart is not more than mere coincidence? After all, it is human nature to want to see patterns, even if they are not there. Have you backtested this?

Report this comment
#12) On November 24, 2009 at 3:01 PM, binve (< 20) wrote:


You ARE a nerd.

and proud of it :)

Fundamental question I have here: are you sure that what we see in your chart is not more than mere coincidence? After all, it is human nature to want to see patterns, even if they are not there. Have you backtested this?

That's a very fair question. The quick answer is no, I have not done any extensive backtesting with this model. I am making the assertion that physical systems behave in a very quantifable way. And that that even though the stock market represents human hope, emotion, greed, fear, optimism, pessimism, etc. at the end of the day it is a quasi-physical system and that certain aspects and responses should be analyzeable in the same manner that any physical system would.

I admit though, it is a bold assertion. And I have not done the due-diligence to prove it.

But like with my last controverisal post Why Arithmetic Stock Charts Are Worthless (in which I got little / almost no agreement) I am content to throw out a few ideas, show some reasoning behind the idea, showing a couple of examples, with actually proving it.

These are big topics that could be turned into science projects, which really isn't my aim.

The log stock chart post is intereting because I am pointing out that all gains in the market are exponential, and that stock price represent energy levels. Which are analyzed logarithmically (concept behind decibels). And that trendlines (straight line relationships) on an arthirmetic chart are mostly coincidental but that they have a basis in meaning on a logarithmic chart.

..... I got either crickets or disagreement. :)

But I wasn't expecting agreement, nor was I trying to prove the idea conclusively, nor was I trying to convince anybody that my idea was "right". I was sharing my opinion (perhaps loudly/obnoxiously) :), and trying to generate some discussion about it.

Which was more or less the point of this post. I have an idea that responses of price and the market internals are not calm, despite the fact that price is narrowing. But if price is narrowing the internals should be calmer. I am pointing out this disparity and showing the mechanical corollary to when the data and the model seem out of whack, pointing to a future instability.

I certainly do not claim to be right. Just trying to strike up a nerdy conversation based on not often talked about observations :)


Report this comment

Featured Broker Partners