Neural Market Trends

Current Status: Up in Air

Investing in the S&P500 beats AI Trading

I forgot to link to this image back in early May 2019. It's from Bloomberg and it makes a lot of sense, maybe eye opening for some.

Investing in the S&P500 beats AI Trading

Essentially it shows that the market is the be and end all. Of course the market is an average and there are funds or AI traders that beat the average, but others will underperform the average. Over time, your little 'edge' will eventually underperform and you have to keep writing new code and new strategies. You can write all the trading algorithms you want but in the end it'll be futile.

If you started using the AI back in 2016, you would've outperformed the S&P500 for a short while but then...

Save your time and just do passive investing. Buy high quality funds and ETF's with low expense ratios over a diverse asset class. That's it. Then rebalance once or twice a year.

Yeah, but Tom you post Forex and Stock stuff from time to time. Yes, I do and I have some 'mad money' that I trade to satisfy that itch. Do I trend follow with that mad money, yes. Do I go long or short currencies, yes. Have I started writing Python scripts to crunch market data and build charts? Yes, I do that so I can learn Python better and it's what I do to keep myself in the market Zeitgeist.

comments

Market Trends

Identifying market trends is like eating and drinking the Zeitgeist. It has to be inside you to understand it. You have to be social, go outside, go to parties, etc. If you're not "hip" then you'll never see emerging trends until they're already established. Then it's a matter of chasing their coattails and riding them for a bit.

Years ago Howie had a great tag-line for his blog, it was "Trends… Find them, ride them and get off." I thought that was a great way to frame the problem and represent one way to generate "alpha" for the short term. Get in on a trend before it takes off and then ride it up (or down). The next trick is getting out, as Howie so eloquently puts it, "ride them and get off."

Identifying Trends in Stocks

Trend following in stocks has been around ever since a market has existed. Tulips anyone? It's super easy to do if you access to a computer. All you do is load up your favorite stock, set the time period to daily or weekly, and it should become readily apparent which way the trend is going.

TRTC, 11/25/2019

Some traders and investors like to use moving averages, usually the 50 and 200 day/week moving averages to confirm that the stock is trending higher or lower. Since I like to be positive, I really like up trends relative to down trends, but both are very useful for things happening in the social sphere (see below).

Identifying Social Trends

This one is trickier because because it requires you to leave your computer screen and go out into society. You need to observe, read, mingle, and talk. I know that this can be tough for introverts - and a lot of good traders/investors I know are introverted - but you have to put on your social shield and go out.

Having kids is good too, or at least access to nieces and nephews. You can ask them what all the kids are buying or having bought for them. What are they playing, what's cool, etc. Right now it's Fortnite, Discord, and iPhones. This is how I learned about the Minecraft craze and ended up going long in Microsoft. Granted, Minecraft is now "so old" but it's still played by millions of people and Microsoft is doing well.

Note: I didn't just buy MSFT because my kid was playing Minecraft, I really like what their cloud strategy is for Machine Learning and Data Science. I think they're going to hurt Amazon and beat Google quite handily, but that's a topic for another post completely.

MSFT, 11/25/2019

But that's technology. What about retail, fashion, and other consumer type goods? For that you have to "go shopping" or at least visit the mall. I rely on my wife for a lot of retail and fashion stuff. For consumer goods or building related things I usually visit a Lowes or Home Depot.

TGT, 11/25/2019

I also talk to my Engineering friends, now that I'm out of that field. If they tell me they're busy right now then I can expect a 6 to 9 month follow through in the economy. Right now, they're not so busy because the holidays are coming. What happens in January will really sets the tone for 2020.

End Notes

While I like looking at stock charts, I really feel that the smart money is made when you buy and buy-in low. Of course you can get a clunker like TRTC (that's my loser from years ago), but with good risk management and a smart entry, you can really ride things up. Of course, you don't make any money until sell, and finding price point can be very hard. What are some good spots to sell? I'll share that in another post.

comments

Downloading SEC.GOV data

I've finally found a way to download SEC.GOV data in a consistent and less stressful way. I want to give the University of Notre Dame Software Repository for Accounting and Finance a shout out for their excellent work. Thanks to them I can finally start taming this beast.

I've struggled for years trying to figure out how to download SEC data. That repository is so wacky that it's hard to find filings in there. The Notre Dame researchers created some python scripts that will let you automate the entire process. They even included parsing scripts that will extract textual properties of the document. These properties are what I like to call "pre-labels" or draft targets for machine learning.

After parsing the 100,000's of 8-K and 8-K/A documents, I was able to generate a referernce spreadsheet, see below. This is about 90% of the way to a final training set. All I need to do is generate a label from this information and then insert the entire SEC document into the training set (without HTML tags!). Still a few more preprocessing steps but it's almost there.

8-K SEC Documents Processed

There's a couple of things to note if you want to use their scripts, you'll need to tweak them to work for you. I took me about a day to figure everything out and then organize it the way I want to. I create a /downloader folder and put the scripts in there with an /EDGAR to hold all my downloaded text files.

For processing those files I created a /dataprep folder that contains all scripts that generate the "pre-labels." My future HTML preprocessing script will sit there first before I merge them together into the main Generic_Parser.py script.

If you want to use these scripts note that they are not for commercial use. As of today the software is licensed as: "All software and data are provided on an "as is" basis, without warranties, for non-commercial purposes. The software is free for academic researchers."

comments

Managing Your Time with Stoicism

Lately I've been reading Seneca as part of my exploration of Stoicism. There's a lot of great things here and I recommend you check out the video and my notes below:

To live well we must be constant students of life

  • Seneca's essay "On the shortness of life" reminds us that time is a non-renewable resource
  • Treat time as a commodity, people guard their property but squander time
  • The amount of time we get is uncertain, you could die at 20 or 100
  • Death creeps up on time wasters
  • Make the most of time, it is an amplifier when used properly

Don't invest your time preparing for life

  • Seneca pushes us to live right now and not to delay happiness
  • Your typical life is work till 60 and then wait to be happy
  • What usually happens is your old to enjoy life then and regret not making most of life
  • Planning the big things in life but don't delay living it

Live life for your own self

  • Being busy with things we don't like is the greatest distraction of your life
  • We waste time at jobs we don't like, relationships we're not happy in, etc
  • Invest your time into making a life worth living

Practice Premeditatio Malorum

  • While you waste your time by procrastinating, life goes on
  • Researchers call the dissonance of "short-term gratification vs long-term commitments" as time inconsistency
  • To fight this, use Premeditatio Malorum which is a form of negative visualization
  • Think of what could go wrong with your long term task and then make plans to achieve it. This will offset the distractions

Make Long Term Rewards Immediate

  • The need to procrastinate it he most powerful RIGHT at the start of work
  • When rewards are years away (i.e. diploma, career, et), you tend to procrastinate
  • To overcome, you must bundle a reward at the start of the task
  • You can eat a piece of cheesecake when you lost 10lbs or give yourself time to browse the web once you finished those pesky spreadsheet task

Make the Most of your Free Time

  • Too often we waste our free time with stupid stuff. Gossiping, drinking at the bar, etc
  • There's plenty of time to do everything we want if we just stop wasting our free time
  • We work hard to earn money and free time, so why waste that precious free time
  • Use your lunch hour to explore the city, write in a journal, play an instrument, reading, etc
  • To beat mediocrity and start living your life, make the most of your free time

Spend time reflecting on your past

  • Present time is transitory (it's moving), Future is uncertain, the past is unalterable
  • Seneca says pay attention to the past, so you can be effective today
  • Personal note: Journaling is a wonderful way of capturing the past

Stop Wasting Time in Life's Trivialities

  • We are all guilty wasting our time in trivialities (Social Media)
  • Social Media sucks your time away
  • When your happy you fill your time with activities that are valuable and meaningful to the vision you want of your life

Invest your time creating new memories

  • While you preoccupy your time with trivialities, death approaches that you can't escape
  • Invest your time into creating new memories and philosophies
  • Memory is more enduring than grief (Ed. Very true. I call it Adventuring)
  • Memories may be fleeting but they deliver more happiness than anything else
  • Do yourself a favor and take on challenges and adventures, learn to play music, travel, etc

Invest your time in Philosophies

  • The Study of Philosophy is the most invaluable teacher
  • Study as much of philosophy (current, past, etc) as you can because it will help you in your life
  • Your life will expand and your wisdom will grow
  • A Philosopher is a lover of wisdom: truth, virtue, life and death

comments

Autogenerating Support and Resistance Lines for Forex

On the heels of my last post, I've extended those functions to the EURUSD pair. The data starts from this year 2019 and goes through to yesterday. It's actually a pretty neat script as it takes data from Onada and then generates the support and resistance lines for that particular pair. The next step would be to create a buy/sell order in the Oanda Practice Account. Once I do that it's then a matter of writing a trading strategy and testing it in real time.

Everything I'm doing is completely academic and modular right now. I have no idea how really build a Forex Trading Bot or even what strategies to use here. It's more of a "can I do it" endeavor.

Autogenerated Support and Resistance Lines, EURUSD

I'm fully convinced that retail traders that can learn Python can automate their entire trading strategies. Now, the flipside here is if their strategies are worth anything. Just because we can automated trading setups, we must always ask "why do I think I'm right?"

comments