Contents:
Then you formalize these ideas into a strategy and "visually backtest " them on other charts. In this article, we go over the process from start to finish and offer important questions to ask along the way. Before a strategy can be created, you need to narrow the chart options. Are you a day trader , swing trader , or investor? Will you trade on a one-minute time frame or a monthly time frame?
Be sure to choose a time frame that suits your needs. Then you'll want to focus on what market you'll trade: stocks , options , futures , forex , or commodities? Once you've chosen a time frame and market, decide what type of trading you'd like to do. As an example, let's say you choose to look for stocks on a one-minute time frame for day-trading purposes and want to focus on stocks that move within a range.
You can run a stock screener for stocks that are currently trading within a range and meet other requirements such as minimum volume and pricing criteria. Stocks, of course, move over time, so run new screens when needed to find stocks that match your criteria for trading once former stocks are no longer trading in a way that aligns with your strategy. Creating a strategy that works makes it much easier to stick to your trading plan because the strategy is your work as opposed to someone else's.
For example, suppose that a day trader decides to look at stocks on a five-minute time frame. They have a stock selected from the list of stocks produced by the stock screen they ran for certain criteria. On this five-minute chart, they'll look for money-making opportunities.
The trader will look at rises and falls in price to see if anything precipitated those movements. Indicators such as time of day, candlestick patterns, chart patterns, mini-cycles, volume, and other patterns are all evaluated. Once a potential strategy is found, it pays to go back and see if the same thing occurred for other movements on the chart. Could a profit have been made over the last day, week, or month using this method? If you are trading on a five-minute time frame, continue to only look at five-minute time frames, but look back in time and at other stocks that have similar criteria to see if it would have worked there as well.
After you determine a set of rules that would have allowed you to enter the market to make a profit, look to those same examples and see what your risk would have been. Determine what your stops will need to be on future trades to capture profit without being stopped out. Analyze price movement after entry and see where on your charts a stop should be placed.
The books below offer detailed examples of intraday strategies. There are hundreds of strategies out there. The entire library centers around the Cerebro class. Market Wisdom on YouTube. DailyFX provides forex news and technical analysis on the trends that influence the global currency markets.
When you analyze the movements, look for profitable exit points. Where was the ideal exit point, and what indicator or method could be used to capture most of this movement? When looking at exits, use indicators, candlestick patterns, chart patterns, percentage retracements , trailing stops , Fibonacci levels , or other tactics to help capture profits from the opportunities you see.
Depending on how often you want to look for strategies, you can look for tactics that work over concise periods of time. Often, short-term anomalies occur that allow you to extract consistent profits. These strategies may not last longer than several days, but they can also likely be used again in the future. Keep track of all the strategies you use in a journal and incorporate them into a trading plan. When conditions turn unfavorable for a certain strategy, you can avoid it.
When conditions favor a strategy, you can capitalize on it in the market. In fact, if you do, you'll likely find no workable strategies. Using historical data and finding a strategy that works will not guarantee profits in any market. It is for this reason that many traders do not backtest their strategies, which is applying the strategy on historical data.
Instead, they tend to make spontaneous trades. This is a lack of due diligence. It's important to know a strategy's success rate because if a strategy never worked, it is unlikely to start working today suddenly.
That's why visual backtesting —scanning over charts and applying new methods to the data you have on your selected time frame—is crucial. Many strategies don't last forever. They fall in and out of profitability, and that's why one should take full advantage of the ones that still work. If something has worked for the past few months or over the course of the past several decades, it will probably work tomorrow.
But if you never looked to the past to test that strategy, you might not even realize it was there, or you might lack the confidence to apply it in the markets tomorrow to make money. Knowing that something has worked in the past will thus also give a psychological boost to your trading.
Trading needs to be done with confidence not arrogance , and being able to pull the trigger on a position when there is a set-up to make money will require the confidence that comes from looking to the past and knowing that, more often than not, this strategy worked. Look for strategies that net a profit at the end of the day, week, or year s , depending on your time frame.
Backtesting is a crucial element of any strategy that allows a trader to see how a trade worked in the past and will most likely in the future. Strategies fall in and out of favor over different time frames; occasionally, changes will need to be made to accommodate the current market and your personal situation. Create your own strategy or use someone else's and test it on a time frame that suits your preference. These are called drop-copy gateways.
Orders that get executed cause market participants to have positions in the instrument that they got executed, for the amount the order executed, and at the price of the execution limit orders can match at better prices than they were entered for, but not worse. A buy side execution is called having a long position, while a sell side execution is called having a short position.
When we have no position at all, this is referred to as being flat. Long positions make money when market prices are higher than the price of the position, and lose money when market prices are lower than the price of the position. Short positions, conversely, make money when market prices go down from the price of the position and lose money when market prices go up from the price of the position, hence, the well-known ideas of buy low, sell high, and buy high, sell higher, and so on.
Step 1: Form Your Market Ideology. Step 2: Choose a Market For Your.
Multiple buy executions, or multiple sell executions for different amounts and prices, cause the overall position price to be the volume weighted average of the execution prices and quantities. Open positions are marked to market to get a sense of what the unrealized Profit and Loss PnL of the position is. This means that current market prices are compared to the price of the position; a long position where market prices have gone up is considered unrealized profit, and the opposite is considered unrealized loss.
Similar terms apply to short positions. Profit or loss is realized when an open position is closed, meaning you sell to close a long position and you buy to close a short position.
At that point, the PnL is given the term realized PnL. The total PnL at any point is the total of the realized PnLs so far and the unrealized PnLs for open positions at the market price. Here, we will discuss how trading ideas are born and how they are turned into algorithmic trading strategies.
Fundamentally, all trading ideas are driven by human intuition to a large extent. Intuitively, you may also reason that instruments that are very similar to one another, or loosely dependent on one another, will move together, which is the idea behind correlation-based trading or pairs trading. Since every market participant has their own view of the market, the final market prices are a reflection of the majority of market participants. If your views are aligned with the majority of the market participants, then that particular strategy is profitable in that particular instance.
Of course, no trading idea can be right all the time, and whether a strategy is profitable or not depends on how often the idea is correct versus how often it is not correct. Historically, human traders implemented such rule-based trading to manually enter orders, take positions, and make profits or losses through the day. Over time, with advances in technology, they've moved from yelling in the pits to get orders executed with other pit traders, to calling up a broker and entering orders over the telephone, to having GUI applications that allow entering orders through point and click interfaces.
Such manual approaches have a lot of drawbacks — humans are slow to react to markets so they miss information or are slow to react to new information, they can't scale well or focus on multiple things at a time, humans are prone to making mistakes, they get distracted, and they feel a fear of losing money and a joy of making money. All of these drawbacks cause them to deviate from a planned trading strategy, severely limiting the profitability of the trading strategy.
Computers are extremely good at rule-based repetitive tasks. When designed and programmed correctly, they can execute instructions and algorithms extremely quickly, and can be scaled and deployed across a lot of instruments seamlessly. They are extremely fast at reacting to market data, and they don't get distracted or make mistakes unless they were programmed incorrectly, which is a software bug and not a drawback of computers themselves.
They don't have emotions, so don't deviate from what they are programmed to do. All of these advantages make computerized automated trading systems extremely profitable when done right, which is where algorithmic trading starts. Let's take a simple example of a trend-following strategy and see how that has evolved from a manual approach all the way to a fully automated algorithmic trading strategy.
Historically, human traders are used to having simple charting applications that can be used to detect when trends are starting or continuing. This would be a classic manual trading strategy in the past. As we discussed previously, computers are very good at following repetitive rule-based algorithms.
Simpler rules are easier to program and require less development time, but computer software applications are only limited by the complexity that the software developer programming the computer can handle. At the end of this chapter, we will deal with a realistic trading strategy written in Python, but for now, we will continue to introduce all the ideas and concepts required prior to that.
Here is some pseudo code that implements our trend-following, human intuition trading idea. This can then be translated into whatever language of our choosing based on our application's needs. This variable tracks our current position in the market:. This is the expected profit threshold for our positions.