Python Trading

The low learning curve Python programming language has grown in popularity over the past decade. Data Scientists, algorithmic developers, quantitative financial professionals, and market enthusiasts have helped this become a strong tool for algorithmic research, development, and trading. Python for the trading industry comes with tools including:

  • Jupyter notebooks
  • NumPy for High-Speed Numerical Processing
  • Pandas for Efficient Data Analysis and Time Series Analysis Techniques
  • Matplotlib for Data Visualization
  • TA-Lib for Technical Analysis
  • Tensor flow


Stock Market, Quantitative Strategy, Trading, and Algo Development Industry News

Short Term Stock Trading Strategies

Both The RSI And Stochastic Can Help You Create Profitable Short Term Stock Trading Strategies

I typically receive dozens of emails from traders who are just starting out asking me for help in creating short-term stock trading strategies. A few weeks ago I demonstrated a strategy using the RSI indicator; I received several emails from readers asking me to explain the difference between the RSI Indicator and the Stochastic Indicator. Without getting into complex mathematical formulas, the RSI indicator measures the momentum or velocity of price movement or in plain English the RSI indicator measures when prices moved too fast too soon. The Stochastic Indicator, on the other hand, is a measurement of the placement of a current price within a recent trading range. The theory is that as prices rise, closes tend to occur nearer to the high end of their recent range. Conversely, when prices drop, closes tend to be near the low end of the range. This is how the Stochastic Oscillator measures price levels. Both indicators are considered momentum oscillators because their primary role in most short-term stock trading strategies is to locate overbought and oversold market conditions. 
Read the full article on MarketGeeks by Roger Scott on May 9, 2017
Algorithmic Trading with other peoples money

My First Algo on CloudQuant

, ,
Last week I mentioned my efforts to produce an algorithm on As a reminder, they are a strategy incubator that provides historical data going back to 2011. If you can produce a trading or investment strategy that produces decent results they will license the algo from you and pay you a portion of the profits from that strategy. You don’t have to provide any capital; they provide it. This works for any python algo developer who are long on skills and short on capital. I used a well-documented strategy as defined in Jason Perl’s book “DeMark Indicators” (ISBN 978-1-57660-314-7 Bloomberg Press, New York 2008). The strategy is a Bearish TD Sequential Flip. This strategy is a basic technical strategy that utilizes bar data. CloudQuant lite, the default version, provides one minute bars. CloudQuant provides access to much more granular data on other versions of the data simply by requesting to be upgraded. For my purposes, and the purposes of this strategy the 1 minute bar data is perfect and fits easily for any python algo developer. The idea behind the strategy is to predict when a series of down bars indicate a time to buy. One hopes to buy low! The first component of the strategy is the “TD Bearish Price Flip.” The bear flip occurs when the close of a bar is greater than the close 4 bars earlier immediately followed by a close less than 4 bars earlier.
DeMark Indicator Sequential Bear Flip

TD Sequential Bear Flip in UNP

The second component is a countdown. The countdown gives a buy indication when an uninterrupted series of 9 closes occurs with each close being less than the close 4 bars earlier. Once we have the bear flip followed by a countdown of an uninterrupted series of 9 then I submit a buy at the market for that stock. This gets me into the position. To get out of the position I want to take profits or losses quickly. The strategy takes a profit at $0.15 per share and stops any losses at $0.30. If all this sounds complicated, it really isn’t. All told there are only about 60 lines of code written in Python. Python is easier to write than excel macros. There are more comment lines explaining what I was doing than lines of algo code. After back testing the strategy the results were mixed. Some losses, some winners. Nothing spectacular. The algo won’t likely get funded as written. The team at CloudQuant helped me out and placed the algo into their public scripts so that anyone can clone it and run the same tests. Better yet, you can use it as a foundation to start your own algo. Here are some ways that another python algo developer might want to consider to improve the strategy performance:
  1. Do a data study to optimize the target price for loss and profit taking.
  2. Do a data study to see if there is a max period of time that you should hold a position.
  3. Utilize other data other than just the close price in each bar
    1. Does the BarView open, high, low affect the success rate?
    2. Does the bidvol, or askvol affect the success rate?
    3. Does the vwap affect success rate?
    4. Does the spread between bid price and ask price change with success rates?
  4. Read the DeMark indicator book and apply more of the techniques past page 3 🙂
  5. Change the bar length to see if you can do this as a different time length
  6. Use a data driven approach to pick which stocks to run this algo upon
  7. Are there times of day approaches that would work better? Do the study.
  8. Does this strategy work for a market that is trending up or down better?
  9. Does this strategy work better for market capitalization size?
  10. This is implemented as a buy (long only) strategy. Implementing the sell short strategy could improve the returns.

Source Code to this strategy

The code is in the public scripts of the CloudQuant trading strategy incubator application. Access to this code does require registration.
quantitative algo trading conceptual dashboard

An Incubator for Trading Strategies

GLG Partners has hired a head of machine learning. Financial News reports that this is a new role entirely. The article points out that the volume of data that GLG is utilizing is growing. A similar article reports that BlackRock is putting a greater emphasis on computer models.
Kershner Trading, parent of CloudQuant

Kershner Trading Announces the Formation of CloudQuant

November 1, 2016

Chicago, Illinois

For Immediate Release

Kershner Trading Group, LLC announces the formation of CloudQuant®, a wholly owned subsidiary.

CloudQuant is:

  • an educator,
  • a facilitator for traders, technologists, and data scientists
  • a technology provider,
In short, CloudQuant is the Trading Strategy Incubator which will allow the trader, software engineer, data scientist or individual with an great trading idea to receive funding for an algorithm that has been tested and proven in backtesting.

CloudQuant began as an internal trading tool for traders with extraordinary trading ideas to be able to explore quantitative trading with the evolution of data science. The technology behind our innovative approach to incubating trading strategies began as an internal system and has been proven through daily use within the Kershner Trading Group. Kershner’s experience as a trading firm focused every day on the work of operating and executing profitable quantitative trading strategies provided the trading and technology expertise to design a platform that enables researchers to go from idea to production implementation in a matter of hours.

CloudQuant’s mission is to provide you with tools to develop and prove your trading strategies. We then license your strategy from you. Once licensed we assign capital from our funds to your strategy. Our professional traders, risk managers, and technologists oversee the running of the trading strategy.

When a client’s trading strategy makes money the client will be paid.  Loses are the responsibility of CloudQuant.