Thoughts about the markets, automated trading algorithms, artificial intelligence, and lots of other stuff

  • A Statistically Significant Edge

    Last week we discussed that just because a trading system is making money doesn't prove it has an edge.  It means you have both the chance that the system has an edge – and also that it may just be lucky.

    One of our advisors wrote back to see if they understood that approach.

     

    The odds of flipping a coin and getting heads 25 times in a row is roughly 1-in-33 million. So if we have 33 million flippers and 100 get 25 heads in a row, statistically that is very improbable.  We can deduce that group of 100 is a combination of some lucky flippers, but also that some have a "flipping edge."  We may not be able to say which is which, but as a group our 100 will still consistently provide an edge in future flip-offs.

     

    Well, that is correct.  In fact, if we were developing coin-flipping agents that would be as far as we would be able to go.  However, we are in luck because our problem has an extra dimension, which makes it possible to filter-out some of the "lucky" Bots from our trading systems.

     

    Determining Which are the Best Systems.

     

    There are several ways to determine whether a trading system has a persistent edge.  For example, we can look at the market returns during the trading period and compare and contrast that with our trading results.

    This is significant because many systems have either a long or short bias.  That means even if a system does not have an edge, it would be more likely to turn a profit when its bias is in alignment with the market. 

    We try to correct that bias using some math and statistical magic, in order to determine whether the system has a predictive edge.

     

    It Is a Lot Simpler Than It Sounds.090523 Roulette Wheel

     
    Imagine a system that picks trades based on a roulette spin.  Instead of numbers or colors, the wheel is filled with "Go Long" and "Go Short" selections.  As long as the choices are balanced, the system is random.  But what if the roulette wheel had more opportunities for "long" selections than "short" selections?

    This random system would appear to be "in-phase" whenever the market is in an uptrend.  But does it have an edge? 

    One Way To Calculate Whether You Have An Edge.
     

    Let's say that you test a particular trading system on hourly bars of the S&P 500 Index from January 2000 until today. 

     

    1. The first thing you need is the total net profit of the system for all its trades.  
    2. The second thing you need to calculate is the percent of time it spent long and short during the test period.
    3. Third, you need to generate a reasonably large population of completely random entries and exits with the same percentage of long/short time as your back-tested results (this step can be done many times to create a range of results). 
    4. Fourth, use statistical inference to calculate the average profit of these purely random entry tests for that same test period. 
    5. Finally, subtract that amount from the total back-tested net profit from the first step.

     

    According to the law of large numbers, in the case of the "roulette" system illustrated above, correcting for bias this way, the P&L of random systems would end up close to zero … while systems with real predictive power would be left with significant residual profits after the bias correction.

    While, the math isn't difficult … the process is still challenging because it takes significant resources to crunch that many numbers for hundreds of thousands of Bots. 

    The good thing about RAM, CPU cycles and disk space is that they keep getting cheaper and more powerful.

  • Venezuela’s Currency Value Dependent on One Guy at an Alabama Home Depot

    Sounds funky right?

    Venezuela has been dealing with a lot – collapsing oil prices, corruption, and hyperinflation.

    The value of their currency has dropped to the point where 1 bolivar is worth less than a penny, and the street value is legitimately dependent on a man that works at a home depot in Hoover, Alabama.

    Gustavo Diaz created a website called DolarToday that helps Venezuelans navigate their underground economy.

    It's so prolific, that it affects the price of almost everything; affecting approximately 15 million dollars of transactions each day. 

    His site has an online calculator, that uses algorithms to give you the "actual value" of your bolivars.

    It's illegal, in Venezuela, to publish exchange-rates outside of the government's officially set currency rate – but Diaz's site does just that … basing prices off of what people are paying on on the underground market. 

    Now, in real life, Gustavo Diaz is a political refugee who was marked as an enemy of state after participating in an unsuccessful coup against the government of Hugo Chavez.

    He strongly apposes Maduro's "totalitarian regime," and is still doing what he can to fight that regime from his Home Depot in Hoover.

    Gustavo Díaz at the Home Depot in Hoover, Ala., where he works.

    via WSJ

     

    In a year that's polarized us as a country  … It's important to remember you can dislike something and still love your country and its people.

  • Skill Versus Luck In Trading

    One of the goals of automated trading is to enhance performance by selecting systems with an edge (which by definition implies a higher probability than luck)

     

    090515 flip-coinCoin-Flipping For Fun and Profits.

     First, let's talk about luck.  Think about a nationwide coin-flipping contest.  At the beginning, each citizen is paired-up with another for a contest.  The winner goes on to the next round.  Think how many rounds you would need to win to be City Champion, State Champion, Regional Champion, etc. 

    At the end, someone would have won a large number of coin-flip contests.  Assuming they didn't cheat, they were lucky … but does the winner have an edge?  If so, what could it be?
     
    Finding The Edge.

    Likewise, just because a trading system is making money doesn't prove it has an edge.  Simply relying on whether something is profitable NOW means you have both the chance that the system has an edge – and also that it is just lucky.
     
    If it isn't just a matter of winning, how do know which are the best systems?  We are searching for clues to help find systems that do have an edge … or at least have an edge in certain market conditions.

    We have many trading systems, and a lot them test well over long periods of time. In our research, we use the term "Bot" to refer to a particular trading system operating on a particular market and timeframe.  Recently, we've been working on a project to design a validation protocol to help us determine which Bots have the most "skill" and to filter-out the majority of "lucky" Bots. 
     
    It is exciting as we solve more of the bits and pieces of this puzzle.
     
    The Next Step – Dynamically Selecting Trusted Bots That Are Now In-Phase.

    From a practical perspective, we aren't just trying to select trading techniques that have an edge …  In other words, we don't just need trusted bots … we need to select the bots that are most likely in-phase with current market conditions.  We'll talk more about this next week.

  • Switching Strategies

    We said goodbye to Duke today.  He was our faithful companion for 13 years.  He will be missed.

     

    161204 Saying Goodbye to Duke

     

    We did everything we could, until we couldn't … Then we switched to a different strategy.

     

  • What My Dogs Can Teach Us About Markets

    Yellow Lab Laying Down 200p  Some dogs run fast; other dogs do tricks … my 100 pound lab, Duke's best talent is his ability to remain immobile in almost any situation (some call it "laziness" … I prefer "calm" or "even-tempered").

    At the other end of the spectrum is Boo, our 20 pound mix between a Beagle and a Boston terrier. Let's just say that he has higher metabolism than Duke. 

    When Boo hears a noise, he lets out an involuntary, barely audible, sound.  His body becomes rigid and his head cocks.  He becomes alert and carefully tunes his ears to their most sensitive setting, seeking any information that will help identify the "danger." And now he's waiting for the next intrusion.

    Usually there are no other disturbances to follow, and the noise is cataloged and soon forgotten. His alertness level slowly subsides over the next 10-15 minutes or so.  He'll go back to napping, a little more fitfully this time … and just a little bit on edge.

    Things get a little more interesting when another noise surfaces shortly after the first one.  What could once be dismissed now must be treated as a threat – and just to be safe, a threat of the highest order.  Now the appropriate response is a series of barks, nervous glances, pacing, rushing off in the direction of the noise to investigate, and a barrage of barks meant to sound more menacing than the source of the noise.  Who or what is it? How much harm can they cause? How grave is the threat?

    Boo Alert Duke is a different story.  Nothing upsets Duke more than Boo.  The same noise that prompted Boo to become alert does nothing to Duke.  However the first time that Boo makes noise, that makes Duke alert. And the second time Boo makes noise, Duke starts vocalizing, and the third time, well now both of them start yapping and when they both start yapping, then other dogs in the neighborhood start yapping.

    I realized that the same thing happens in the market with people.

    In the market, it is the second noise – and subsequent noises – that creates the equivalent of the Homeland Security "Red Alert." Once an elevated level of alertness has been established, it takes a long period of relative calm for it to subside.  And when on "Red Alert" … any additional noises (for example, the responses of the other market participants) – big or small – will highlight, magnify and further validate the issue.

    But, like in the story "The Boy Who Cried Wolf," even legitimate threats are ignored after too many false alarms (or prolonged periods of constant alert).  So, bad news about the economy isn't as likely to get people excited after the past few weeks.

  • Feeling Thankful is a Weak Substitute for Being Thankful

    Thanksgiving is a holiday where we're encouraged to feel thankful for all the bounties in our life – and to appreciate those around us. 

    I enjoyed spending time with my kids, watching the Cowboys win, and eating too much.

      

    Fullsizeoutput_40de

     

    That's a great start; but, feeling thankful is different that being thankful.

    Think of it as the difference between passive voice and active living.  

    It reminds me of an idea called "Tikkun Olam" (or – healing the world).

    Even if you're not Jewish, I think we can all agree the world needs a little of that. 

    For example, instead of just feeling thankful, what could you do to make the life of someone around you better?  Likewise, how can you let others know that you're thankful for them?

    Transformational change is often easier than incremental change (because you don't have to drag the past forward).

    So, what can you do that would trigger 10X results?   Will you?

  • Here Are Some Links For Your Weekend Reading – November 27th, 2016

    Got this from a friend and thought it was funny.

     

    Experts have found the following analysis to be nearly 100% accurate.

    1. The Wall Street Journal is read by the people who run the country.
    2. The Washington Post is read by people who think they run the country.
    3. The New York Times is read by people who think they should run the country, and who are very good at crossword puzzles.
    4. USA Today is read by people who think they ought to run the country but don't really understand The New York Times.
    5. The Los Angeles Times is read by people who wouldn't mind running the country, if they could find the time and if they didn't have to leave Southern California to do it.
    6. The Boston Globe is read by people whose parents used to run the country.
    7. The New York Daily News is read by people who aren't too sure who's running the country and don't really care as long as they can get a seat on the train.
    8. The New York Post is read by people who don't care who is running the country as long as they do something really scandalous, preferably while intoxicated.
    9. The Chicago Tribune is read by people that are in prison that used to run the state, & would like to do so again, as would their constituents that are currently free on bail.
    10. The Miami Herald is read by people who are running another country, but need the baseball scores.
    11. The San Francisco Chronicle is read by people who aren't sure if there is a country or that anyone is running it; but if so, they oppose all that they stand for. There are occasional exceptions if the leaders are gay, handicapped, minority, feminist, atheists, and those who also happen to be illegal aliens from any other country or galaxy, provided of course, that they are not Republicans.
    12. The National Enquirer is read by people trapped in line at the grocery store.
    13. The Seattle Times is read by people who have recently caught a fish and need something to wrap it in.

     In this environment, the news can be harder to believe than fiction. 

    Here are some of the posts that caught my eye. Hope you find something interesting.

     

    Lighter Links:

     

    Trading Links:

  • My Son Is Disgusting …

    This Thanksgiving, my son Zach made a stupid bet with himself – that he could gain 10 pounds in one day.

    His mom and I both tried to tell him not to do it;  but we forgot a golden rule: Never tell a Getson they can't do something. 

    The image speaks for itself.

      

    Weight Transformation Thanksgiving

     

    He gained over 13 pounds.

    Even considering the weight normally gained on a Thanksgiving, that's "disgusticating" (worthy of a made-up word).

    Hope you enjoyed your holiday too!