The Great Walls of the World

This isn’t meant to be political. It is meant to be informative about the great walls of the world.  Donald Trump stated that he planned to build a wall between the United States and Mexico. He like many other great leaders of the past may leave his mark on humanity for millennia, if successful. in October of 2016 did a post called 13 famous Walls around the world.  They only did photos though. Let’s take a look at some.

The Great Wall of China was built to protect the Chinese states against raids and invasions from the various nomadic groups of the Eurasian Steppe.  Though different pieces were constructed as early as 7th century BC under the rule of Qin Shi Huang between 220-206 BC the most famous part of the wall was built.  Among its purposes was defense and yes, border control.

A less known but, still a great wall was the Walls of Ston.  Famously known as the “European wall of China.” Spanning more than 4.3 miles long it surrounded the city of Ston, which is now southern Croatia.  The city used this wall to protect itself and its Saltpans, which brought it great wealth.

Another wall is the Israeli West Bank Barrier. A wall spanning more than 430 miles!  Israeli considers it a security barrier against terrorism, while Palestinians call it a racial segregation. Politics aside, this wall began construction in 2000 proving modern walls can be built and maintained.  This wall is still in existence today.

Lastly, The Walls of Babylon. Constructed under Nebuchadnezzar II between 634-562 BC. This massive wall is truly wonder! Even the greek historian Herodotus claimed that “Babylon surpasses in wonder any city known in the world.”  According to Herodotus the wall was 56 miles long, 80 feet thick, and 320 feet high!  Large enough chariots could race around the top. Keep in mind a football field is 360 feet long! That is one hell of a wall!

Walls for security, walls for border control, walls for defense.  Walls are truly a great accomplishment of man.  Even psychologically, we built walls to protect ourselves!  Consider the historic significance of these select few walls from history.  Now imagine, the United States, in all its glory being part of that Great Wall history.   A man once said, “If we want to compete with China we need a wall bigger then China.”

Posted in Musings | Tagged , , , , , , , | Leave a comment

Tech Companies. Hoarders in disguise?

Hoarding isn’t just a problem for people anymore. I believe this pathology extends to companies as well.  It may even be at clinical levels given how much data they are acquiring but potentially not even using. That my friend, is hoarding.

It is estimated that google has 10 exabytes of data that’s 10 million terrabytes.  A common hard drive at home holds 5 terrabytes.  GOOG

Walmart is estimated to process 2.5 petabytes of data an hour.  That’s 360 petabytes a week or 360,000 terrabytes.  WMT

Even the U.S. is believed to be storing up to a yottabyte of data with it’s new NSA facility.  Which is 1,000,000,000,000 terrabytes.

That is a lot of data.  The true sign of a good hoarder is whether they are unwilling to part with items they no longer use.  In my opinion, I doubt any of these tech companies would delete old user data, location statistics, or any data that could be potentially profitable someday.  That’s the key word COULD.  I’m no psychologist but I do believe these companies have a pathological relationship with their data. They are hoarding it.  It no news that google is now the largest buyer of magnetic tape.  Why? To save all the data! Magnetic tape is to slow to read so why keep it? Because they are hoarders.

Posted in Market Psychology | Leave a comment

Slippage and Root Mean Squared Error in Model performance

REAL traders all know how important slippage is.  You wanted to buy at 20.05 but got filled at 20.07.  Then you wanted to exit at 20.55 but got filled at 20.52.  The $0.02 on the went in and the $0.03 on the way out is what is referred to as slippage or skid. Total slippage $0.05

When building mix models I always incorporate slippage but where has become an increasingly important question in my work.  It’s similar to when people run a regression analysis on data that has no linear time factor built it.  You have no idea if Y preceded X or X preceded Y.  Running a linear regression doesn’t make this so.

Root Mean Squared Error or RMSE is one of many ways to compare regression models.  The formula is SQRT(mean((Observed_data- Predicted_Value)^2)).

When building models I often have a maximum profit from the trigger point (trade entry).  Back to our example. If I bought in at $20.07 and the highest print on the chart that day was 20.77. Max Profit would be $0.70.  My question to answer is typically what features will allow me to predict that $0.70 with the least amount of error & risk.

SLIPPAGE MATTERS! BIG TIME! I ran a Monte Carlo. 10,000 iterations. Running the same model where slippage was not subtracted from max Profit and when it was.  These were the results.

There are MANY interpretations of this.  I’ll offer a few.

  • RMSE is sensitive to large numbers creating the flaccid bi-nomial distribution in the bottom graph.  Large numbers potentially produced by small max profits and large spreads. IE CMG’s spread is about $0.20 where could be Max Profit = 0.05.
  • The top graph RMSE, max profit, is normally distributed in this model because individual stock differences for max profit are not enough to disrupt the distribution.  Which suggests that my ability to predict a stock is potentially easier.
  • SPREADS MATTER! The difference between the two graphs is caused by individual stock characteristics in the spread.  Like, two people, no spreads are ever really the same.  The error for my prediction goes up as we account for individual differences.

I think this illustrates something we experience every day in life. We have general predictions about what people will do in a given context (features) but everyone often does something unique which can not be accounted for.  I believe the bottom graph illustrates this.  It also illustrates why your real life trading profits may not reflect model performance if slippage is not included.  Because what happens. When I thought I was going to make $50.00 I only made $35.00…. Slippage!


Posted in Algo Trading | Tagged , , , , , , , , , , , , , , , | Leave a comment

Zen & The Art of Trading

I’ve been listening to a lot of Allan Watts lately.   He is largely accredited for bringing eastern philosophy into to western society in a highly digestible way.  What I want to focus on is knowing without knowing.

As a trader we spend hours scanning charts, searching for the setups we know best, that we know have a high probability of reward.  Though if it was that simple we would just automate what we do and sit at the beach all day.  There is something more I believe.

There is a feeling that occurs, a knowing.  You look at the chart and you know what it will do.  As if you have some sort of pre-cognition.  What is this? As if the stars have aligned and you somehow intuitively know.  When your brain kicks in you may second guess yourself, change your mind, look for evidence to verify this feeling but you know what you know.

The mind, however wants to make up a story about why you feel this way.  It is pointless.  Just as fire does not burn itself, nor does a knife cut itself.  You will not know what you know by logic, thought, or evidence.  You just know…

How often do you feel this as a trader?  What do you do when you have this feeling?  Do you journal it? Do you always take the trade?  Keeping track of these moments is critical in my success because there is a high order knowing I believe that I do not have access too directly.  Perhaps over time with enough sample, I can begin to understand what I do know or at least plug it into a deep learning model 🙂

Posted in Market Psychology | Tagged , , , , , , , | Leave a comment

Shut off the f*&king Podcast

This post will be a deviation from my series on Charlie Munger’s Cognitive Biases & Integral Theory in Finance.

As Americans we consume.  We consume as if our life depends on it.  When I say consume I’m sure you’re thinking, buying things on or dining out.  This isn’t what I’m talking about.  I’m talking all consumption. Listening to music, podcasts, buy materials, education, learning, and anything where you are getting new input.

SHUT ALL THAT SHIT OFF and just sit in silence for 5 mins.  Watch how fast those thoughts speed through your mind.  See if you can shut it off. I doubt you can.  Why? Because you consume and you can’t stop.

The dialect of my generation is consumption with purpose.  “Spend money on experiences. Spend money on things that will save you time. Spend money on education & learning, or just download free podcasts.” CONSUME!

Stop consuming. Let the mind relax. Let your mind f&^king dream again. Explore your thoughts without hearing Entrepreneur on Fire in the background. Shut off the F&^king podcast.  Start Dreaming again.


Posted in Market Psychology | Tagged , , , | Leave a comment

Charlie Munger – Cognitive Biases – Inconsistency-Avoidance Tendency

We tend not to behave in ways that are inconsistent with the beliefs we hold about ourselves.

Be careful about the beliefs you take on. We talked about this briefly in regards to integral theory with the post on Types.  Do you type yourself?  Do you read the attributes of the Cancer Astrology Symbol and take on those traits.  Do you read what successful traders do and label yourself as a successful trader?  According to a simplistic view of this bias, you would not behave in a way that would be inconsistent with a successful trader IF YOU TRULY believed you were. In my opinion, this is where it gets interesting.

We have the explicit and implicit selves and I believe we mainly have the tendency to avoid inconsistencies with the implicit self.  Let’s give an example. Ben tell everyone he wants to be a famous painter one day (explicit). However, even though he truly does want to be a famous painter his true belief is that he can’t.

When you talk to Ben he is vibrant, communicative and deeply passionate about painting.  He talks about all the things he could do and what he would do.  However, he goes home and watches T.V. Ben does not practice his craft of painting.  Why the discrepancy?  He truly does want to be a great painter at his core.  Here is where the bias comes in.

His core belief is that he can’t become a famous painter. So he acts according to that belief. He watches T.V. He hangs out with friends and avoids painting at home.  the implicit self, in my opinion, rules the day.

This bias also works on the positive side of things. If I believe myself to be a good person and I’m put in a position to question that moral, say by having to donate money to an animal charity. I am likely to donate. We all are.

In factor analysis, this is called the discrepancy function. It’s the difference between the original matrix and the reconstructed one.  I believe as human we work to minimize this function as best we can whether it helps us or hurts us.

Posted in Market Psychology | Leave a comment

How to Keep a Trading Journal

Keeping a trading journal is a critical aspect of becoming a good trader.  You’ll never know what you did wrong unless you can objectively witness the prior trades you took; good or bad.  Then the next question becomes well once I’ve witnessed my profitable trade or error how I avoid it again?  We’ll chat about that in another blog called “How to practice trading.”

There are so many ways, tools, and programs that will help you keep a journal but if you are like me none of them really stuck or worked well for my day trading style.  After all, who has time to spill all their emotions, intuitions, and thoughts while trading?! Not to mention market conditions, entry & exit prices and who else knows what information may be relevant to your style.  To me text is dead in this case. It’s too slow and you have more important things going on than talking about your stupid feelings. 🙂

We are going to draw on integral theory’s quadrants to establish a methodology that will allow us to focus on all aspects of the trade.  You can do this with pictures, text or video.

How to create a trading journal.

Upper left Quadrant: What were the intra-day fundamentals. Essentially why were you looking at this stock? Did you get an alert? Did you see if pop up because of a signal from trade idea? Did your algo say, “buy here.”  Did they release earnings? Did they get an upgrade?   These are some examples of the interior aspect of a trade.  Think “why am I trading this stock.”

Upper Right Quadrant:  Essentially we are talking about Technical analysis.  Did it come into a supply zone? Did it make a head & shoulders top? Did it have a candle stick pattern you liked? Objectively, what was this stock doing? Chopping? Trending? etc

Lower Left Quadrant: This is where it can get tricky this quadrant is about shared meaning/value. An example of this is language.  I interpret this now as the sentiment of the stock.  What do WE, as a collective, believe about this stock? What do WE as a bull (or bear) believe about this stock?

Lower Right Quadrant:  Intersubjective.  Economic systems fall into this category, so would a mechanical failure on the stock exchange.  It can also be interpreted as: What was the market doing? How did the SPY or Oil or whatever market gauge you like to use, perform with your stock? What artifacts were left behind? Do you see a stream of red candles of green?

This would Look like the following:  You can either download a program like Greenshot to capture pictures from your screen and edit them (this is a free version of snagit) or write in a journal when you want. Displaying the picture will give you the best idea of how to review your trades using integral theory and create the trading journal that will hopefully make you a better trader.

Remember you want a journal that will cover all aspects of why you did what you did without taking up loads of your time.  You need the best information and I believe integral theory helps focus us to pull only relavent information.

As I continue my study of Integral theory by Ken Wilber my understanding of it changes.    This is, according to my understanding, is the first attempt to understand finance in an integral frame work.  This is Integral applications In finance.

Posted in Market Psychology | Tagged , , , , , , , , , , , | Leave a comment

Charlie Munger – Cognitive Biases – Liking loving Bias

This is one of my favorites. When you hear a trader say, “I love this stock.” You know they are preparing themselves for distorted facts, ignoring reality and misinterpretation of the facts merely because of their affection towards the stock.

Yes, I said affection.  My belief is that similar to relationships we become married, infatuated, angered and involved emotionally with stocks.  The relationship can last for a couple hours (a fling) or for months, even years (marriage).  As you develop this relationship, regardless of time, you develop feelings.  You’ll hear this in traders talk. “I love this stock.” “I understand how it moves.” “I just get it with this one.”  Sound familiar?

It’s great you found your love and if it’s healthy, you’ll be profitable.  However, there are biases you will experience because you have developed feelings.

  • Not believing the pattern:  Your significant other always buys you ice cream after the market closes.  Last Friday they didn’t show up with ice cream.  You may dismiss this as an anomaly but the truth is your significant other meet someone else and will no longer be bringing you ice cream, you just have no idea.  Monday you wait, Tuesday… you get the idea. Mean while you’re pissing away money waiting for the same pattern to develop that is now gone.  Guess what. Time to move on.
  • Distorting Reality:  2 weeks go by and you are still trying to catch that same pattern.  It finally happens and you say, “omg yes finally, she’s back.” but it turns out they just had a fight and you’re still shit outta luck.  This also reinforces the operant conditioning that has been happening.  Your perception of reality is no longer accurate, you make allowances that you would not normally make because you have feelings.

Feelings aren’t all bad in the market but the right ones are key.  When “the stars align,” you just know.  It’s a gut feeling.  When you like/love someone or something your reality with it will change. It was an adaptation that was passed down.  It works evolutionarily that if someone in your party fucked you over but you like/loved them and needed their cooperation in the future… It makes sense that you should distort reality for the greater good that is your survival and continue to work with them.  However,   The superfluous feelings you develop for a stock that once made you money though deserves there rightful place in the bowels of memory.

Posted in Market Psychology | Tagged , , , , | Leave a comment

Charlie Munger – Cognitive Biases – Reward and Punishment

Incentives or rewards are powerful motivators for us.  They drive us to start & stop behaviors we enjoy or dislike.  This powerful concept affects us every day we trade both explicitly and implicitly.

Explicit incentives.  It’s very simple the more money we make the more we are incentivised to repeat those behaviors.  There is no boss that, says, “If you make double what you risked today, I’ll give you a 10% bonus.”  We do however, have a voice that tells us we’d be better off with more money

Implicit incentives: These, I believe, is what really motivates us.  Knowing that if you make more money you live a better life.  This illusion or fiction that you create incentivises you to make more money at trading.  This can be a dangerous path to take.  Because we may not be associating the correct behaviors with profitable trading.  A great counter example of this is over trading.  When we believe that trading for the sake of trading will yield a profitable result.  An example of a proper correlation with good profitable trading behaviors is typically, finding your patterns and playing those.

Let’s go Freud… The repetition compulsion.  You are not always rewarding your self with what is considered “good.”  You will see this with the popularized movie 50 shades of grey.  Being hit isn’t necessarily a “good” thing to most people but to some it’s rewarding.  The same thing can happen while trading.  If you have an underlying belief that, “You’re a bad trader,” or “I’m no good, i can’t do anything right.” You are rewarding the most powerful part of your brain (the unconscious)  every time you may a bad trade. You repeat this stressful pattern repeatedly, this is the repetition compulsion.  It’s my belief, that you repeat it, so you can become aware of it, so that you can have that cathartic moment to finally release it.  Sadly, however, this often is not the case.

Don’t ever underestimate the effects of rewards & punishment on your behavior.  They operate within and without our awareness.

Posted in Market Psychology | Leave a comment

Intregral Theory – Market Algorithmic Development

Integral theory. Never leave home without it.  The new algorithm I’m testing is the 5-34 strategy.  I found it on a website a long time ago and the gentleman seemed to speak highly of it.  It’s a simple exponential moving average crossover strategy.  Before I go and tweak risk parameters, entry & exit locations, and overnight holdings I consult the integral framework.  Here is how.

Lines: What set of “skills” / Attributes does the stock need?  If we can define something as intangible as a “spiritual” line of development I can certainly define a volume line of development and a price line of development.  What attributes do I want this stock to have? High volume? Price great than $10? Strong beta? strong correlation with the sector?  All of these questions are valid as you do the same filtering when selecting a mate. Is she smart? Do they care for themselves, etc.

Levels: I sort of touched on this in lines by stating qualities of the lines such as High, low, medium, strong, and weak.  What level of development is the beta at? 0.02 or .95 beta?  How level of volume exists? Average of less than 1,000,000 or great than 10,000,000 on average?

States:  States are often temporary, and in my opinion, are expressed in terms of intra-day fundamentals.  Was it downgraded or upgraded? Did it just release earnings and is now in a state of frenzied buying? Are buyout rumors circulating?  These temporary bursts of volatility I  define as state dependent movement.  The stock will not move the same after earnings unless there is something that helps maintain that exuberant state.

Types: I define type as a sector.  Is it in the financial sector, technology sector, etc.  When someone asks “what type of stock it is” often people define it in a qualitative form.  Someone may ask “what type of stock is AAPL.”  “A technology company that makes computers…” a person may reply.  I don’t often hear people define stocks in terms of their lines & levels such as It’s an extremely (level) volatile (line) stocks.  They may go on to describe these attributes if asked for more information, but this is beyond the “Oh yes, Jerry is a nice person.”

Quadrants:  This section holds the bulk of my development.  We’ll go through each quadrant separately.  I have changed the order of the quardrants to make the most challenging one last (Upper-left).  We’ll start with the easiest, Upper-Right

  • Upper-Right: The external behavioral space.  How does this stock behavior.  Is it forming patterns? Does it respect those patterns? How does the stock move? Does it trend or chop?  In the upper-right quadrant, you can witness the behavior of the stock, it’s verifiable and real.
  • Bottom-Left:  What does the collective “us” think about this stock today?  I am going to repeat myself and say, does it form patterns & does it respect them. We must discriminate between these two statements in the different quadrants though.  When we look at at chart we can all see different patterns emerge, but the difference with the quadrant is do we as a collective agree that we see a head & shoulders or double top.  This is what will change the emergence of a pattern and it’s ability to fulfill it’s “destiny” from simply noticing their existence in the chart.
  • Bottom-Right:  The collective system.  Is the stock hard to borrow? Are there any regulatory or tax rules that impede or assist me trading this stock?  Are there any technology systems that I can take advantage of?  This section also holds the concept of relative strength.  Is this stock strong or weak compared to it’s sector and compared to the broader market.
  • Upper-left:  The internal space.  What does this stock think about itself?  This is a challenging conception. Does the stock even think?  I believe it does and here is why. As humans, we’re conditioned by the other quadrants to form internal conceptualization.  A “spoon” is not a spoon if we are never taught it’s a spoon.  So we can’t hold up a “spoon” and say, “it’s a spoon.” I believe the stock equivalent is the formation and fulfillment of patterns.  Since stocks can not speak (like animals) we look for patterns that define an internal state.  This dog has a wild temperament while this one likes to sleep & is very calm.  This stock is wild, volatile and usually, drops after creating a double top.  It has an identifiable unique pattern different from every other stocks.  The real philosophical issue with this quadrant in terms of stocks is that you can never enter someone elses internal state.  It’s sometimes impossible to know it exists since you never have direct access to it from an objective standpoint.  However, as humans, we can get close to understanding someone’s internal state and we call this concept integrity.  Are they telling me what’s really going on in their head?

As I develop the 5-34 strategy I will continue to post in more detail about how each of these is expressed in my code.





Posted in Market Psychology | Leave a comment