
Algorithmic Trading Models and Considerations
Explore Algorithmic Trading, including raw quantity computation, modifying quantity models, using predictions, and other considerations in trading such as monitoring prices, trade limits, and multiple exchanges. Dive into the world of predictive modeling and real-time trading strategies.
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
GS QUANTIFY Team HauntQuant Ankit Behura Jayant Thatte K Nitish Kumar October 25th, 2013 GS Quantify October 25, 2013 HauntQuant, IIT Madras
PROBLEM 1 Algorithmic Trading GS Quantify October 25, 2013 HauntQuant, IIT Madras
Problem 1 | Algorithmic Trading 3 / 27 Overview Compute the raw amount to be traded (A0) for the current time instant Compute ?0=?????? ???? ?? ?? ???? ???? ???? Modify the raw amount based on Departure of price from local avg. Slope of the price curve 2nd derivative of the price curve Trade Modify Exercise trade based on demand / supply modified amount to be sold GS Quantify October 25, 2013 HauntQuant, IIT Madras
Problem 1 | Algorithmic Trading 4 / 27 Modifying Raw Quantity: Models I ? ? ? Departure: ? = Linear Model ? = ?0(1 + ?) ? is limited between 0 and ???? A0 GS Quantify October 25, 2013 HauntQuant, IIT Madras
Problem 1 | Algorithmic Trading 5 / 27 Modifying Raw Quantity: Models II Exp-Exp Model ? = (???? ?0)[1 exp ?1? ] + ?0 for ? 0 ? = ?0exp ?2? for ? < 0 A0 Log-Exp model ? = min{????,?0[1 + log 1 + 1? ]} for ? 0 ? = ?0exp ?2? for ? < 0 A0 GS Quantify October 25, 2013 HauntQuant, IIT Madras
Problem 1 | Algorithmic Trading 6 / 27 Using Predictions Quadratic fit 1st and 2nd derivatives The departure (d) from the previous models is modified using the predictor ? = ?[exp 1? 2? ] GS Quantify October 25, 2013 HauntQuant, IIT Madras
Problem 1 | Algorithmic Trading 7 / 27 Other Considerations I RTL Keep monitoring prices; don t trade Modify A0 once RTL is over Trade limits After computing amount to be sold, only sell as much as possible Buy / Sell The algorithm always solves sell problem Buy problem is easily converted to sell problem by inverting the price curve GS Quantify October 25, 2013 HauntQuant, IIT Madras
Problem 1 | Algorithmic Trading 8 / 27 Other Considerations II Multiple exchanges (algorithm) 1. Define a new time series that is maximum of the prices across all exchanges at each time instant 2. Using the raw amount to be traded (A0), compute the actual amount to be traded (A) using the chosen model 3. Trade away as much of A as possible on the exchange with best price 4. Subtract the traded amount from A0 5. Having exhausted the best exchange, replace the current price of the security with the next best available current price 6. Using this new current price and the new A0 computed in step 4, compute the new amount to be computed 7. Continue this process till the desired amount (original A0) is traded or all exchanges are exhausted GS Quantify October 25, 2013 HauntQuant, IIT Madras
Problem 1 | Algorithmic Trading 9 / 27 Results I II GS Quantify October 25, 2013 HauntQuant, IIT Madras
Problem 1 | Algorithmic Trading 10 / 27 Problem I: Conclusion Departure models Greater stability Better average performance Generic Predictive models The size of window for prediction depends on the security Overall performance is good; can perform very bad in specific cases Model choice depends on investor profile Low risk models: Departure models High risk models: Predictive models GS Quantify October 25, 2013 HauntQuant, IIT Madras
PROBLEM 2 Error Detection in Prices GS Quantify October 25, 2013 HauntQuant, IIT Madras
Problem 2 | Error Detection in Prices 12 / 27 Breaks: Detection The time series of the price of a certain stock Price Series ???? = ????? ? ?????(? 1) Find jump (?) in price for each day Jump Series Find mean and standard deviation of the jumps (??,??) ??,?? Normalized Jump ??= (? ??)/?? Norm jump If the normalized jump is outside 3 sigma, declare break Break GS Quantify October 25, 2013 HauntQuant, IIT Madras
Problem 2 | Error Detection in Prices 13 / 27 Breaks: Ranking Securities in portfolio Decreasing order of change in dollar value of the portfolio Securities not in portfolio Decreasing order of magnitude of normalized jump Securities which are in portfolio are always ranked higher A Breaks Inaccurate Historical Data B Break Stock Split GS Quantify October 25, 2013 HauntQuant, IIT Madras
Problem 2 | Error Detection in Prices 14 / 27 Stock Splits Effect: n-for-1 split No. of stocks = n*(Old no. of stocks); Stock price = (Old stock price )/ n Purpose Very high stock price Small investors can t afford the stock Stock split More people can afford the stock Demand rises, liquidity rises Detection Price Ratio = Price(d-1)/Price(d) Ratio usually around 1 Stock split Price Ratio value approx. integer or simple fraction Sudden change should be uncorrelated with the market GS Quantify October 25, 2013 HauntQuant, IIT Madras
Problem 2 | Error Detection in Prices 15 / 27 Security Classification Classification based on 2 parameters Mean and Variance k-Means Algorithm Unsupervised learning: No training data needed Class Centroids The Algorithm Start from initial guess on parameters Classify each point into nearest cluster Re-compute the class centroids Iterate till centroids converge Classify into Nearest Class Compute Distances GS Quantify October 25, 2013 HauntQuant, IIT Madras
Problem 2 | Error Detection in Prices 16 / 27 k-Means Classification GS Quantify October 25, 2013 HauntQuant, IIT Madras
Problem 2 | Error Detection in Prices 17 / 27 Accuracy of Historical Data For each stock, compute correlation with the market (?) Correlation Compute expected movement (hence price) knowing Market movement for that day ? value for the stock Expected Movement Define ???? = ?????? ????? ???????? ????? Jump corresponds to uncorrelated movement Jump Declare break using the normalized jump approach mentioned earlier Normalized jump outside 3 is declared as inaccurate data Break GS Quantify October 25, 2013 HauntQuant, IIT Madras
Problem 2 | Error Detection in Prices 18 / 27 Market-wide Movements Method 1 Take the average of all prices and check for breaks in this curve Simple to implement Method 2 On each day look for breaks in individual stocks (based on that stock s past price alone) Report the number of stocks that have breaks If majority of stocks have breaks on a certain day, declare market- wide movement A good approach would be to combine both these methods GS Quantify October 25, 2013 HauntQuant, IIT Madras
PROBLEM 3 Monte Carlo in Derivative Pricing GS Quantify October 25, 2013 HauntQuant, IIT Madras
Problem 3 | Monte Carlo in Derivative Pricing 20 / 27 Problem 3: Overview Poisson Process Stock price Binary option Strike Price Expiration Time S(t) V K T ? ? = ? 0 exp ? ? ?? ? = ??? ????? where, y = +1 with ? = 1 ?? y = -1 with ? = ?? Binomial Distribution Poisson Distribution Exponential Distribution NY- t2-t1 n(Y-) GS Quantify October 25, 2013 HauntQuant, IIT Madras
Problem 3 | Monte Carlo in Derivative Pricing 21 / 27 Analytical Solution ?1 ?2 1 ?1 ?2 Poisson Arrivals 0 1 P ? = ? = ? ? = 1 P 2?1 1 = ? /? = 1 + ? ? = 2 P 1 2?2 2?4= ? /? = 2 + N = 1 ? = 2?1 1 N = 3 ? = 2?1+ 2?3 1 N = 5 ? = 2?1+ 2?3+ 2?5 1 Assuming equal probabilities for both X(0) = 1 and X(0) = -1, we arrive at E ? = 0 2? =1 2 ?=1 where, P ?, is Poisson Distribution N = 2 ? = 1 2?2 N = 4 ? = 1 2?2 2?4 N = 6 ? = 1 2?2 2?4 2?6 ?2? ?, 2(?/3) GS Quantify October 25, 2013 HauntQuant, IIT Madras
Problem 3 | Monte Carlo in Derivative Pricing 22 / 27 Monte Carlo Solution td Generate exponentially distributed time samples summing to >1 1 Create Path: Introduce a direction flip at each event 2 Repeat 1 & 2 to generate many paths for Monte Carlo Simulation 3 GS Quantify October 25, 2013 HauntQuant, IIT Madras
Problem 3 | Monte Carlo in Derivative Pricing 23 / 27 Compute Parameters Averaging over all the simulation paths Parameter Mean Standard Deviation Skewness Kurtosis Average of Xi (Xi-X)2 (Xi-X)3/ 3 (Xi-X)4/ 4 Symmetric Paths ? ? < ?=> Reduced Sample Space Re-evaluate parameters GS Quantify October 25, 2013 HauntQuant, IIT Madras
Problem 3 | Monte Carlo in Derivative Pricing 24 / 27 Parameter Extraction Given, ? ? ??? 0 ? 5 To extract : , ? ? ? = log? ? ? 0 GS Quantify October 25, 2013 HauntQuant, IIT Madras
Problem 3 | Monte Carlo in Derivative Pricing 25 / 27 Parameter Extraction ? ? =1 ? ??(?) ?? ti Extract ? Inter-arrival times (ti s) exponentially distributed with parameter Results Parameter Extracted Value 0.56$/year 4.57 per year ? Extract GS Quantify October 25, 2013 HauntQuant, IIT Madras
THANK YOU Questions? GS Quantify October 25, 2013 HauntQuant, IIT Madras
References 27 / 27 References Jan Ivar Larsen, Predicting Stock Prices Using Technical Analysis and Machine Learning , Norwegian University of Science and Technology T. Dai et. al., Automated Stock Trading using Machine Learning Algorithms , Stanford University D. Moldovan et. al., A Stock Trading Algorithm Model Proposal, based on Technical IndicatorsSignals , Vol 15 no. 1/2011, Informatica Economica http://www.vatsals.com/Essays/MachineLearningTechniquesforStockPrediction.pdf 1. 2. 3. 4. Other References GS Logo: http://www.goldmansachs.com/ IITM Logo: http://researchportal.iitm.ac.in/?q=download-forms GS Quantify October 25, 2013 HauntQuant, IIT Madras