Quantitative trading - page 9

 

Idea to Algorithm: The Full Workflow Behind Developing a Quantitative Trading Strategy



Idea to Algorithm: The Full Workflow Behind Developing a Quantitative Trading Strategy

In this comprehensive video, Delaney Mackenzie provides a detailed overview of the workflow followed by quant traders when developing a trading strategy. The speaker emphasizes the crucial role of starting with a hypothesis and leveraging historical data to make informed predictions about the future. The process involves continuous refinement and exploration of a trading model to ensure its historical correlation with future returns while maintaining independence from other models.

One of the key objectives is to design a portfolio that maximizes expected returns while adhering to various risk constraints. To achieve this, the speaker highlights the importance of testing the model on a small capital amount before deploying it live and scaling up. Additionally, incorporating alternative data sources and employing risk management techniques are strongly recommended.

The video delves into the two stages of backtesting in trading strategy development. Firstly, designing a portfolio and establishing execution rules, and secondly, implementing the backtesting process itself. The speaker underscores the significance of constructing a risk-constrained portfolio that preserves the integrity of the model's predictions and advises moving to the next stage only when the model consistently outperforms alternative investment opportunities. Furthermore, the speaker encourages exploration of new possibilities instead of relying on rehashed versions of existing models.

Delaney Mackenzie explains the initial phase of developing a trading strategy, which involves formulating an economic hypothesis to guide asset selection and timing. Finance aims to transform ideas into profitable outcomes by intelligently predicting the future based on hypotheses. Each decision made in trading essentially represents a bet on future market changes, highlighting the critical role of leveraging past information to make intelligent predictions.

The speaker provides insights into the workflow of developing a quantitative trading strategy. The process begins with formulating a hypothesis and exploring it using sample data. Comparing the hypothesis with existing models is essential for refinement, and once the new model demonstrates value, it is advisable to combine it with other sub-models for enhanced predictive power. The speaker emphasizes that hypotheses and models do not exist in isolation, and an aggregate model that incorporates multiple sources of information tends to yield better performance. Additionally, it is important to test the model on new data to ensure its validity.

The speaker emphasizes the importance of testing a model on unseen data to avoid overfitting during the development phase. They note that while backtesting a full strategy is commonly employed, it is crucial to acknowledge that most of the time is spent on developing models and predictors rather than constructing portfolios. Therefore, the speaker underscores the significance of portfolio construction and execution, including factors such as transaction fees, before conducting backtesting to ensure the portfolio's viability in real market conditions. Furthermore, the speaker highlights that the purpose of backtesting is not solely to evaluate the model's predictive performance, but also to assess whether the portfolio designed based on the model's predictions can withstand real-world conditions. Finally, the speaker stresses the importance of testing the model on a small capital amount before scaling up to ensure effective capital deployment.

Refinement and exploration of a trading model to establish its historical correlation with future returns and independence from other models are discussed by the speaker. This process is followed by constructing a portfolio within the defined risk constraints. The speaker emphasizes the importance of ensuring that the execution of the model does not distort the signal and diminish its correlation with future returns. A notebook example is provided to highlight the gradual addition of constraints, enabling evaluation of the model's performance under different risk conditions. This section underscores the significance of thorough testing and refinement to ensure the robustness and effectiveness of a trading model in generating returns.

The process of designing a portfolio that maximizes expected returns while satisfying various risk constraints is explained by the speaker. Initially, a naive optimization strategy is employed, focusing on maximizing expected return by investing the entire capital in a single stock, followed by the introduction of constraints to limit investment amounts. Subsequently, position concentration constraints are added, restricting investment in any one thing to a certain percentage of the portfolio. The portfolio strategy is further refined by incorporating sector exposure constraints. The speaker highlights that optimizing a portfolio while considering risk constraints can introduce complexity, as the weights in the final strategy may differ from the model's predictions of the future. It is crucial to understand how risk constraints influence modeling predictions and their impact on portfolio construction.

The speaker introduces the concept of using alpha lines, an open-source software developed by Quantopian, to assess the correlation between a model's returns and future returns. Alpha lines allow encoding any model, regardless of the universe size it predicts for, into a factor model. By calculating the correlation between the model's predictions on day T and the returns of all assets it predicted on day T+1, alpha lines help determine whether the model exhibits a consistently positive correlation with future returns. However, the speaker notes that real data may not always exhibit ideal correlation patterns.

The importance of comparing a new model against existing models is discussed, focusing on examining returns on a portfolio weighted by the factor and rebalanced according to a specified period. The speaker suggests running a linear regression analysis, using the new model's portfolio-weighted returns as the dependent variable and the portfolio-weighted returns of existing models as independent variables. This analysis helps assess the dependency between the new model and existing ones, providing insights into the potential alpha generation. The speaker emphasizes the significance of risk management and diversification, which can be achieved by either constraining each component individually or averaging multiple risky components to achieve risk diversification, depending on the investment strategy.

The speaker explains the distinction between the two stages of backtesting in trading strategy development. The primary stage involves designing a portfolio and determining execution rules, while the second stage entails conducting backtesting to evaluate the correlation between the model's predictions and future prices. Constructing a risk-constrained portfolio that effectively incorporates the model's predictions without compromising their integrity is crucial. The speaker advises investors to proceed to the next stage only when their backtests consistently provide substantial evidence of the model's superiority over alternative investment opportunities. Moreover, the speaker cautions against relying on rehashed versions of existing models and encourages a rigorous exploration of novel approaches.

The full workflow of developing a quantitative trading strategy is discussed by the speaker. The process begins with generating an idea, which can stem from understanding the world, data analysis, or identifying areas where the prevailing understanding differs. Once the model is developed, tested, and refined, it is compared against existing models to determine its uniqueness and potential for generating new alpha. The next step involves conducting out-of-sample tests, constructing a portfolio, and performing risk-constrained optimization simulations. Finally, the strategy is either paper traded or tested using a small capital amount before scaling up. The speaker emphasizes that relying solely on pricing data rarely provides sufficient information for generating innovative ideas, and incorporating alternative data sources is crucial for gaining new insights.

The speaker underscores the importance of utilizing alternative data to generate alpha, rather than relying solely on pricing and fundamental data for speed and convenience. They also emphasize the need to differentiate between alpha and cheap beta, as anything accounted for in a risk model is considered the latter. The limitations of k-fold cross-validation in reducing overfitting are discussed, with the speaker recommending true out-of-sample testing as a more reliable approach. Lastly, the speaker highlights the significance of having insights regarding the choice of data set for predicting the future and exploring approaches that differ from conventional methods.

In summary, Delaney Mackenzie's video provides a comprehensive overview of the workflow followed by quant traders when developing a trading strategy. It emphasizes the importance of starting with a hypothesis, refining and exploring the trading model, testing it on new data, constructing a risk-constrained portfolio, and conducting thorough backtesting. The speaker highlights the significance of utilizing alternative data, comparing the model against existing models, and incorporating risk management techniques. They stress the need to ensure that the model's predictions are historically correlated with future returns and independent of other models. The speaker also emphasizes the importance of testing the model on a small amount of capital before scaling up to real-world deployment.

Additionally, the speaker delves into the intricacies of portfolio design and execution rules. They discuss the process of constructing a risk-constrained portfolio that maximizes expected returns while satisfying different risk constraints. The speaker highlights the gradual addition of constraints such as position concentration and sector exposures to evaluate how the model performs under various risk scenarios. They emphasize that portfolio optimization involves making trade-offs between maximizing returns and managing risk.

The speaker introduces the concept of alpha lines and their role in assessing the correlation between a model's returns and future returns. They explain how alpha lines allow for the encoding of any model into a factor model, enabling the evaluation of the model's predictions against future returns. The speaker acknowledges that real-world data may not always exhibit consistent positive correlations, underscoring the importance of understanding the limitations of correlation analysis.

Comparing the new model against existing models is emphasized as a crucial step in evaluating its effectiveness. The speaker suggests using linear regression analysis to assess the dependency between the new model's portfolio-weighted returns and those of existing models. This comparison helps determine the uniqueness of the model and its potential for generating alpha. The speaker also highlights the significance of risk management and diversification in portfolio construction, either through constraining individual components or diversifying risk across multiple assets.

The speaker further highlights the two stages of backtesting in trading strategy development. The first stage involves designing a portfolio and execution rules, while the second stage involves conducting backtests to evaluate the model's predictions against future prices. It is crucial to construct a risk-constrained portfolio that incorporates the model's predictions without compromising their integrity. The speaker advises investors to proceed to the second stage only when there is consistent evidence of the model's superiority over alternative investment opportunities. They caution against relying on rehashed versions of existing models and encourage exploring new approaches.

Finally, the speaker outlines the full workflow of developing a quantitative trading strategy. It begins with generating an idea and progresses through testing, refining, and comparing the model against existing ones. The strategy is then subjected to out-of-sample testing, portfolio construction, and risk-constrained optimization. Before scaling up, the strategy is either paper traded or tested using a small capital amount. The speaker underscores the importance of incorporating alternative data sources to gain new insights and emphasizes the need to differentiate between alpha and cheap beta. They recommend true out-of-sample testing to mitigate overfitting and stress the significance of understanding the choice of data set for predicting the future.

In conclusion, Delaney Mackenzie's video provides a comprehensive understanding of the workflow followed by quants in developing a trading strategy. It emphasizes the importance of hypothesis development, model refinement, testing on new data, risk management, and thorough backtesting. The speaker encourages the use of alternative data sources, comparison against existing models, and the exploration of novel approaches. By following this workflow, quant traders can enhance the effectiveness and robustness of their trading strategies.

  • 00:00:00 Delaney Mackenzie explains the general workflow that a quant will follow when developing a trading strategy. First, it begins by developing an economic hypothesis, which will help to decide which asset to invest in and when to invest in it. The hypothesis is a prediction on how the world works, and the goal of finance is to take ideas and turn them into dollars, based on intelligent future predictions. Every decision made is essentially a bet on the future, making it crucial to use past information to understand and make an intelligent bet on future changes in the market.

  • 00:05:00 The speaker discusses the workflow involved in developing a quantitative trading strategy. The first step is to come up with a hypothesis and explore it using sample data. Comparing the hypothesis with existing models is essential to refine it, and once the new model has value, experts recommend combining it with other sub-models to make predictions. The speaker emphasizes the idea that hypotheses do not exist in isolation, and models rarely work alone, requiring an aggregate model that incorporates several sources of information to achieve better performance. Finally, the model must be tested on new data to ensure its validity.

  • 00:10:00 The speaker discusses the importance of testing a model on new data that it hasn't seen before in order to make sure that it is not overfitted to the development time period. They also note that the backtesting of a full strategy is often overused, as most of the time you are developing models and predictors, rather than doing portfolio construction. The speaker emphasizes the importance of portfolio construction and execution, including understanding the transaction fees, before conducting backtesting to ensure that the portfolio is able to survive real market conditions. The speaker also notes that the purpose of backtesting is not to check if the model is making good predictions, but to see if the portfolio designed based on the model's predictions can survive real-world conditions. Finally, the speaker stresses the importance of testing the model on a small amount of capital before deploying it live and scaling up capital amounts to actually make money.

  • 00:15:00 The speaker discusses the process of refining and exploring a trading model to ensure it is historically correlated with future returns and independent of other models. The next step is to use this model to construct a portfolio that is within risk constraints. The speaker emphasizes the importance of ensuring that the execution of the model does not destroy the signal and reduce the correlation with future returns. They highlight a notebook example where gradually adding constraints can help evaluate how a model may perform under various risk constraints. This section highlights the importance of testing and refining a trading model to ensure it is robust and effective in generating returns.

  • 00:20:00 The speaker explains the process of designing a portfolio that maximizes expected returns but also satisfies different risk constraints. They start with a naive optimization strategy that maximizes expected return by investing all the money in a single stock and adds the constraint that they can't invest more than a certain amount. Then, they add a position concentration constraint, which restricts investing more than 15% to 30% of the portfolio in any one thing. Subsequently, they refine the portfolio strategy by constraining sector exposures. The speaker points out that when optimizing a portfolio while considering risk constraints, the weights in the final strategy are not the same as the model's predictions of the future and can cause a lot of complexity. Additionally, the speaker emphasized that some models might not survive the risk-constraining step, which calls for understanding the concept of modeling predictions and how they are influenced by risk constraints.

  • 00:25:00 The presenter discusses using alpha lines, an open-source software developed by Quantopian, to check if there is any correlation between a model's returns and future returns. The presenter notes that any model, regardless of the size of the universe it makes predictions for, can be easily encoded in a factor model. Alpha lines checks whether a model's prediction is correlated with future returns by calculating the correlation between the model's predictions on day T and the returns of all assets it predicted on day T+1. The presenter notes that a consistently positive correlation is ideal, but this is not always the case in real data.

  • 00:30:00 The speaker discusses the use of alpha lens to check if a model has any correlation with returns in the past. After establishing the usefulness of the model for predicting future outcomes, the next step is to compare it to other models that already exist to check the similarities in predictions and returns. This comparison is important to determine the uniqueness of the model and the possibility of making new alpha. The speaker explains how to perform this comparison by using the risk model to check if the full strategy developed on the model is similar to other models and how it could be simplified with the risk analysis on the individual factor level.

  • 00:35:00 In this section, the speaker explains how to evaluate the effectiveness of a trading model. They recommend comparing the returns of the model with other known models and using risk-aware techniques, such as the risk model, to check its efficiency. They give an example of a simple mean reversion model that they evaluated by looking at the risk similarity to other known models. They also stress the importance of comparing the model with existing alpha models to ensure diversification benefits and not concentration risks. Finally, they discuss how to construct a portfolio using risk-aware portfolio optimization, which involves maximizing returns while subject to risk constraints. The speaker recommends using specific examples to break down the exposures of each stock, compute the risk exposures of a portfolio, and determine whether a portfolio is over-risked.

  • 00:40:00 We learn about constraining risk, which is a crucial part of the algorithm creation process. Con only trade a limited number of names without destroying alpha, so it is necessary to constrain risk to prevent excess exposure. Correlation is important because the model's prediction must be correlated with future prices and returns, so every time one constrains risk, they make it harder to maintain this correlation. The algorithm at the bottom of the example long/short equity algorithm has constraints around it, such as a dollar-neutral policy and equal sector exposures. It is essential to consider intelligent constraints that will optimize returns and reduce risks.

  • 00:45:00 The speaker discusses the full workflow of developing a quantitative trading strategy. The first step is to come up with an idea, which can be from understanding the world, data, or finding an area where the world disagrees with your implicit model or understanding. Once the model is tested and refined, it is compared to existing models to determine new material and determine the weighting between models. The next step is to perform an out-of-sample test, construct a portfolio, and run a risk-constrained optimization simulation. Finally, the strategy is paper traded or tested with a small amount of capital before being scaled up. The speaker emphasizes that the use of only pricing data almost never gives enough information to generate new ideas, and new insights come from alternative sources.

  • 00:50:00 The speaker discusses the importance of using alternative data to generate alpha as opposed to using only pricing and fundamentals data because it is easy and fast. The speaker also discusses the need to factor out existing risk models, as anything in a risk model is considered cheap beta and not alpha. The speaker also explains the limitations of k-fold cross-validation in reducing overfitting and recommends using true out-of-sample testing instead. Finally, the speaker emphasizes the importance of having insights about what data set to use to predict the future and how it would differ from what people have done before.

  • 00:55:00 The speaker explains how to compare a new model against existing models by looking at the returns on a portfolio that has been weighted by the factor and rebalanced according to some rebalancing period rule, usually a day or a month. The speaker suggests running a linear regression with your model's portfolio-weighted returns as the Y variable and your existing models' portfolio-weighted returns as the independence variable. The more dependency, the more the existing models are similar to and explain the performance of your new model, and the more alpha that is produced. The speaker also emphasizes the importance of risk management and diversification, which can be done either by constraining every single component to be risk-controlled or by taking multiple risky components and averaging them together to diversify risk, depending on your investment strategy.

  • 01:00:00 The speaker explains the difference between the two backtest stages in developing a trading strategy. The main backtest stage involves designing a portfolio and deciding on execution rules, while the second stage is actually doing the backtesting to see if the model predictions are correlated with future prices. It is important to construct a risk-constrained portfolio that can get the model predictions without corrupting them too much. The speaker advises that it's all relative and investors should move to the next stage when their backtests consistently provide enough evidence to be a better investment opportunity than alternatives. Finally, the speaker warns against using models that are just rehashed versions of existing ones and encourages investors to rigorously explore the possibility of the model following something new.
Idea to Algorithm: The Full Workflow Behind Developing a Quantitative Trading Strategy
Idea to Algorithm: The Full Workflow Behind Developing a Quantitative Trading Strategy
  • 2017.12.07
  • www.youtube.com
The process of strategy development is that of turning ideas into money. There are numerous steps in between, many of which are unknown to people entering in...
 

Market Quantitative Analysis Utilizing Excel Worksheets! S&P 500 Analysis & Trading Ideas



Market Quantitative Analysis Utilizing Excel Worksheets! S&P 500 Analysis & Trading Ideas

The video delves into the use of Excel worksheets for market quantitative analysis, with a focus on the S&P 500 as an illustrative example. Julie Marchesi demonstrates the creation of a correlation workbook in Excel, utilizing yellow boxes as inputs to select the correlation index from 74 groups and a look-back period of 40 days. The correlation test compares the last 40 days with all other periods in the dataset, identifying the highest correlation. To validate the correlation, a second market is used to confirm the findings and eliminate unreliable data points. The correlation index chart visually tracks the changes in correlation over time.

The speaker explains the process of utilizing Excel worksheets for market quantitative analysis, specifically highlighting the application to the S&P 500. They showcase various lines on a chart representing the look-back period and correlation index. By analyzing these lines, the speaker derives their bias for the market and makes predictions about future trends. They also introduce a chart displaying the average percent change over a specific time period and emphasize the importance of focusing on significant correlation indexes. The speaker concludes by demonstrating how this analysis can be applied to the current state of the S&P 500 market, emphasizing its potential utility for making informed trading decisions.

Examining different markets for confirmation or conflicting signals in relation to the S&P 500 analysis is the focus of the subsequent section. The speaker highlights that while oil confirms a strong uptrend in the market and suggests the potential for further bullish activity, the euro and euro yen exhibit bearish or negative activity over the past 20 days. Gold, however, does not provide significant confirmation. Based on recent market action, the speaker suggests a negative bias moving forward but cautions against short-selling and recommends waiting for confirmation before making significant moves. Overall, the speaker concludes that there is a bullish edge to the market, but exercising caution in the short term is advisable.

The speaker discusses the conclusions drawn from the correlation testing across different markets in the subsequent section. They note the possibility of some instability in the S&P 500 market over the next five days. Although historical analysis indicates a long-term bullish edge in the S&P 500, the speaker emphasizes the importance of observing neutral activity in the market before executing any trades. They suggest combining quantitative analysis with sentimental analysis to gain a better understanding of the market and highlight the usefulness of Excel worksheets in visualizing data in various ways. The video concludes by encouraging viewers to explore this type of trading approach and visit the speaker's website for further information on their journal and live trades.

  • 00:00:00 In this section, Julie Marchesi discusses her creation of a correlation workbook using Excel that helps her analyze markets from a quantitative perspective. The yellow boxes serve as inputs that allow for the selection of the correlation index from 74 groups and look-back periods of 40 days. The correlation test compares the last 40 days with all other periods in the entire dataset to find the highest correlation. Once the highest correlations have been found, the workbook uses a second market to confirm the correlation and weed out any unreliable data point. The correlation index chart tracks how the correlation changes over time.

  • 00:05:00 In this section, the speaker discusses how to utilize Excel worksheets for market quantitative analysis, using the S&P 500 as an example. He shows different lines on a chart that represent the look-back period and the correlation index. By analyzing these lines, he can determine his bias for the market and make predictions about future trends. He also discusses a chart that shows the average percent change over a certain period of time, and which correlation indexes are most important to look at. The speaker concludes by showing how this analysis can be applied to the current state of the S&P 500 market and why it may be useful for making trading decisions.

  • 00:10:00 In this section of the video, the speaker explores how different markets can provide confirmation or conflicting signals for the S&P 500 analysis. While oil confirms that the market is in a strong uptrend and shows potential for continued bullish activity, the euro and euro yen show bearish or negative activity over the last 20 days. Gold, on the other hand, does not provide much confirmation at all. The speaker notes that the recent market action over the last 20 days suggests a negative bias moving forward, but cautions against short-selling and suggests waiting for confirmation before making any big moves. Overall, the speaker concludes that there is a bullish edge to the market, but some caution should be exercised in the short term.

  • 00:15:00 In this section, the speaker discusses the conclusions drawn from the correlation testing across different markets, stating that there may be some shakiness in the S&P 500 market over the next five days. The speaker states that although historical analysis suggests a long-term bullish edge in the S&P 500, they are looking for some sort of neutral activity in the market before making any trades. The speaker suggests combining quantitative analysis and sentimental analysis to gain a better understanding of the market and utilizing Excel worksheets to visualize data in different ways. They encourage viewers to try this type of trading and visit their website for more information on their journal and live trades.
Market Quantitative Analysis Utilizing Excel Worksheets! S&P 500 Analysis & Trading Ideas
Market Quantitative Analysis Utilizing Excel Worksheets! S&P 500 Analysis & Trading Ideas
  • 2013.12.01
  • www.youtube.com
Showcasing my new excel worksheet... enjoy! MarcheseFinancial.com@JulianMarcheseLeadersInvestmentClub.com
 

Building Quant Equity Strategies in Python



Building Quant Equity Strategies in Python

The video provides an in-depth exploration of building quantitative equity strategies using Python and the algorithmic trading platform Quantopian as a prime example. The speaker begins by introducing themselves and their background in data analysis and quant finance. They explain that Quantopian is a platform that enables retail investors to access data and utilize backtesting to construct their own quantitative strategies for trading stocks. Despite initial skepticism, the speaker highlights the success of Quantopian in attracting a community of quant scientists, hackers, and retail investors who collaborate to discover investment ideas. They also mention that while Quantopian is currently supported by venture backing and is pre-revenue, there are plans to eventually offer live trading as a paid service.

The speaker delves into the concept of building quant strategies through crowdsourced data and ideas on the Quantopian platform. They emphasize that Quantopian facilitates direct messaging between users, fostering connections and idea-sharing for developing quantitative algorithms. However, the speaker acknowledges that data limitations can pose challenges for users constructing strategies, as they may not have access to all the necessary pricing data. Additionally, they note that Quantopian's focus is solely on equities and may not be suitable for high-frequency or latency-sensitive trading strategies.

The limitations of the trading platform are discussed in detail. The speaker emphasizes that Quantopian is not designed for low-latency strategies like scalping or market-making. They mention that the pricing data source determines the universe of securities, which currently consists of only a few thousand domestic equities. The speaker briefly touches upon their open-source basic slippage model available on GitHub. Although the inclusion of options and futures is a possibility for the future, the primary focus remains on providing profitable strategies and ensuring transparency in profitability statistics. The speaker categorizes five basic quant strategies implemented by everyday Python users on the platform, including mean reversion, momentum, overnight gap, volatility, and pairing.

Various quant strategies are explored, specifically focusing on the interplay and tuning of mean reversion and momentum. The speaker highlights popular strategies such as valuation and seasonality, with data for these strategies accessible through sources like Yahoo Finance or Google Finance. They caution against common pitfalls in pairs trading, such as blindly mining data to find unrelated securities. The importance of identifying securities linked to the same value and observing the spread distribution between the two assets is emphasized. The goal is to capitalize on the reversion of the spread between the stocks.

Pairs trading and momentum trading strategies are further discussed, and the speaker provides an example of backtesting a pairs trading strategy using Python. Pairs trading involves trading the spread between two stocks and carries risks such as potential reversals. Momentum trading, on the other hand, involves ranking stocks based on their previous price appreciation. Although data cannot be directly downloaded from the platform, users can run backtests and live trade within a limited universe of approximately 100 stocks due to bandwidth constraints.

The concept of valuation as a quantitative equity strategy is explored, requiring systematic fundamental ratio analysis to identify undervalued and overvalued stocks. However, implementing such strategies necessitates extensive data coverage and an understanding of data normalization, calendar alignment, and associated manipulation. The speaker suggests implementing these strategies using the fetcher method, which enables users to obtain CSV data from the internet. The speaker also touches on sentiment as a quantitative equity strategy, involving the analysis of market sentiment and its impact on stock prices. However, they caution that implementing this strategy requires a solid understanding of data analysis, normalization, and manipulation.

The use of shorted stocks as a sentiment indicator in quant equity strategies is discussed. Shorting stocks is recognized as difficult and risky, with only experienced individuals willing to engage in it. However, publicly available data on short interest levels, which can be obtained from NASDAQ, can be useful for this purpose. The speaker highlights the risk of liquidity constraints arising from short squeezes and suggests using a volatility-based signal to identify heavily shorted but less risky stocks. They propose an algorithm that ranks stocks based on the "days to cover" signal, representing the number of days it would take for short sellers to unwind their positions based on average daily trading volume. The strategy involves buying the least shorted stocks and shorting the most shorted ones.

The speaker moves on to discuss intermediate steps in the process and the open-sourcing of algorithms. They acknowledge the challenges of accessing valuable data like borrow rates from brokers and the limitations of their slippage models. The speaker addresses questions about available order types and the feedback system for adding more features. Additionally, they briefly mention the use of seasonality in trading and its popularity online.

A simple quantitative equity strategy suitable for beginners is presented. Using seasonality to time the market, for instance, selling stocks in May and investing in bonds, then buying back into the stock market in October, is highlighted as a straightforward systematic rule that allows for easy performance analysis over time. The speaker provides a breakdown of the top 25 quantitative equity algorithms shared on the Quantopian platform, based on the number of replies, views, and clones. Notably, a paper on using Google search terms to predict market movements, although considered overfitted, has gained significant attention on the forums. The speaker also notes that strategies with long, complex acronyms involving advanced mathematical concepts tend to attract more interest, despite the effectiveness of simpler strategies.

The importance of trust and security in the platform is emphasized. The speaker acknowledges the need to build trust with users to encourage them to upload their algorithms for testing against the market. They assure that security measures are taken seriously. While live aggregated performance data is not yet available, the speaker mentions that around a thousand algorithms are running in simulation. The potential benefits of a social network for quants are discussed, with recognition that it may not directly impact individual algorithm profitability. However, there is a desire within the quant finance community to connect, exchange ideas, and gain insights from others. The value of Quantopian as a learning environment is highlighted, where people can learn from both successes and mistakes in a risk-free environment.

The speaker explores the popularity of various investment strategy classifications within the platform. They note that momentum and mean reversion strategies are currently the most popular. They express excitement about the platform's potential to offer more accessible content for retail investors. A demonstration of the platform's backtester in Python is provided, showcasing the initialize method and handle data method, which are executed either once per day or once per minute during live trading. The user interface settings allow for specifying backtest dates, initial capital, and backtesting frequency. The community thread includes a search function for finding and utilizing algorithms created by other members.

In the final section, the speaker presents their live trading dashboard, deploying a basic algorithm that buys an equal-weighted portfolio of nine sector ETFs against their Interactive Brokers account. The dashboard displays a performance equity curve connected to a benchmark in red, current positions, and placed orders and fills. The speaker mentions the ability to log information for the deployed source code. The benchmark used is the returns to SPI, as selecting a broad range of stocks in an unbiased manner is not currently offered. Instead, they provide a daily dollar volume universe that updates quarterly.

  • 00:00:00 In this section, the speaker introduces herself and gives a background of her experience in the field of data analysis and quant finance. She explains that Quantopian is an algorithmic trading platform that allows anyone, particularly retail investors, to access data and backtesting to build their own quant strategies and deploy it against their own account to trade stocks. The speaker gives an overview of how Quantopian works and emphasizes that despite her initial skepticism, the platform has been successful in attracting a community of quant scientists, hackers, and retail investors who collaborate to find investment ideas. She also mentions that Quantopian is pre-revenue and supported by venture backing, with plans to eventually charge for live trading as a paid service.

  • 00:05:00 In this section, the speaker discusses the concept of building quant strategies from crowdsourced data and ideas on his platform at Quantopian. The platform provides peer-to-peer direct messaging and allows users to connect and share their ideas for building quant algorithms. However, the speaker acknowledges that data limitations can be a major issue for individuals building strategies, as they may not have access to all the pricing data necessary for their algorithms. Additionally, given that the platform is solely focused on equities, and it may not be a suitable platform for high-frequency trading or latency-sensitive trading strategies.

  • 00:10:00 In this section, the speaker discusses the limitations of their trading platform, emphasizing that it is not a low-latency platform for scalping or market-making strategies. They also mention that their pricing data source defines their universe of securities, which currently only includes a few thousand domestic equities. The speaker briefly discusses their basic slippage model, which is open source and can be found on GitHub. They also touch upon the potential inclusion of options and futures in the future, but note that the focus is on providing profitable strategies and being transparent with profitability statistics. Lastly, the speaker categorizes five basic accessible quant strategies that everyday Python users on the platform have implemented, including mean reversion, momentum, overnight gap, volatility, and pairing.

  • 00:15:00 In this section, the speaker discusses some basic Quan strategies that are built on the interplay and tuning of mean reversion and momentum. Two popular strategies are valuation and seasonality, with data for these strategies being accessible through Yahoo Finance or Google Finance. The speaker then goes into the common pitfalls of pairs trading, including blindly data mining and finding two securities that actually have no link to each other. They encourage understanding that pairs trading involves finding two things that are linked to the same value, as well as looking at the distribution of the spread between the two asset prices and noticing when the spread comes into the tails of the distribution. The goal is to buy the spread, sell the spread, and bet that the pricing between the two stocks will eventually revert back.

  • 00:20:00 In this section, the speaker discusses pairs trading and momentum trading strategies and demonstrates an example of how a pairs trading strategy can be backtested using Python. Pairs trading involves trading the spread between two stocks and comes with some common pitfalls, such as potentially devastating reversals. Momentum trading, on the other hand, involves ranking stocks based on their prior price appreciation over a given time period. The speaker also explains that while you cannot download data directly from their site, you can run backtests and live trade within a limited universe of around 100 stocks due to bandwidth constraints.

  • 00:25:00 n this section, the speaker discusses the concept of valuation as a quantitative equity strategy and how it requires fundamental ratio analysis in a systematic way to identify cheap and expensive stocks. However, he mentions that such strategies require good data coverage and understanding of normalizing data, aligning calendars, and the associated data manipulation. The speaker suggests implementing such strategies by using the fetcher method, which lets users grab CSV data from the Internet. Additionally, he talks about sentiment as a quantitative equity strategy, which involves analyzing market sentiment and its impact on stock prices. However, he cautions that implementing this strategy also requires a solid understanding of data analysis, normalization, and manipulation.

  • 00:30:00 In this section, the speaker discusses the use of shorted stocks as a sentiment indicator in building quant equity strategies. Shorting stocks is difficult and risky, and only those who know what they're doing are willing to do it. The short interest level or the number of shares short in publicly traded stocks is publicly available data that can be scraped from NASDAQ. However, the data is lagged in time and has a low frequency snapshot. The speaker also highlights the risk of liquidity constraint from short squeezing and suggests using a volatility type signal to identify heavily shorted but less risky stocks. The algorithm involves ranking stocks based on the days to cover signal, which represents the number of days of average daily trading it would take short sellers to unwind. The strategy buys the least shorted stocks and shorts the most shorted ones.

  • 00:35:00 In this section of the video, the speaker talks about the intermediate steps in the process and the open-sourcing of the algorithms. He also discusses the difficulty of accessing valuable data such as borrow rates from brokers and the limitations of their slippage models. The speaker answers questions about the current order types available and the feedback system for adding more features. Additionally, the speaker briefly mentions the use of seasonality in trading and its popularity online.

  • 00:40:00 In this section, the speaker discusses the simplest example of a quantitative equity strategy for the beginners. One such possible example could be using seasonality to time the market, for instance, selling stocks in May and investing in bonds, then buying back into the stock market in October. This is a simple systematic rule that enables an easy analysis of performance through time. They also present a breakdown of the top 25 quantitative equity algorithms shared on the Quantiopian platform based on the number of replies, the number of views, and how many times they were cloned. Among these, a paper on using Google search terms to predict market movements, despite being regarded as overfitted, has gained significant attention on the forums. Lastly, the speaker notes that people tend to find strategies with long, complicated acronyms involving hard math concepts more appealing than simple strategies that work effectively.

  • 00:45:00 In this section, the speaker discusses the importance of trust and security in ensuring that people are willing to upload their money-making algorithms to an online platform for testing against the market. The speaker highlights the need to build a level of trust with users so that they feel comfortable using the platform, and mentions that they take their security measures seriously. Although live aggregated performance data is not yet available, the speaker notes that they have approximately a thousand algorithms running in simulation. The speaker considers the potential benefits of a social network for quants but is unsure if it will drive individual algorithm profitability. However, he believes there's pent-up demand among people in the quant finance world to talk to each other and understand what others are doing. Lastly, the speaker highlights the value of the platform as a learning environment where people can learn from each other’s successes and mistakes in a safe, risk-free environment.

  • 00:50:00 In this section of the video, the speaker discusses the popularity of various classifications of investment strategies and how they are represented within their platform. They observe that momentum and mean reversion strategies are currently the most popular. They express excitement about the platform's potential for adding more content accessible to retail investors. The speaker also demonstrates how the platform's backtester works in Python, with an initialize method and a handle data method being run once per day or once per minute in live trading. The only UI settings are the dates for the backtest, initial capital, and backtesting frequency. There is a search function available in the community thread where members can find different algorithms created by other members and copy and paste them into the platform's IDE.

  • 00:55:00 In this section, the speaker demonstrates his live trading dashboard where a basic algorithm that buys an equal-weighted portfolio of nine sector ETFs is deployed against his Interactive Brokers account. The dashboard shows a performance equity curve connected to a benchmark in red, current positions, and orders and fills placed. The speaker also mentions the ability to log information for a source code that's deployed. The benchmark is the returns to SPI and currently, they don't offer the ability to select a broad swath of stocks in an unbiased way. Instead, they offer a daily dollar volume universe that updates quarterly.
Building Quant Equity Strategies in Python
Building Quant Equity Strategies in Python
  • 2014.07.22
  • www.youtube.com
Presented by Dr. Jess StauthDr Jess Stauth, VP of Quant Strategy at Quantopian, former quant research analyst at StarMine, and former director of quant produ...
 

The Do's and Don't's of Quant Trading



The Do's and Don't's of Quant Trading

Dr. Ernie Chan, a prominent figure in quantitative trading, discusses the challenges and provides valuable advice for traders in this field. He highlights the increasing difficulty of quantitative trading, as noted by industry experts and the underperformance of many machine learning funds. To succeed, traders must elevate their skills and learn important lessons. Drawing from personal experiences, Dr. Chan shares what traders should avoid doing and offers guidance for long-term success.

One of the key warnings Dr. Chan emphasizes is the temptation to over-leverage, particularly during periods of strong strategy performance. While the Kelly formula is often used for risk management, he cautions that it can lead to overly optimistic expectations and is sensitive to sample periods. Instead, he suggests using volatility as a more predictable measure for determining leverage. By targeting the expected volatility of a strategy, traders can determine appropriate leverage levels, focusing on risk rather than solely predicted returns.

Dr. Chan provides two essential pieces of advice for quant trading. First, he stresses the importance of considering the downside risk of a strategy (i.e., how much can be lost) rather than fixating on potential gains, which are unpredictable. Second, he warns against using short-term performance as the sole basis for selecting managers or determining leverage. Instead, he advises looking for longer track records and utilizing short-term performance for risk management and gradual reallocation purposes. Furthermore, he encourages traders to adopt a business-oriented mindset, reinvesting profits into the infrastructure of their trading business rather than indulging in personal luxuries.

Investing in the trading business's infrastructure is a topic Dr. Chan emphasizes. He suggests prioritizing investments in high-quality data, faster machines, and skilled personnel. Quality data is crucial to ensure accurate backtesting results, while faster machines enhance research productivity. Hiring personnel with the necessary skills further strengthens the business's capabilities. Dr. Chan emphasizes the long-term benefits of these investments, treating trading as a serious business venture.

To improve research productivity, Dr. Chan highlights the importance of investing in multi-core machines and proper parallel computing software. This investment can significantly increase productivity by five to ten times. He also recommends focusing on one's comparative advantage and complementing any shortcomings by partnering with individuals possessing complementary skills, such as coding, strategy, marketing, or operations.

Dr. Chan advocates for a collaborative approach to quantitative trading. He highlights that collaboration can occur in various forms, including virtual trading groups formed by university students. Sharing ideas and teaching others about strategies can lead to valuable feedback and improve overall performance. While protecting one's competitive advantage is important, sharing basic trading ideas can lead to a net inflow of knowledge and insights.

Additionally, Dr. Chan advises beginners to start with simple trading strategies based on solid intuitive justifications. He emphasizes the value of eliminating bad trades rather than solely seeking more profitable ones. Knowing when not to trade and when not to apply certain ideas contributes to long-term success. He also encourages continuous learning and improvement in trading strategies.

During a Q&A session, Dr. Chan shares insights into constructing financial derivatives, recommends using Python as a starting point in the field, and discusses effective strategies such as momentum trading and risk parity. He emphasizes the need for better risk management to sustain a strategy even when returns diminish.

In summary, Dr. Ernie Chan provides valuable advice for quantitative traders. He warns against over-leveraging and short-term performance reliance, stressing the importance of considering downside risk and focusing on longer track records. He emphasizes investing in business infrastructure, including data, machines, and personnel. Collaboration, starting with simple strategies, and continuous learning are key to long-term success.

  • 00:00:00 Dr. Ernie Chan talks about the challenges that quantitative trading is currently facing and how the industry is maturing. He mentions that quantitative trading is becoming increasingly difficult with every passing year as quoted by De Sha and Dr. Lopez de Prado, who manages $13 billion of quant fund. Most machine learning funds fail, and the performance of the largest investable currency trading programs has been uniformly attacked in the last two years. Dr. Chan believes that to survive and succeed in this field, traders have to up their game and learn some high-level lessons. He also shares some things that traders should avoid doing, as he has violated most of them and has learned his lesson.

  • 00:05:00 The speaker warns of the temptation to over-leverage in trading, especially during times when a strategy is performing well. While traders may be tempted to rely on the Kelly formula for risk management, the speaker notes that it can lead to overly optimistic expectations and be highly sensitive to sample periods. Instead, he suggests using volatility for leverage determination as a more predictable input, as predicting returns accurately can be very challenging. Thus, traders should aim to target the expected volatility of their strategy and determine their leverage based on that quantity rather than predicted returns.

  • 00:10:00 The speaker gives two important pieces of advice for quant trading. Firstly, it is essential to focus on the tongue side of the strategy for determining leverage, which is how much can be lost with a strategy, rather than how much can be made because this is unpredictable. Secondly, it is crucial not to use short-term performance to pick managers or determine carry leverage because, according to an academic study, it is useless to do so. Instead, the speaker advises looking for a longer track record and using short-term performance for risk management and gradual reallocation purposes. Additionally, he encourages traders to adopt a business-oriented mindset, where traders reinvest their profits into data equipment instead of spending it on extravagances like travel and luxurious items.

  • 00:15:00 The speaker emphasizes the importance of investing profits in the trading business. Rather than investing in a bigger portfolio, it is better to invest in the infrastructure of the business, such as data, equipment, or personnel. Regarding data, it is crucial to invest in good quality data as cheap data often has caveats which can compromise the accuracy of the backtest. Similarly, it is important to have faster machines to enhance research productivity and hire the right personnel that have the necessary skills required for the job. This investment in the business can improve the business’ long-term survivability. The speaker concludes that running a trading business like any other business can be beneficial in the longer term.

  • 00:20:00 The speaker discusses the importance of investing in a multi-core machine and proper parallel computing software in order to increase research productivity by five to ten times, which is an excellent investment considering that machines are much cheaper than labor. Additionally, investing in a local machine is more cost effective and productive than investing in cloud computing, which presents a psychological barrier and requires data transfers and payment for storage. The speaker emphasizes the need to focus on one's comparative advantage and complement any shortcomings by investing in personnel with complementary skills, such as coding, strategy, marketing or operations.

  • 00:25:00 The speaker discusses the importance of investing in personnel to cover your shortcomings and extend your strategies. He emphasizes that trading should be treated as a serious business, and if one does not have the capital to invest in personnel, there are ways to deal with the situation. The best quant funds now use a team approach where the strategy created is not the work of any individual but rather a team effort. Therefore, it is beneficial to study financial phenomena rather than trading strategies, as this improves the quality of trading strategies. The speaker also notes that the independent trader approach is becoming obsolete, and younger traders are adopting a unique approach that is promising.

  • 00:30:00 The speaker discusses the benefits of studying the market beyond just generating profitable trading strategies. By taking a scientific approach and studying phenomenon for its own intrinsic curiosity and interest, traders can uncover interesting artifacts of the market that are repeatable and not solely a result of overfitting past data. The speaker advocates for starting with simple trading strategies with good intuitive justification and notes that a successful strategy often involves eliminating bad trades rather than finding more profitable ones. Additionally, the trader who knows when not to trade and when not to apply a certain idea is likely to be more successful in the long run.

  • 00:35:00 The importance of starting with a simple strategy in trading is emphasized, as it helps break through the overwhelming amount of information and allows for personal experience to be gained. However, it is also important to not stay at this level and to continuously add more predictors to prolong the life of single predictors. Multiple predictors can be combined exponentially in various ways, such as linearly or in layers, making them difficult to replicate and contributing to slower alpha decay. Machine learning is often necessary when combining predictors, but the danger of overfitting exists. Despite these challenges, the speaker concludes on an optimistic note, encouraging traders to continuously learn and improve their strategies.

  • 00:40:00 Ernie talks about the importance of collaboration in quantitative trading. He emphasizes that collaboration can happen in various forms, not just limited to big corporations or firms. For instance, university students can collaborate and form a virtual trading group where different people can contribute various skills to create a successful trading strategy. Ernie also encourages traders to share their ideas and not hesitate to teach others about their strategies. While he believes that most trading ideas are not original, it is the execution, risk management, and other competitive advantages added to the strategy that make it work better and last longer. Therefore, traders do not need to give away their competitive advantage, but sharing basic trading ideas can lead to net inflow as others provide feedback that can sharpen and improve the strategy.

  • 00:45:00 The speaker discusses his background in quantitative trading and mentions his successful Forex model that yielded a Sharpe ratio of over three during its peak. He advises software engineers to start by examining other people’s models, backtesting and trading them, and partnering with individuals who possess fundamental knowledge but lack coding skills. He suggests various methods to predict volatility and recommends trading strategies only in favorable regimes. When asked about qualifications for hiring quantitative developers, he emphasizes coding skills and a basic understanding of the market and its intricacies.

  • 00:50:00 The speaker discusses the do's and don'ts of quantitative trading. He stresses that if a trading strategy isn't making money, one should decrease its leverage until it becomes noise in the portfolio. The speaker emphasizes the importance of looking for patterns and phenomena in trading, akin to physics and engineering. As a beginner, he recommends identifying a competitive advantage and partnering with someone with complementary skills. The speaker then considers using more data in ML algorithms, explaining that more data isn't always better, and suggests using bagging to simulate data without extending further into history. Finally, the speaker states that better risk management is crucial as it enables one to continue running a strategy without losing money, even if returns begin to dwindle.

  • 00:55:00 Ernie Chan answers questions from viewers related to quant trading. He suggests that constructing financial derivatives is a good opportunity for those with expertise, but it requires searching in niche areas. He recommends using Crisp Data and Tech Data for back-testing equities data, but warns that good data comes at a high cost. Chan also discusses momentum trading and risk parity as effective strategies in the current environment, and suggests that Python is a good open source to use for getting started in the field.
The Do's and Don't's of Quant Trading
The Do's and Don't's of Quant Trading
  • 2018.04.06
  • www.youtube.com
The best advice on how to thrive, or at least survive, in the increasingly competitive world of quantitative trading. Topics include optimal leverage, perfor...
 

Quantitative Finance | Classification of Quantitative Trading Strategies by Radovan Vojtko



Quantitative Finance | Classification of Quantitative Trading Strategies by Radovan Vojtko

Radovan Vojtko, the CEO of Quantpedia, provides valuable insights into the process of selecting quantitative trading strategies for their database. He emphasizes the importance of leveraging academic research to discover reliable and implementable strategies that can be used by traders. Despite common misconceptions, Vojtko highlights that there are still plenty of trading ideas in academic papers that hold potential.

Vojtko explains that the most popular asset class for trading strategies is equities, followed by commodities, currencies, bonds, and real estate. These asset classes offer a wide range of opportunities for implementing quantitative strategies. He categorizes quant strategies into various classifications, including timing, arbitrage, and momentum, among others.

One key aspect Vojtko emphasizes is the existence of blind spots in academic research, particularly in less well-covered asset classes like bonds and commodities. These blind spots present opportunities to discover new sources of alpha, and traders can capitalize on them. To combat issues such as P-hacking and replication, Vojtko recommends rigorous testing and the use of momentum anonymize techniques.

Contrary to the belief that published trading strategies no longer work, Vojtko asserts that some strategies continue to yield positive results even after being published, with more than 40% of alpha remaining after five years. To select the most promising strategies, he suggests conducting out-of-sample tests, increasing the cutoff point for statistical significance, building a comprehensive database of strategies, and choosing those with the best performance.

Vojtko further discusses specific trading strategies, such as mean reversion approaches in commodity futures trading and pre-earnings announcement risk strategies. He emphasizes the importance of alpha decay and the challenges posed by P-hacking and data mining. It is crucial to rigorously test and validate strategies before implementation.

Addressing the misconception that quantitative trading strategies lose effectiveness once published, Vojtko cites research showing that strategies can still perform well over time. He advises traders to avoid data dredging and underscores the need for thorough testing and validation.

In terms of replication in academic research, Vojtko suggests increasing the cutoff point for statistical significance and employing out-of-sample tests to compare portfolios based on published data. This approach ensures more accurate replication and enables the identification of winning strategies.

To expand the pool of profitable strategies, Vojtko recommends building a database with a wide range of strategies and selecting those with the best performance. He also provides resources for finding quantitative trading strategies, such as the Social Science Network and Quantpedia.

Regarding programming languages for quantitative finance, Vojtko mentions the availability of various options and advises choosing a language that one is comfortable with. Python is a preferred language, but other options like Tradestation, Ninjatrader, or Ami Broker can also be effective. Vojtko emphasizes the need to merge finance and technology skills for successful algorithmic trading and offers educational programs to develop expertise in both areas.

  • 00:00:00 In this section, Arjuna introduces Radovan Vojtko, the CEO of Quantpedia, a website that serves as an encyclopedia of quantitative trading strategies. Vojtko is a former portfolio manager and has managed over 300 million euros in quantitative funds focusing on multi-assets ETA trend following strategies, market timing, and volatility trading. Vojtko emphasizes the significance of paying attention to financial academic research, mentioning that there are plenty of interesting trading strategies and ideas published in academic research that people can use for trading or tweak them for their own trading systems. He also shares some common issues related to implementing strategies that are out of academic research.

  • 00:05:00 In this section, Radovan Vojtko discusses the process of selecting trading strategies for their database. He explains that they read a lot of academic papers and select strategies that are implementable and have reliable performance and risk characteristics. He gives the example of the momentum strategy in equities which was first written about in a 1993 paper by Jagadeesh and Titman, and subsequent related papers. Vojtko also mentions that they do not publish trading code since institutional customers prefer to test strategies on their own data. Finally, he outlines the three big groups that conduct quantitative research: academics, sell-side research, and hedge funds and asset management companies.

  • 00:10:00 In this section, the speaker discusses the overview and classification of quantitative trading strategies. According to the speaker, equities are a well-covered asset class in academic research, followed by commodities, currencies, bonds, and real estate. The most popular time frame for trading strategies is monthly rebalancing, with high-frequency trading being underrepresented due to the need for more expensive data and programming requirements. In terms of topics, equity strategies such as long-short and momentum are the most popular, followed by market timing, value, and fundamental earnings effects. The speaker also presents their point of view on how to classify and find interesting trading strategies in a database.

  • 00:15:00 In this section, the speaker discusses the different classifications of quantitative trading strategies and introduces the concept of blind spots in research. Blind spots refer to areas of research that are not well covered, presenting opportunities to find new alpha or trading strategies. The speaker then presents a distribution of different strategies across asset classes, showing that equities are dominant, while bonds and REITs are not well covered. Among the well-known styles, momentum and arbitrage are well covered, but the speaker highlights opportunities in timing strategies for other asset classes and in developing interesting strategies for trading in currencies.

  • 00:20:00 In this section, Radovan Vojtko discusses the classification of quantitative trading strategies by asset class, with particular emphasis on equity strategies. He points out that there are more equity trading styles than all other asset classes combined, with six main types of equity strategies that include timing, arbitrage, and value trading. However, there are blind spots when it comes to popular styles and some asset classes are underexplored, such as bonds and commodities. Vojtko also highlights some gaps in intraday and short-only strategies, which offer a high opportunity for finding unique and interesting investment opportunities that have not been covered in research papers.

  • 00:25:00 In this section, the video discusses two quantitative trading strategies. The first strategy involves using a mean reversion approach to trade commodity futures. The approach involves grouping commodities with similar characteristics, calculating the commodity total return index for each commodity group, and building pairs within each group. The pairs are then traded based on the historical distance and daily positions are taken if the divergence of prices is over two standard deviations. The second strategy is pre-earnings announcement risk, which takes advantage of the tendency for stocks to drift after earnings announcements. By creating a long-short portfolio, investors can profit from this tendency. While the post-earnings announcement drift is well-known, the fact that stocks also tend to drift before earnings announcements is less well-known.

  • 00:30:00 In this section of the video, Radovan Vojtko explains the concept of alpha decay, wherein there is a difference in the in-sample and out-of-sample performance of a trading strategy. He also discusses the problem of P-hacking and replication issues in quantitative research, where researchers may test a large number of variations of a trading strategy until they find something interesting, leading to data mining. To avoid this issue, Vojtko suggests using momentum anonymize, which allows the trader to see if a strategy is actually profitable or if it's just a statistical fluke. Despite these issues, there are various quantitative trading strategies that have been published in academic papers, with one example being a pre-earnings announcement strategy that has shown a 40% yearly return.

  • 00:35:00 In this section, the speaker discusses the common misconception that quantitative trading strategies no longer work once they are published and known to others, as they get arbitrage by other players. However, research by McLean and Pontiff shows that some strategies still work even after publication, with more than 40% of alpha remaining after five years of publication. The speaker also talks about the persistence of anomalies or factors in trading, emphasizing that any strategy can be persistent and have a nice performance in the future, but poor timing by investors can lead to lower returns. The speaker warns against data dredging or data fishing, which is a use of data mining that can lead to false discoveries, and highlights the importance of rigorously testing any strategy before implementing it.

  • 00:40:00 In this section, Radovan Vojtko discusses the issue of replication in academic research, particularly in quantitative trading strategies. He mentions the problem of researchers mining data and looking for patterns without a specific hypothesis beforehand, resulting in statistical significance without actual practical use. Vojtko suggests increasing the cutoff point for statistical significance to 3.0 or 3.5 to be as hard as you can on the strategy found, using out-of-sample tests to compare portfolios of equity factors based on published data. This way, the data speaks for itself in picking out the winners, allowing for more accurate replication and potential use in future trading.

  • 00:45:00 In this section, Radovan Vojtko discusses a momentum unpublished anomalies strategy where each year, anomalies are ranked by their performance and the best-performing ones are traded in the subsequent year. This strategy helps to filter out unrealistic, underperforming or arbitrage strategies, increasing the chances of discovering profitable strategies through academic research. However, the strategy is not bulletproof and liquidity and transaction costs must be taken into account. Additionally, performance of anomalies can decrease and bias and blind spots must be addressed. Vojtko recommends building a database of more strategies and picking the ones with the best performance to increase the chances of finding profitable strategies.

  • 00:50:00 In this section of the video, the speaker takes questions from viewers and recommends resources for finding quantitative trading strategies. They suggest checking out the website Social Science Network as it is a repository of research papers from social science, which can be searched by keywords such as pairs trading or momentum trading. The speaker also recommends their own website, Quantpedia, which has a free section with over 60 common and well-known strategies and a premium section with more unique strategies. When asked which strategy beginners should start with, the speaker suggests looking at the asset cost picking and momentum strategies on EPS. For calculating beta decay, the speaker recommends referring to the academic papers mentioned in their publication or doing a Google search for academic papers on alpha decay.

  • 00:55:00 In this section, the speaker discusses the recommended programming languages for quantitative finance, stating that there are many available online and that it ultimately comes down to personal preference. They provide a link to their website which has several links to around 50 back testers, and they personally prefer Python but note that others are just as valid. They suggest choosing a language you are comfortable with and using a pre-constructed solution from provided sources like Tradestation, Ninjatrader, or Ami Broker to start trading or testing. Additionally, the speaker mentions that successful algorithmic trading requires a merging of skills in finance and technology, and they offer education programs to train individuals in both areas.
Classification of Quantitative Trading Strategies | Quantitative Finance | Radovan Vojtko
Classification of Quantitative Trading Strategies | Quantitative Finance | Radovan Vojtko
  • 2017.07.12
  • www.youtube.com
There exist thousands of academic research papers written on Quantitative Trading Strategies. Learn what these academics found out and how we can use their k...
 

Turning to data for a trading edge · Dave Bergstrom, quant trader



Turning to data for a trading edge · Dave Bergstrom, quant trader

In this video Dave Bergstrom, a successful quant trader, shares his journey in the trading world and emphasizes the importance of utilizing data analysis techniques to discover market edges. He emphasizes the need to avoid curve-fitting and over-optimization, recommends leveraging multiple resources for learning trading and programming, and stresses the significance of proper risk management and having realistic expectations. Bergstrom also discusses the potential decline of high-frequency trading and introduces his software package, Build Alpha, which assists traders in finding and generating profitable trading strategies.

Dave Bergstrom, initially a high-frequency trader, recounts his path from almost pursuing law school to becoming a trader. During his undergraduate studies, he delved into trading and sought information on platforms like finance Twitter and podcasts to learn about trading patterns and momentum stocks. Although he experienced early success, Bergstrom acknowledges that his early strategies and techniques differ significantly from his present trading methods. He highlights his use of data mining techniques during strategy development and introduces his software package, Build Alpha, which enables traders to employ various forms of analysis discussed in this episode.

Starting with his humble beginnings, Bergstrom reveals his initial foray into trading by selling counterfeit NFL jerseys and purses. Subsequently, he funded a trading account and engaged in trading stocks based on momentum and technical analysis, particularly chart patterns. However, he faced inconsistency and struggled to understand why his equity balance consistently returned to zero. With more experience, Bergstrom realized that the absence of a systematic approach hindered his ability to achieve consistent returns. It was only after he moved to Florida and worked as a trading assistant at a high-frequency trading firm that he discovered the realm of quantitative analysis, paving the way for consistency in his trading endeavors.

Bergstrom further discusses his transition to a role that demanded data analysis. To excel in this position, he self-taught programming and focused on objective technical analysis, as his firm believed in identifying anomalies or patterns in the data that could lead to profitable trades. He explains the process of testing and backtesting strategies before they can be employed, a journey that required several years of trial and error to achieve consistent success. Bergstrom's views on technical analysis have evolved, favoring objective analysis that utilizes data to identify patterns over subjective analysis reliant on intuition.

Programming plays a significant role in Bergstrom's trading journey, which he considers a superpower. Recognizing that Excel was insufficient for handling the vast amount of data in high-frequency trading, he learned programming to advance from a trading assistant role to a trade desk role. Bergstrom considers programming an excellent investment due to its asymmetrical gains and minimal risk. He advises aspiring programmers to explore different resources, remain diligent, and seek guidance from knowledgeable individuals to expedite the learning process.

Bergstrom emphasizes the importance of seeking multiple resources when learning to trade and program. He recommends utilizing platforms like Stack Exchange for programming and encourages learning multiple programming languages, such as Python, C++, and Java. While discussing his trading approach, Bergstrom identifies himself as a data miner and believes that numerous market edges can be discovered through data analysis. While some perceive data mining as prone to overfitting, he argues that it can be a valuable tool when steps are taken to prevent overfitting and over optimization.

Bergstrom sheds light on how he uncovers trading edges through data mining and employs a fitness function that searches for profitable strategies based on specific criteria. He highlights the importance of avoiding curve-fitting by employing techniques like maintaining a minimum number of trades and utilizing cross-validation. He explains that an edge refers to something with a positive expectation, which can be identified through data analysis. Ultimately, he seeks profitable strategies, even if they are not based on pre-existing hypotheses, but he places more confidence in strategies that align with logical reasoning.

Having a significant number of trades is crucial when testing a strategy, according to Bergstrom. He emphasizes the risks of curve-fitting and advises against optimizing parameters with look-back periods. Instead, he prefers using nonparametric metrics like counting measures. Furthermore, Bergstrom underscores the significance of market regimes, as well as volume and volatility, in understanding market behavior. He mentions a powerful graph he shared on Twitter that illustrates the importance of setting realistic expectations and employing Monte Carlo analysis to avoid under-allocating funds to a trading system.

Realistic expectations in trading are explored further, as Bergstrom emphasizes that even if a backtest shows a profitable strategy, it is crucial to understand that real-life results may differ. Tools like Monte Carlo simulations and variance testing assist traders in creating a distribution of possible outcomes and establishing realistic expectations for future trades. Bergstrom introduces his three laws of trading, with the first law favoring asymmetric risk-to-reward ratios. This means he prefers a lower winning percentage but a higher payoff, rather than the opposite.

Proper risk management takes center stage in Bergstrom's trading philosophy, particularly regarding bet sizing. He explains that it is not beneficial for a trader to have one trade with significantly more size than others within the same pattern or system. Bergstrom warns against overly investing in "exciting" trades, as it prevents the mathematical probabilities from playing out over a large number of trades, which is necessary for the law of large numbers to come into effect. He suggests that trading in a more conservative and consistent manner over a significant number of trades ensures the positive edge will manifest. While intraday and high-frequency trading align better with the law of large numbers, Bergstrom believes that daily time frames can also be effective if variance testing is satisfactory.

Bergstrom delves into the importance of strategy robustness across markets. While he acknowledges the value of creating strategies that work across multiple markets, he tends to shy away from those that generate insufficient trades. Regarding transaction costs and seeking higher profits in each trade, Bergstrom believes a balanced approach is attainable. The strategy should not be burdened by excessive transaction costs, but at the same time, it shouldn't be designed to generate an excessive number of trades. Shifting gears, Bergstrom addresses the common misconceptions surrounding high-frequency trading (HFT), stating that it has often been unfairly vilified due to people seeking a scapegoat. He firmly believes that HFT is beneficial and does not have predatory intentions.

Lastly, Bergstrom discusses the potential decline of high-frequency trading, which he attributes to increased competition and the exposure of strategies. The debate revolves around whether the decline is due to an oversaturated market or the monetary policies implemented by central banks, which do not support the two-sided market required for high-frequency trading. Bergstrom introduces his software package, Build Alpha, which empowers users to select signals and search for different strategies based on exit criteria and a fitness function. The software identifies the best strategies and generates tradeable code for each, enabling the creation of portfolios and thorough analysis. Interested individuals can visit the website buildalpha.com or contact Dave Bergstrom via email at David@buildalpha.com or on Twitter @Deeper_DB.

In conclusion, Dave Bergstrom's journey to becoming a successful trader showcases the importance of data analysis techniques in finding market edges. His emphasis on preventing curve-fitting, utilizing multiple resources for learning, practicing proper risk management, and maintaining realistic expectations provides valuable insights for aspiring traders. Furthermore, his thoughts on high-frequency trading and the introduction of Build Alpha demonstrate his commitment to advancing trading strategies and empowering traders through innovative software solutions.

  • 00:00:00 Dave Bergstrom, a high-frequency trader, discusses his journey from almost going to law school to trading. He started trading during undergrad and searched for information on the internet, such as finance Twitter and podcasts, to learn about trading patterns and momentum stocks. He had early success trading, but acknowledges that his early trading strategies and techniques he used then are much different from how he trades now. Dave also talks about how he uses data mining techniques during strategy development and suggests ways to reduce curve fitting. He even developed a software package called Build Alpha, which allows traders to perform many of the techniques and different forms of analysis discussed in this episode.

  • 00:05:00 Dave Bergstrom, a quant trader, shares his humble beginnings in trading, starting with making money through selling counterfeit NFL jerseys and purses. He then funded a trading account, initially trading stocks based on momentum and technical analysis, particularly chart patterns. However, he struggled with inconsistency and couldn't figure out why he kept returning to a zero equity balance. With more experience, Bergstrom realized that he didn't have a system and kept restarting, preventing any consistent returns. It was only when he moved to Florida and became a trading assistant at a high-frequency trading firm that he discovered quantitative analysis and found a new path to consistency in trading.

  • 00:10:00 Dave Bergstrom, a quant trader, talks about his transition into a role that required him to analyze data. Bergstrom had to teach himself programming and focus on objective technical analysis because the firm he worked for believed in searching for anomalies or patterns in the data that could lead to making profitable trades. He explains that there is a process of testing and backtesting before an edge or pattern can be used for trading, and he had to undertake trial and error over a few years to gain consistent success. Bergstrom's views on technical analysis have changed, and he believes that objective analysis, which uses data to determine patterns, is better than subjective analysis, which depends on intuition to identify patterns.

  • 00:15:00 Dave Bergstrom explains how he learned to program and why he views it as a superpower. He learned to program because he wanted to advance from a trainer assistant role to a trade desk role as he realized that Excel could not handle the amount of data involved in high-frequency trading. Bergstrom considers programming the best trade anybody can make because the gains are asymmetric while the risk is minimal. He advises anyone considering learning how to program to look at different resources, be diligent, and find people who can answer questions to help speed up the process.

  • 00:20:00 Dave Bergstrom discusses the importance of seeking multiple resources when learning how to trade and program. He recommends using Stack Exchange for programming and suggests learning multiple languages, such as Python, C++, and Java. When asked about his trading approach, Bergstrom admits to being a data miner and believes that there are many edges in the market just waiting to be discovered through data analysis. While some may view data mining as overfitting, he argues that it is a useful tool as long as one takes steps to prevent overfitting and over optimization.

  • 00:25:00 Dave Bergstrom talks about how he finds edges in trading through data mining and using a fitness function that searches for profitable strategies based on specific criteria. He emphasizes the importance of preventing curve fitting by using techniques such as minimum number of trades and cross-validation. He also explains that an edge is something that has a positive expectation, which can be identified through data analysis. Ultimately, he searches for profitable strategies even if it's not based on a pre-existing hypothesis, but if it makes logical sense, he puts more confidence in it.

  • 00:30:00 Dave Bergstrom discusses the importance of having a large number of trades when testing a strategy. He also mentions the risks of curve-fitting and how to avoid it by not optimizing parameters with look-back periods. Instead, he prefers using nonparametric metrics like counting measures. He also emphasizes the significance of market regimes as well as volume and volatility when understanding market behavior. Additionally, he explains a powerful graph he posted on Twitter that shows the importance of having realistic expectations and using Monte Carlo analysis to avoid under-allocating funds to a trading system.

  • 00:35:00 We learn about realistic expectations in trading. Even though a backtest may show a profitable strategy, it's important to understand that these results may not be the same in real life. Tools like Monte Carlo simulations and variance testing can help traders create a distribution of possible outcomes and determine realistic expectations for future trades. The guest speaker also introduces his three laws of trading, the first of which is that he prefers asymmetric risk to reward, meaning he'd rather have a lower winning percentage but a higher payoff than the opposite.

  • 00:40:00 Quant trader Dave Bergstrom emphasizes the importance of proper risk management in trading, specifically regarding the sizing of bets. He explains that it is not in a trader’s best interest to have one trade with significantly more size than the others in the same pattern or system. Bergstrom warns against betting too much on “exciting” trades, as it is not allowing the math to play out over a large number of trades, which is necessary for the law of large numbers to come into play. Bergstrom suggests that it is better to trade boringly and stay in the game over a large number of trades to ensure that the positive edge will play out. While intraday and higher frequency trading lend themselves better to the law of large numbers, Bergstrom believes that daily time frames can work as well if the variance testing is satisfactory.

  • 00:45:00 Dave Bergstrom discusses the importance of robustness across markets for a trading strategy. While he believes it is a good approach to create a strategy that works on multiple markets, he tends to shy away from something that doesn't generate sufficient trades. When asked about how transaction costs can impact a trading strategy and if it pays to look for more profit in each trade, Bergstrom believes that a happy medium is attainable, where the strategy does not kill you with transaction costs, but perhaps doesn't generate a thousand trades either. On a different note, Bergstrom claims that HFTs (high-frequency trading) are misunderstood and often been painted with a bad rap due to people looking for a scapegoat. He believes that HFT is beneficial, and there is nothing predatory about it.

  • 00:50:00 Dave Bergstrom discusses the potential decline of high-frequency trading as it becomes increasingly difficult to execute due to competition and exposure of strategies. There is debate about whether it is due to too many players in the market or the monetary policy laid out by the Fed and other central banks that do not support a two-sided market, which is what high-frequency trading requires. Bergstrom is working on a software package called Build Alpha which allows users to select from a list of signals and search for different strategies based on their exit criteria and fitness function. It then finds the best strategies and generates tradeable code for each, allowing for the creation of portfolios and analysis of the same. The website for Build Alpha is buildalpha.com, which users can reach Dave at David@buildalpha.com or on Twitter @Deeper_DB.
Turning to data for a trading edge · Dave Bergstrom, quant trader
Turning to data for a trading edge · Dave Bergstrom, quant trader
  • 2016.12.15
  • www.youtube.com
EP 103: Escaping randomness, and turning to data for an edge w/ Dave BergstromOn this episode, I’m joined by a quant trader who works at a high frequency tra...
 

Which programming language for quant and HFT trading



Which programming language for quant and HFT trading

This video provides a comprehensive overview of programming languages commonly used in quantitative trading and high-frequency trading (HFT). The speaker categorizes these languages into prototyping research and interpretive scripting languages, as well as legacy compiled languages such as Java, C#, C, and C++. Pros and cons of popular languages for modeling trading ideas, including Python, R, MATLAB, and Microsoft Visual Studio, are discussed in detail. Additionally, the video highlights important considerations when selecting a programming language, such as co-location, cost-effective prototyping, and broker support. It emphasizes the significance of using productivity tools and taking into account the entire trading system, including risk management and portfolio management.

The speaker begins by categorizing programming languages into different groups based on their suitability for prototyping research and interpretive scripting. In the context of quantitative trading, he specifically addresses Python and MATLAB as popular choices for modeling trading ideas. However, he points out the challenge of Python's splintered versions (2.7 and 3.x) and highlights the issues with R's compatibility and performance. Python, on the one hand, offers numerous options, which can be overwhelming for developers and requires additional training. On the other hand, R has certain limitations in terms of compatibility and performance.

Moving forward, the speaker delves into various programming languages commonly used in quantitative and HFT trading. Python is discussed, emphasizing its strengths in terms of data packages, but also its drawbacks such as slower execution and limited order management capabilities. The speaker also mentions MATLAB 2015 and Microsoft Visual Studio 2015, which allow the integration of Python. Legacy compiled languages like Java, C#, C, and C++ are highlighted, with Java being recommended as a suitable starting point for programming beginners. C# is praised for its ease of understanding and advanced techniques, while optimal performance with C# is limited to Windows environments.

The video further explores programming languages suitable for quantitative and high-frequency trading, including Java, C/C++, and MATLAB. Java and C# are noted for their easy integration with databases, but limitations can arise due to garbage collection impacting performance. C and C++ are lauded as languages offering optimal speed and memory control, but they can be more complex to learn. MATLAB is recognized as a powerful and versatile platform with various toolboxes for data acquisition, analysis, trading execution, and risk management. Its advanced mathematical and machine learning support, along with the ability to generate code in C/C++ through MATLAB Coder, are highlighted. The speaker also mentions the option of embedding MATLAB into a high-performing web server using MATLAB Production.

Considerations for selecting a programming language in quantitative and HFT trading are thoroughly discussed. The speaker highlights the advantage of co-location in trading exchanges, particularly in HFT trading, and mentions MathWorks as a provider that facilitates co-location. The affordability of Lab Home Edition, starting at $150, is mentioned as a cost-effective prototyping environment. Additionally, the choice of broker is emphasized as a critical factor influencing the selection of programming language. Interactive Brokers is highlighted as a broker that supports legacy languages like Java, C++, and C#. The speaker advises newcomers to utilize productivity tools and emphasizes the need to consider the broader aspects of the trading system, including risk management, assessment, and portfolio management.

Overall, the video provides valuable insights into the different programming languages used in quantitative trading and HFT, their strengths and limitations, and the key factors to consider when selecting a language for trading purposes. It underscores the importance of understanding the entire trading system and utilizing appropriate tools for efficient and effective trading operations.

  • 00:00:00 The speaker discusses the different programming language options for quant and high-frequency trading. He categorizes the languages into prototyping research and interpretive scripting languages, along with legacy compiled languages. The speaker covers Python and MATLAB, which are typically used to model trading ideas, and in particular, he points out the splintering problem in Python's two major versions (2.7 and 3.x). The speaker also provides some insight into the pros and cons of R and Python, and he suggests that R has some issues with compatibility and performance. Meanwhile, Python has too many options, which can be confusing for developers, and it requires a bit more training.

  • 00:05:00 The speaker discusses several programming languages used for quant and HFT trading, starting with Python, which is known for its data packages but is also slow and has limited order management capability. He also mentions MATLAB 2015 and Microsoft Visual Studio 2015, which enable the use of Python, and then moves on to legacy languages like Java, C#, C and C++, all of which are compiled languages. He highlights Java as a good starting point for newbies to programming, although it is limited in terms of running it properly and natively, and he recommends C# for its ease of understanding and advanced techniques. However, optimal performance with C# is only possible on Windows.

  • 00:10:00 The video discusses various programming languages that are useful for quant and high-frequency trading, including Java, C/C++, and MATLAB. Java and C# can integrate easily with other databases, but performance may be limited with garbage collections. C and C++ are the optimal performing languages for speed and memory control, but they can be complicated to learn. MATLAB is a powerful and universal platform with many toolboxes for data acquisition and analysis, trading execution, and water management. It also has advanced math and machine learning support, and the ability to generate code to C/C++ with strict compliance through MATLAB coder. It can also be embedded into a high-performing web server with MATLAB Production.

  • 00:15:00 The speaker discusses considerations for choosing a programming language for quant and HFT trading. He mentions how MathWorks allows for co-location in a trading exchange, which is advantageous for HFT trading. He goes on to talk about Lab Home Edition as a cost-effective prototyping environment for starting at $150. Additionally, he emphasizes that the choice of broker will greatly affect what language to use, with Interactive Brokers supporting legacy languages like Java, C++, and C#. The speaker advises newbies to use productivity tools and be aware of the smaller portion of the entire system, which includes risk management, assessment, and portfolio management.
Which programming language for quant and HFT trading
Which programming language for quant and HFT trading
  • 2015.10.13
  • www.youtube.com
Download: Which programming language for quant and HFT tradingI will be forwarding all newbies with questions to this video and Powerpoint PPT http://quantla...
 

"Basic Statistical Arbitrage: Understanding the Math Behind Pairs Trading" by Max Margenot



"Basic Statistical Arbitrage: Understanding the Math Behind Pairs Trading" by Max Margenot

In the video titled "Basic Statistical Arbitrage: Understanding the Math Behind Pairs Trading" presented by Max Margenot, the concept of statistical arbitrage is thoroughly explained. Margenot describes how statistical arbitrage involves creating trades based on imbalances identified through statistical analysis and a model of how the market should behave. The video focuses on pairs trading, which relies on fundamental statistical concepts such as stationarity, integration orders, and cointegration.

Margenot begins by introducing Quantopian, his company's platform that offers free statistics and finance lectures to assist individuals in developing trading algorithms. He then delves into the significance of stationarity, integration orders, and cointegration in pairs trading. Stationarity refers to all samples in a time series being drawn from the same probability distribution with the same parameters, often assumed to be normally distributed in financial applications. The augmented Dickey-Fuller test is introduced as a means to test for stationarity.

The speaker emphasizes the uncertainty associated with real-world data, highlighting the potential for false positives in hypothesis tests, particularly when dealing with subtle or sneaky relationships between variables. He demonstrates this by generating a pathological relationship in a time series that may go undetected by a hypothesis test. Margenot underscores the importance of cautious interpretation of results and reminds the audience that even visual inspection of a graph may not reveal the underlying statistical properties.

The limitations of modeling time series and the possibility of false positives are discussed. While a time series may exhibit mean-reverting behavior, it does not always indicate stationarity. Stationarity represents a scenario where a time series is both mean-reverting and follows a stationary, deterministic, and random distribution. The concept of integration orders is introduced, where integration of order zero does not imply stationarity, but stationarity implies integration of order zero. Cumulative sums are also explained, illustrating how multiple integrations of order zero result in higher orders of integration.

The assumption of stationary returns in finance and the difficulty of finding stationary time series are addressed. Returns are assumed to be normally distributed, indicating stationarity. Integrated order and difference notation are used to test for stationarity. The speaker notes that theoretically, price series should be integrated of order one due to their relationship with returns, which are integrated of order zero. An example is provided using pricing data from a company.

Margenot proceeds to explain the concept of cointegration, which involves the integration of time series in specific defined ways to yield a linear combination that is stationary. Although finding two integrated time series that are stationary together can be challenging, cointegration can be valuable when exploring price series that have a reasonable economic basis. The speaker emphasizes that bets can be placed based on the current value of the stationary spread, even without a specific time model for mean reversion.

The process of creating simulated data is demonstrated to illustrate spread calculation and estimation using linear regression. Margenot stresses that financial data is rarely as simple as subtracting one variable from another, necessitating a linear regression to estimate the relationship between the variables. The goal is to determine the beta value, which indicates the composition of the portfolio in terms of market returns. This information allows for long and short positions in pairs trading. An example involving a pair of alternative-energy securities is provided to illustrate the concept.

Constructing a linear regression between two potential securities for basic statistical arbitrage is explained. Margenot recommends finding two securities within the same sector that exhibit a relationship as a starting point to identify potential co-integrative relationships, which can indicate arbitrage opportunities. While stationarity between two securities is beneficial, the speaker emphasizes the need to trade on as many different independent bets as possible rather than relying solely on one pair.

The calculation of pairs and deals within statistical arbitrage is based on the log returns of the examined pairs. The linear regression between the log returns, known as the Engle-Granger method, is employed to determine whether the regression is stationary. Once a reasonable model of the world is established, a trader can gain an edge by having more information than others and making relatively informed bets. To actively trade and update the rolling spread, a rolling notion of the mean and standard deviation is necessary. Different methods such as moving averages and common filters can be utilized to iterate and enhance the trading strategy.

The speaker emphasizes that statistical arbitrage can be a simple or complex unit strategy. It involves identifying stationarity, cointegration, and relationships between pairs of stocks to trade on. The more information one has compared to others, the better they can capitalize on these relationships. Building a diversified portfolio requires independent bets that are not reliant on each other. The frequency of rebalancing depends on the individual pairs and the duration of stationarity observed in the data.

The video moves on to discuss the simulation of algorithmic trading with real-time data. The assumptions underlying linear regressions, such as heteroscedasticity, are mentioned as factors that can affect their viability. Cointegration is favored over correlation when modeling relationships between pairs of stocks, as it represents a stronger condition indicating stationarity. Bet sizes can be systematically determined using the mean and standard deviation of the hypothesized spread, unlike correlations, which may not lend themselves to systematic approaches.

In summary, the video provides a comprehensive explanation of statistical arbitrage and pairs trading. It covers essential concepts such as stationarity, integration orders, and cointegration. The importance of careful interpretation of statistical results and the need for independent bets are emphasized. The speaker highlights the role of linear regression in estimating relationships between pairs of stocks and the significance of mean reversion in identifying arbitrage opportunities. The video concludes by discussing the simulation of algorithmic trading and the considerations for constructing a diversified portfolio in statistical arbitrage.

  • 00:00:00 Max Margenot introduces the concept of statistical arbitrage and how it can be used to exploit market inefficiencies using statistical analysis. He explains that statistical arbitrage involves using a model of how the world should be and making trades based on the imbalance created by the statistical analysis. He then explains his company's platform, Quantopian, and how they offer free statistics and finance lectures to help people write trading algorithms. Margenot goes on to discuss the usage of stationarity, integration orders, and cointegration when building Paris trades, which are based on fundamental statistical concepts.

  • 00:05:00 The speaker discusses the concept of stationarity in time series data and the importance of it in statistical models, such as autoregressive and moving average models. The speaker notes that stationarity means that all samples in the time series data are drawn from the same probability distribution with the same parameters, and that this is typically assumed to be normally distributed in financial applications. The speaker introduces the augmented Dickey-Fuller test as a hypothesis test for stationarity and demonstrates its use on both stationary and non-stationary time series data.

  • 00:10:00 The speaker discusses the inherent uncertainty of working with real-world data as one is never sure of the data generating process that makes it behave in a particular way. This leads to the potential for false positives in hypothesis tests, especially with subtle or sneaky relationships between variables. The speaker demonstrates this by generating a pathological relationship with a time series that has a little periodic trend in the mean, which could possibly be missed by the hypothesis test. The speaker emphasizes the importance of care when interpreting results from hypothesis tests and points out that even looking at the graph may not reveal the underlying statistical properties.

  • 00:15:00 The speaker discusses the limitations of modeling time series and the possibility of false positives. He explains that although a time series may be mean-reverting (reverses back to the mean), it doesn't always imply stationarity. Instead, stationarity represents an instance of a time series being mean-reverting and following a stationary, deterministic, and random distribution. The speaker then introduces the notion of orders of integration, where integration of order zero doesn't imply stationarity, but being stationary implies integration of order zero. The discussion concludes with the concept of cumulative sums, where adding a series integrated of order zero multiple times produces a series integrated of order one and so on.

  • 00:20:00 The concept of integrated order and the assumption of stationary returns in finance are discussed. The speaker explains that it is difficult to find stationary time series, and that returns are assumed to be normally distributed, meaning they are stationary. To test for stationarity, the speaker demonstrates the use of integrated order and difference notation. Additionally, the speaker states that theoretically, price series should be integrated of order one due to their relationship with returns, which are integrated of order zero. An example is given using pricing data from a company.

  • 00:25:00 Margenot explains the concept of cointegration, which involves the integration of time series in certain defined ways resulting in the linear combination of those series that becomes stationary. While it is hard to find two integrated time series that are stationary together, cointegration can be useful in cases where there is a reasonable economic basis for exploring a particular set of price series. The stationary spread is used to bet on whether something will revert or not to the mean, and while there is no specific time model of how these reverts can happen, bets can still be placed based on the current value of the spread.

  • 00:30:00 Max Margenot explains the process of creating simulated data to illustrate the calculation of a spread and how to estimate it using a linear regression. He emphasizes that financial data is never as simple as having one instance of one variable minus one instance of the other, so the linear regression is necessary to estimate the relationship between the two variables. The goal is to find the beta value, which will tell us how the portfolio is made up of the returns of the market. By finding the beta value, we can determine what is a long and what's a short, allowing us to buy one X 2 and short beta X 1 in pairs trading. Margenot uses a specific example of a pair of alternative-energy securities to explain the concept.

  • 00:35:00 The speaker explains how to construct a linear regression between two potential securities for a basic statistical arbitrage. The speaker advises that finding two securities within the same sector that have some relationship to each other provides a good basis to jump off and see whether there is a co-integrative relationship that could indicate a potential arbitrage opportunity. The speaker cautions that while stationarity between two securities is great, it is only a forecast and that constructing an asset based on one pair is a terrible idea if one wants to trade pairs, emphasizing the need to trade as many different independent bets as possible.

  • 00:40:00 Max Margenot explains that the calculation of pairs and deals within statistical arbitrage is based on the log returns of the pairs being examined. The linear regression between the log returns, known as the Engle-Granger method, is used to determine whether the linear regression is stationary or not. Once a reasonable model of how the world is built, a bet can be placed based on some modicum of information more than someone else, giving an edge to make a relatively reasonable bet. To actively trade and update rolling spread, we need a rolling notion of the mean and standard deviation. Different methods can be used, such as moving averages and common filters, to iterate and improve trading strategy.

  • 00:45:00 The speaker explains how statistical arbitrage is a unit strategy that can be kept simple or made complex. The strategy involves identifying stationarity, cointegration, and relationships between pairs of stocks to trade on. The more information one has than others, the better they can trade on these relationships. As long as these relationships are independent from each other, the speaker recommends having as many independent bets as possible in order to build a diversified portfolio. Additionally, the speaker explains that the frequency of rebalancing depends on the individual pair and the duration of stationarity found in the data.

  • 00:50:00 The speaker explains how to simulate algorithmic trading with real-time data. He also talks about the assumptions that go into linear regressions, such as heteroscedasticity, which could make it not viable. The speaker shares his preference for cointegration over correlation when modeling relationships between pairs of stocks, as the former is a stronger condition that represents stationarity. He notes that bet sizes can be constructed systematically with the mean and standard deviation of the hypothesized spread, whereas this may not be done as systematically with correlations.
"Basic Statistical Arbitrage: Understanding the Math Behind Pairs Trading" by Max Margenot
"Basic Statistical Arbitrage: Understanding the Math Behind Pairs Trading" by Max Margenot
  • 2017.07.25
  • www.youtube.com
This talk was given by Max Margenot at the Quantopian Meetup in Santa Clara on July 17th, 2017. To learn more about Quantopian, visit: https://www.quantopian...
 

Complete overview of practical C++ programming for quant financial and HFT



Complete overview of practical C++ programming for quant financial and HFT

The video provides a comprehensive overview of the use of C++ programming in finance and high-frequency trading (HFT), offering valuable insights into various aspects of this field. It begins by discussing the book "Practical C++ Financial Programming," highlighting its significance in the finance industry. The book covers essential topics such as fixed income equities and provides practical examples with well-structured code sections. It assumes a level of comfort with C++ programming and provides guidance on leveraging C++ templates effectively. The speaker emphasizes the proper utilization of STL and boost libraries, as well as the use of open source libraries like new plot for plotting and QT for interface design.

Moving forward, the video explores the use of QT, a powerful tool for developing user interfaces in C++. While QT enables the creation of sophisticated graphical interfaces, it deviates from traditional C++ methodology, and the video sheds light on this aspect. The presentation then delves into mathematical concepts like linear algebra, interpolation, and numerical integration, breaking them down into basic algorithms and equations to facilitate understanding. Popular algorithms and modeling techniques relevant to finance are also discussed, with insights into their implementation in C++. The video emphasizes the importance of Monte Carlo simulations for financial applications, dedicating a chapter to this critical topic. Additionally, the use of Lua and Python for extending financial libraries is explored, along with an overview of the most popular programming languages for HFT job positions.

As the video progresses, it highlights the integration of Python and Lua with C++ and showcases how Lua can be effectively used with Redis, leveraging its embeddability within a C++ application. Various C++ techniques are also covered, including multi-threading using Plaza and the utilization of C++ 11 and 14 features. The video serves as an excellent introductory resource for individuals venturing into C++ programming, addressing some of the memory management challenges associated with the language. It provides a comprehensive roadmap for learning C++ programming, encompassing a wide range of options and techniques available to users.

Towards the end, the speaker shares a positive review of a recently published book on C++ programming for financial and high-frequency trading applications. This book specifically covers the new features introduced in C++ 17 that address low-level hardware concerns, making it an invaluable resource for those interested in this specialized field. Although the speaker acknowledges having no affiliation with the book, he highly recommends it as a valuable addition to the existing resources in this domain.

  • 00:00:00 The speaker provides an overview of the book "Practical C++ Financial Programming", focusing on the importance of C++ in the finance industry. The book covers fixed income equities and provides examples with a useful format that breaks down the code into sections. The book assumes that the reader is comfortable with C++ and provides guidance on how to efficiently use C++ templates, along with highlighting the right ways to use STL and boost libraries. The speaker also touches on using open source libraries like new plot for plotting and QT for interface design.

  • 00:05:00 The video discusses the use of QT, a tool for developing user interfaces in C++. While QT is useful for creating sophisticated graphical user interfaces, it breaks away from traditional C++ methodology. The video then moves on to more mathematical topics, such as linear algebra, interpolation, and numerical integration, all of which are broken down into basic algorithms and equations for easy understanding. The video also covers popular algorithms and modeling techniques, and how they can be implemented in C++. The book includes a chapter on Monte Carlo, which is critical for financial applications. Finally, the video discusses the use of Lua and Python for extending financial libraries, and the most popular languages for HFT job positions.

  • 00:10:00 The video covers the integration of Python and Lua with C++ and how Lua can be used with Redis, particularly due to its ability to be embedded into a C++ application. The video also explores various C++ techniques, including multi-threading using Plaza and using C++ 11 and 14 features. The video serves as an excellent introduction for those looking to move into C++ programming, and it also covers some of the memory management challenges associated with C++. Overall, the video offers a great roadmap for learning C++ programming and covers a variety of options and techniques available to users.

  • 00:15:00 The speaker gives a positive review of a new book on C++ programming for financial and high-frequency trading applications. The book covers new features in C++ 17 that address low-level hardware, making it a valuable resource for those interested in this field. The speaker highly recommends the book and emphasizes that he has no affiliation with it, but found it to be a great addition to the field.
Complete overview of practical C++ programming for quant financial and HFT
Complete overview of practical C++ programming for quant financial and HFT
  • 2015.06.23
  • www.youtube.com
A complete over view of this bookhttp://quantlabs.net/blog/2015/06/complete-overview-of-practical-c-programming-for-quant-financial-and-hft/
 

Algorithmic Trading Basics: Examples & Tutorial



Algorithmic Trading Basics: Examples & Tutorial

This video provides a comprehensive overview of algorithmic trading, covering various aspects such as trading styles, markets, and systems. The speaker begins by explaining the fundamentals of algorithmic trading, emphasizing the use of technical analysis based on price action, volume, and mathematical indicators. It is highlighted that algorithmic trading involves the execution of trades and back-testing of algorithms using computers, distinguishing it from traditional technical analysis.

Different types of quant/algorithmic trading are introduced, including high-frequency trading, statistical arbitrage, and trend/mean reversion/momentum trading. The speaker specifically focuses on swing and day trading in the futures market. Statistical arbitrage involves capitalizing on price differences by simultaneously buying and selling an asset, while trend/mean reversion/momentum trading utilizes computers to execute directional trades for profit. To illustrate these concepts, an algorithmic trading program example is demonstrated using TradeStation software. The program is designed to buy on a down day with a red candle and sell on the following positive day, incorporating a dollar target and stop. The speaker showcases the integration of this algorithmic program into a chart of the S&P 500 E-minis for back-testing purposes.

The next segment explores a trading strategy on TradeStation. The speaker uses a chart to demonstrate instances when the strategy would have been successful or unsuccessful based on candle colors. They zoom out to showcase the performance reports generated by TradeStation, providing metrics such as net profit, total profit, win rate, average trades, and drawdown. The optimization of the strategy is also addressed by adjusting stops and targets to assess the performance with different inputs. The speaker emphasizes the time-saving aspect of algorithmic trading, as it can provide valuable insights that would have otherwise taken months to discover.

Advantages and disadvantages of algorithmic trading are discussed in the subsequent section. The advantages include reduced human and emotional errors, rapid back-testing of trading ideas, faster order entry, and the ability to test multiple ideas and build portfolios. However, disadvantages such as overconfidence, overoptimization, and the inability to consider geopolitical events or fundamental trading techniques are also acknowledged. While an algorithm can be programmed to avoid trading on significant political or economic days, it generally operates in all market conditions.

The video concludes by summarizing its content. It clarifies the distinction between quantitative trading and fundamental or regular technical trading, emphasizing the power of algorithmic trading through a simple algorithm example. The advantages and disadvantages of algorithmic trading are reiterated for a comprehensive understanding. The speaker encourages viewers to reach out with any questions and expresses hope that the video has been informative and helpful.

  • 00:00:00 In this section, the instructor provides a primer on algorithmic trading, including the different trading styles, markets, and systems. Algorithmic trading primarily focuses on technical analysis, using price action, volume, and mathematical indicators to inform trades. The instructor explains that technical analysis itself is not necessarily algorithmic, as algorithmic trading involves using a computer to execute trades and back-testing algorithms. The instructor also identifies different kinds of quant/algorithmic trading, including high-frequency trading, statistical arbitrage, and trend/mean reversion/momentum trading, explaining that his company focuses on swing and day trading in the futures market.

  • 00:05:00 In this section, the speaker discusses two types of algorithmic trading: statistical arbitrage and trend/mean reversion/momentum trading. Statistical arbitrage involves buying and selling an asset simultaneously to profit from a price difference, while trend/mean reversion/momentum trading involves using computers to place directional trades to generate profits. The speaker then provides a basic example of an algorithmic trading program using TradeStation software. The code is based on buying on a red candle on a down day and selling on the next positive day with a dollar target and a stop. The program is then added to a chart of the S&P 500 E-minis for back-testing purposes.

  • 00:10:00 In this section, the speaker gives an example of a trading strategy on TradeStation. They use a chart to show examples of when the strategy would have worked and when it wouldn't have worked based on candle colors. The speaker then zooms out to show how TradeStation populates the performance reports, giving net profit and total profit of the strategy, as well as win rate, average trades, and drawdown. They also show how to optimize the strategy by changing the stops and targets to see how the strategy would have performed with different inputs. The speaker emphasizes that the point of using algorithms for trading is to provide information that would have taken months to figure out without them.

  • 00:15:00 In this section, the advantages and disadvantages of algorithmic trading are discussed. Advantages include the reduced chance of human error and emotional error, the ability to back-test trading ideas quickly, faster order entry, and the ability to test multiple ideas and build portfolios. Disadvantages include a sense of overconfidence and overoptimization, as well as algorithmic trading not taking into account geopolitical events or fundamental trading techniques. While an algorithm can be programmed to not take trades on key political or economic days, it generally runs in all market conditions.

  • 00:20:00 In this section, the speaker concludes by summarizing the content of the video. They first review the difference between quantitative trading and fundamental or regular technical trading, and then give an example of a simple algorithm to showcase the power of algorithmic trading. The advantages and disadvantages of algorithmic trading are also covered. The speaker encourages viewers to reach out if they have any questions and hopes that the video was helpful.
Algorithmic Trading Basics: Examples & Tutorial
Algorithmic Trading Basics: Examples & Tutorial
  • 2016.11.18
  • www.youtube.com
In this video, we discuss what algorithmic trading is and provide an example with actual code for a very basic trading algorithm. Also discussed are the adva...
Reason: