Trading Strategy

A trading strategy is a plan (often implemented in an algorithm) that defines when a trader will place orders to enter and exit an investment. Trading strategies range from simple sets of rules that an individual follows all the way to highly complicated applied artificial intelligence computer systems.

Many successful trading strategies go beyond orders to buy and sell. They often include risk management, hedging, and money management.


Futures Radio Show interviews Morgan Slade December 12, 2017

CloudQuant’s CEO was interviewed by Anthony Crudele of Futures Radios show to discuss topic including Artificial Intelligence, Machine Learning, and Deep Learning applied to algorithmic trading. Alternative datasets are a major topic of discussion. People are saying that data is being created faster than ever before. That really isn’t true. What is really happening is that data is being captured and stored at a faster rate than ever before. Vendors are now making AltData available for traders to change the way that they interact with the markets. This applies to futures and stocks with the popularity of Deep Learning in algorithmic trading strategy development.
Candlestick market data chart

Understanding Candlestick Bars & Market Data for Beginning Algo Programmers

In this video, we introduce you to Candlestick Bars, a store of Historic Market Data, how to access that data via Pythons Lists and how pointers work in lists.

Catalent Inc. – $CTLT – Bearish Engulfing Sell Signal

There was a fresh sell signal for Catalent Inc. stock this week. The recent rally has been put on hold with the emergence of a Bearish Engulfing signal. More selling pressure is expected to develop as the market degrades from the steep upward slope it has been trending on. This post shows a trading signal and has algo source code links.
Researcher reading iPad

Industry News: Machine Learning and Artificial Intelligence for December 4, 2017

Grace: Going back to what you are doing now with CloudQuant, I understand that you have a trading strategy incubator where your team has the experience, the technology, the capital and allows algo traders to essentially get a strategy funded. Can you tell us more about that and the vision behind it?
Open, Close, High, Low

Share Ordering Demo using Market, Limit, and Midpoint Peg Orders

The CloudQuantAI github repository holds the share_ordering_demo tutorial/code that demonstrates ways to buy and sell stocks in the CloudQuant backtesting engine using Market, Limit, and Midpoint Peg Order types. There is no single “right way” to do any of these. You will have to think carefully about your algorithm, how it determines when to buy and sell, how large a trade you want to implement, and how quickly you need your orders filled. To give an example, let’s imagine a hypothetical stock XYZ, at time t0 with bid prices at 29.95 and ask prices at 30.05.

Market Orders

One option is a simple market order: order_id = order.algo_buy(self.symbol, algorithm=”market”, intent=”init”, order_quantity=num_shares) This means that your order will fill at the lowest price someone is actively willing to sell it at. In real trading, you would never buy significant shares of stocks like this, because people will raise their ask price when they realize someone is buying large volumes on market. In backtesting, however, it is essentially assuming you are buying at the ask price for that time, which is reasonable. Your order will always fill immediately, and the only risk is that if the stock price shoots up, you will be paying whatever price the stock goes up to. In our example of stock XYZ, you are buying at 30.05 at t0, though if your order is placed at t0, you may be purchased at the ask price at time t1, which could be different from the ask at t0. Market orders will simply purchase at whatever that ask price is.

Limit Orders

Another way is to initiate a limit order, based on the ask price: order_id = order.algo_buy(self.symbol, algorithm=”limit”, price=md[self.symbol].L1.ask-.01, intent=”init”, order_quantity=num_shares) or order_id = order.algo_buy(self.symbol, algorithm=”limit”, price=md[self.symbol].L1.ask*.99, intent=”init”, order_quantity=num_shares) These two algorithms place an order for a stock with a limit on the price. In the first case, we set a limit one cent below the ask, and in the second our limit is 99% of the ask price. These are likely to get filled, but not guaranteed, though they will get a better deal than a simple market order. The farther below ask you go, the better a deal you might get, but the higher a chance that you won’t get filled. The lowest you can go is probably 95% ask or 5 cents less than the ask. If it’s important that you get your order filled immediately, you will want to place a more aggressive limit, such as the ask price PLUS 5 cents or 105% the ask price. This is similar to a market order but will keep a lid on how much you actually will pay for the shares. This is a critical distinction in live trading, but less important in back-testing. In our example of stock XYZ, if we, at t0, place a limit order one cent below the ask, we are essentially offering at t1 a price of 30.04. Cloudquants backtesting environment does its best to approximate whether someone would have been likely to meet our price limit or not. If the price of stock XYZ moved up at t1, there is a very high chance we would not have been filled. If, however, we set a limit of ask + 5c, we would have placed a limit at $30.10, and we would have likely been filled unless the stock shot up more than that.

Midpoint Peg Orders

Finally, we have a slightly more complex way of computing our trade price, using a “midpoint peg.” This algorithm is only available in the elite version. order_id = order.algo_buy(self.symbol, algorithm=lime_midpoint_limit_buy, price=md[self.symbol].L1.ask*1.05, intent=”init”, order_quantity=num_shares) order_id = order.algo_buy(self.symbol, algorithm=lime_midpoint_limit_buy, price=md[self.symbol].L1.ask+.05, intent=”init”, order_quantity=num_shares) You will also, earlier in the code, need the lines: lime_midpoint_limit_buy = “4e69745f-5410-446c-9f46-95ec77050aa5” lime_midpoint_limit_sell = “23d56e4a-ca4e-47d0-bf60-7d07da2038b7” Though the exact algorithm is only available in the Elite CloudQuant version, you could approximate it in lite by using the mean of the ask and bid prices. This is similar to what the “Lime” midpoint peg does, but the real version should include elements such as the volume of the shares to more accurately estimate where the price would have been. If your trade doesn’t need to urgently fill, the lime midpoint peg is a good way to go, however, if your trade requires an immediate fill, this may give you unrealistic purchase prices, and make your algorithm seem better than it really is. In our XYZ example, this essentially assumes we would always be purchasing shares of XYZ for $30.00 at t0, and then the average between bid and ask at t1, and so on. The public scripts with these examples are available for your copy and re-use.

$GE – Short Term Buy Signal – Piercing the Line

Technical analysis shows a piercing the line trading signal. This post includes links to source code show how to capture this signal with TA-LIB
Quantamental alternative data

The Rise of Quants in Trading and Financial Markets

Cloud computing and access to industrial grade investment and data science tools are changing the playing field for quantitative trading firms. CloudQuant’s CEO Morgan Slade participated in a panel at Stocktoberfest West in October 2017. This has raised the discussion of quantamental investment and data science techniques. This is the merger of technology, investment management, and data science.
Bullish Turn of Events for Sprint - S by Theodore Kekstadt

Bullish Turn Of Events For – $S: TA-LIB Three Outside Strategy

This stock has been on a negative slide for months, and every bounce has been one to sell into. The outlook is different for this current turn in direction. A “Three Outside Up” Japanese Candlestick reversal pattern… Source code for signal links included.
Improved Breakout Strategy

Industry News: Machine Learning and Artificial Intelligence News November 13, 2017

AI & ML news covering: the creative process, improving skills, ETFs, Risk, Supervised Learning, RiskGenius, Robo Cops, Fears, NVidia, Quickbooks, SEC Edgar …
Trading Strategy Scorecard from CloudQuant

52 Traders Interviews Morgan Slade

, ,
The podcast on Massive 30,000 Trades Daily, High-Frequency Quant Trading with Morgan Slade including an interesting breakout trading strategy.