A Guide to Trading Systems

Lesson -> Straight Line Equation -PTM2,C1 (Pair trade method 2,chapter 1)

8.1 - A Direct relation

Today is the 14th th February. People around me are happy about Valentine's Day. They are celebrating love and relationships. Valentine's Day is packaged to increase revenues for restaurants, jewelers and gift shops. But then, it's me and my random thoughts.

Given the Valentine's Day, I thought it would make a great topic to talk about relationships. You don't have to worry about me boring you with a love story, or giving you unwelcome advice on maintaining great relationships. Instead, I will talk about two sets numbers and how to measure the relationship between them, if any.

I will attempt to bring you back to school, or at the very least to your high school mathematics class.

Here's a quick summary: In Chapter 1-7 of this module, we covered a simple method of pair trading. This was the method that Mark Whistler taught. We will now discuss a more advanced method of pair trading. This is also known as'Statistical arbitrage','Related value trading_ or RVT for short.

We are now.

Do you recall the moment your math teacher explained the equation of straight lines in class? If you were anything like me, you would have ignored the lecture and looked out the window, rebelling against mainstream education.

If the teacher had simply said, "Learn this, and you'll make some money off it someday", the interest rate would have been completely different.
 

However, life gives you another chance so pay attention and you might make some extra money.

This is how the equation of a straightline looks:

Y = mx+ e
 

Before we get into the equation, let's take a moment to review the notations.

y = Dependent variable

M = Slope

X = Independent variable

E = Intercept

According to the equations, the value of a dependent variable (y) can be deduced from an independent variable (x), by multiplying x with its slope with y and adding the intercept "e" to this product.

Does that sound confusing? It does sound confusing?

 

That's why I'll explain further-

Let's say you have two fitness freaks. FF1 is a guy who does 5 pushups. FF2 does 10. So FF2 will do 10 pushups when FF1 does 5. If FF1 does 20 pullups, then FF2 does forty. And so on. Here's a table showing how many pushups they did from Monday through Saturday.

DayFF1FF2
MON3060
TUE1530
WED4080
THUR2040
FRI1020
SAT15???

If you had to guess how many push-ups FF2 would do Saturday, what would it be, and why? It's obvious, I think it's 30.

This means that FF2's pushups are dependent on FF1's. FF1 doesn't really care about FF2 and will do as many pushups as his body allows. FF2 however, does twice as many pushups as FF1.

This makes FF2 a dependent and FF1 an independently variable. Or, in a straight line equation, FF2=y and FF1=x.

FF2 =FF1*M +

The equation looks like this in simple English:

The number of pushups that FF2 does equals the number of pushups that FF1 does multiplied by a certain amount plus a constant.

This number is known as the slope (M), and it happens to be 2. The constant, or e, happens to be 0. The equation is thus -

FF2 = 1*2 + 0

This should be quite clear now. Let me now copy and paste the definition that I posted earlier.

According to the straight line equations, the value for a dependent variable (y) can be deduced from an independent variable (x), by multiplying the slope of x with y' and adding the intercept "e" to the product.

Think about a different case.

Two hungry men are H1 and H2. Like FF1 or FF2, H2 consumes twice as many parathas as H1 plus 1.5 additional. For example, H1 will eat 2 parathas while H2 will eat 4 and eat another 1.5. H2 will ensure that he always eats 1.5 extra parathas no matter how full he may be.

Here is the table that shows how many parathas the two men who were hungry over the past 6 days.

DayH1H2
MON25.5
TUE1.54.5
WED13.5
THUR37.5
FRI3.58.5
SAT4???

You will notice that H2 (who is always hungry) eats twice as many calories as H1 plus 1.5 extra parathas. He will eat -on Saturday.

4*2 + 1.5 = 9.5 parathas

Remember that the number of parathas that H2 consumes depends on how many H1 eats. H1 eats until he is full. Let's now create a straight-line equation for H1 and H2 as we did for the fitness freaks.

H2 = H1*2 + 1.

H2 is the dependent variable. Its value is dependent upon H1. 1.5 is constant and the slope is 2.

Let's first make a slight change to the paratha story. Think of Y as someone who is very conscious about his diet. He eats 1.5 parathas every day, regardless of how full or hungry he is. There is not a morsel more, or less.

So X eats 3 parathas, Y eats 1,5, X eats 5 and Y eats 1.5. X eats 2.5 and Y eats 1. And so on. What do you think the equation says?

y = x*0 +1.5

This slope is 0. Therefore, y does not depend on x. In fact, y's value is a constant 1.5. It is obvious. You should now be able to relate two sets of numbers.

Forget the exercise, forget the parathas. I'll give two random numbers to you.

X Variable(Dependent)Y variable(Independent)
103
126
84
917
2036
1822

X be the variable(Dependent) whereas Y be the variable (Independent).Can you predict the relation between the two? The numbers are not in the same relationship as the one shown in the previous examples. This does not necessarily mean there is no relationship between them. The relationship is just not apparent to the naked eye.

How can we determine the relationship between them? How can we determine the values of the slope and constant e?

Well, say hello to linear regression!

In the next chapter, I will share the same information with you.

Keypoints

  1. A straight line equation can be used to define the relationship between variables
  2. One of the variables is dependent, the other is independent.
  3. The slope of a straight line equation is represented by "m" and helps you determine the scale of the independent variable.
  4. The constant term e is represented by the term e
  5. If the slope is zero, Y = e
  6. Sometimes the relationship between variables may not be obvious
  7. If the relationship isn't obvious, one can use a statistical technique called "Linear regression" to identify it.