Design a site like this with
Get started

My First Simulation

Our first simulation will be simple. We will buy the S&P 500 when it’s 50 day moving average crosses above it’s 100 day moving average, and close when it crosses back below. Please note, this simulation is only meant for learning and is not a suggested trading strategy. Calculating Moving Averages in Python: data[‘SMA50’] =Continue reading “My First Simulation”

Python for Data Analysis

  • Lists
    • Defined using square brackets
    • Example: people = [‘Tom’, ‘Dick’, ‘Harry’]
  • Dictionaries
    • Defined using curly braces
    • Example: stocls = {“CAKE”:”Cheesecake Factory”, “PZZA”:”Papa John’s Pizza”, “FUN”:”Cedar Fair”,}
  • Libraries
    • Pandas (time series processing), MatPlotLib (visualizing data) – most common libraries for Financial analysis in Python

Sharpe Ratio

Today I read the section on risk in Trading Evolved. Portfolio risk is something that is frequently misunderstood in the industry. Many people associate trading risk to various risk strategies that they learned in the casino. Pyramiding for example, a strategy of adding money to your bet every time you win (or buying more shares every time stock price goes up), is a false sense of understanding your risk. It is most important to understand you reasons for entry and exit points in a particular trade. The best measurement of risk is the sharp ratio…

  • Sharpe Ratio = ((AnnualizedReturns – RiskFreeRate)/AnnualizedStandardDeviation)
    • OK to use 0 as RiskFreeRate to simplify things
  • Higher the sharpe ratio the better
  • Having a sharpe over 1 is rare
  • Having a .7 or .8 sharpe can still provide a successful and profitable trading strategy
  • Sharpe of 3 of 5 exist but they will likely have negative skew. Many small positive returns and one large negative return

Getting Started – Day 1

I have 10+ years of experience in the finance industry. My understanding of systematic trading strategies is high but my programming skills ranges from beginning to intermediate. The end goal of this process is to build my own successful automated trading strategy. After some research, I found it best to start my journey with the book Trading Evolved by Andreas F. Clenow.

As I begin reading the book I have decided to create a resources and scenarios page. The resources page will provide a list of books and articles for anyone interesting in learning more about systematic trading. The scenarios page will provide various trading strategies to test your ability to back test systematic trading strategies. I will continue to build these pages (and likely come up with more pages) as I continue to add blog posts.

  1. Scenario 1:
    • Long only equities
    • Holding period = long term capital gains
    • Low correlation to equity strategies
    • Downside protection

  1. Purpose of scenario 1:
    • Achieve near zero or negative correlation
    • Scale to 100s of millions
    • Show modest couple of percent per year
    • Improve diversification & enhance overall performance

  1. Scenario 2:
    • Stock falls four standard deviations below is 60 day linear regression
    • Expectation is that stock will bounce two standard deviations up
    • Test variations of the above:
      • Change linear regression to 30 or 90 days
      • Change bounce to 3 or 5 standard deviations up

  1. Books:
    • Python for Data Analysis
    • Python for Finance
    • Systematic Trading
    • Trading Evolved

And remember, computers are only as smart as the person programming it…