by: avi thaker algorithmic trading: an introduction · hurst(gbm): 0.498349157279 hurst(mr):...
Post on 07-Jul-2020
11 Views
Preview:
TRANSCRIPT
AlgorithmicTrading:AnIntroduction
BY:AVI THAKER
AVI.THAKER@GMAIL.COM 1
TableofContentsLetsPlayaGame
ETFCreation/Redemption
ETF/IndexArbitrage◦ HFTandFlow◦ DealFlow
StatisticalTesting◦ AugmentedDickey-Fuller(ADF)Test◦ HurstExponent◦ VarianceandTermStructure
NeuralNetworks
PersonalLearnings
AVI.THAKER@GMAIL.COM 2
LetsPlayaGame:TradingObjective:MakeasmuchmoneyaspossibleReward:$5AmazonGiftCardperteammemberTeamSize3-4◦ 1Trader– tradesonthefloorwithothertraders◦ 1Runner– Runestheordersmadebythetrader◦ 1+Backend”PrimeBroker”– Clearthetradesmadewiththeteams
Tradingageometricrandomwalk;6rounds45secondseachMustquoteaspread(unitvalues),e.g.30-32Mustaccepttradeifsomeonehits (acceptsyourbid)ortakes (acceptsyourask)Tradesmustbecleared(thebackendandrunnersverifytradewithotherbackend)tocountWillfillallunfilledordersattheendwith2unitspenaltycost
AVI.THAKER@GMAIL.COM 3
LetsPlaya Game:TheTicketTEAMID:0001TRADEPRICE:32TRADESIZE:10TRADEDIRECTION:BUY
TRADEDWITH:0003INITIAL:TS
TEAMID:0003TRADEPRICE:32TRADESIZE:10TRADEDIRECTION:SELL
TRADEDWITH:0001INITIAL:MK
GlobalWorkbook(GoogleSheet) PersonalWorkbook
AVI.THAKER@GMAIL.COM 4
ETFCreation/RedemptionAuthorizedparticipant(marketmaker,intuitionalinvestor,specialist)borrowsstocksharesandplacestheminatrusttoformETFcreationunits – bundlesofstockunits
TrustprovidessharestotheAP,andsharessoldtopubliconopenmarket
RedeemingETF◦ Sellsharesonopenmarket◦ Formacreationunitandandexchangeforunderlyingsecurity
◦ Taxefficient
CreationUnit LastTrade Bid Ask Size Net PercentageAMD 13.7 13.69 13.7 100 1370 16.31% INTC 35.16 35.16 35.17 100 3516 41.85% AAPL 140.64 140.63 140.64 25 3516 41.85% CreationUnit 84.02 100 8402 100.00%
AVI.THAKER@GMAIL.COM 5
ETF/IndexArbitrageThisisthemostcommonstrategyemployedbymostquantfirmsandbanks◦ JaneStreet,AQR,JumpTrading
Youneedtobefast orhaveflow◦ Someofyoumayhavedonethisinthegame
ArbitragehappenswhenETFtradesatadiscountorpremiumtotheNAV◦ Institutional:WhenETFprice>NAV,theAPwillsellsharesitreceivedduringcreationandmakeaspreadbetweenthecostoftheassetsitboughtfortheETFissuerandthesellingpricefromtheETFshares.APcanalsobuytheunderlyingsharesthatcomposetheETFdirectlyatlowerprices,sellETFsharesontheopenmarketatthehigherprice,capturingthespread.
◦ Individuals:WhentheETFissellingatapremium(ordiscount),individualscanbuy(short)theunderlyingsecuritiesinthesameproportionsandshort(orbuy)theETF.Limitedbyliquidityandspread◦ IfinsidethespreadneedtoknowiftheETFgoestosharepriceorsharepricegoestoETFprice
DothisataninternationallevelwithADR’s
Unit LastTrade Bid Ask Size Net PercentageAMD 13.7 13.69 13.7 100 1370 16.31% INTC 35.16 35.16 35.17 100 3516 41.85% AAPL 140.64 140.63 140.64 25 3516 41.85% CreationUnit 84.02 84.01 84.03 100 8402 100.00%
Example PriceCalculatedAsk 84.03CalculatedBid 84.0075ETFBid 84.04ETFAsk 84.05
Whatisthepotentialprofitofthistrade?
AVI.THAKER@GMAIL.COM 6
HFTandFlowPureArbitrage◦ Fastestalwayswins
DealFlow◦ Ordersexecutedonbehalfofanotherclient◦ E*TRADE– guaranteed2secondexecutionmarketorder◦ SmartOrders
ExampleCompanies◦ Citadel,marketmakers,Goldman,JPMorgan,etc.
NYSE:GLD127.04-127.05
BuythenSell
LSE:GLD127.05-127.06
SellthenBuy
AVI.THAKER@GMAIL.COM 7
DealFlow:TheRussellRebalanceBankwilltradeallofthepositionsonbehalfofFTSERussell(moves~20Billioninafewhours)forasingleclient◦ Buysupinanticipationofthetradeandsellstheirownsharestotheclient
◦ Massivemarketmoves
Legalizedinsidertradingandmarketmanipulationduetosheersizeoforders
GoldmanactuallypaysRussell(andthelike)fortheirorderflow!
AVI.THAKER@GMAIL.COM 8
DealFlow:MarketMicrostructureCapturetheSpread
IncreaseLiquidity
Onbothsidesofthemarket
Riskyduringtimesofvolatility
Mustbefastandhaveexcellentqueueposition
Mathisgenerallymorecomplicated
Manipulatemarketwhenincomingmarketordertogetbetterprice
Bids Price Asks100.03 2,1
100.02 3,7,8100.01 5,2,15
100 1,2,5
1,2 99.99
2,5,8 99.98
3,8,1,5,3 99.97
2,3 99.85
Lotsofmachinelearning:thinkBayesianandneuralnetworks,ML
AVI.THAKER@GMAIL.COM 9
StatisticalTestingMeanReversion◦ Aprocessthatreferstoatimeseriesthatdisplaysatendencytoreverttoitshistoricalmean
◦ Morespecifically:ifthepriceswithintheseriesmoveawayfromtheirinitialvaluefasterthanthatofGeometricBrownianMotion
◦ Ornstein-Uhlenbeck process(arandomwalkhasnomemory)
Momentum◦ Theexactoppositeofmeanreversion◦ Movementawayfromtheinitialvaluefasterthanthatofrandomwalk
Meanreversionandmomentumgohandinhand,inidentifyingoneyoumayidentifytheother
Willcovertwomethods:AugmentedDickey-Fullertest,andtheHurstExponent
PicturesFrom:http://marcoagd.usuarios.rdc.puc-rio.br/revers.htmlhttp://www.stockcharts.com
AVI.THAKER@GMAIL.COM 10
StatisticalTesting:TermsOrenstein-Uhlenbeck SDE
ChangeinpriceseriesinnexttimeperiodisproportionaltothedifferencebetweenthemeanpriceandthecurrentpricewithGaussiannoise
MotivatesAugmentedDickey-Fuller(ADF)Test
𝒅𝒙𝒕 = 𝜽 𝝁 − 𝒙𝒕 𝒅𝒕 + 𝝈𝒅𝑾𝒕𝜃 = 𝑟𝑎𝑡𝑒𝑜𝑓𝑟𝑒𝑣𝑒𝑟𝑠𝑖𝑜𝑛𝑡𝑜𝑚𝑒𝑎𝑛𝜇 = 𝑚𝑒𝑎𝑛𝑣𝑎𝑙𝑢𝑒𝑜𝑓𝑝𝑟𝑜𝑐𝑒𝑠𝑠𝜎 = 𝑣𝑎𝑟𝑖𝑎𝑛𝑐𝑒𝑜𝑓𝑡ℎ𝑒𝑝𝑟𝑜𝑐𝑒𝑠𝑠𝑊@ = 𝑊𝑖𝑒𝑛𝑒𝑟𝑃𝑟𝑜𝑐𝑒𝑠𝑠𝑜𝑟
𝐵𝑟𝑜𝑤𝑛𝑖𝑎𝑛𝑀𝑜𝑡𝑖𝑜𝑛
AVI.THAKER@GMAIL.COM 11
AugmentedDickey-Fuller(ADF)TestIdentifypresenceofaunitrootinautoregressivetimeseries
Reliesonthefactthatifapriceserieshasameanreversionthenthenextpricewillbeproportionaltothecurrentprice
LinearModelofOrderpΔ𝑦@ = 𝛼 + 𝛽𝑡 + 𝛾𝑦@JK + 𝛿KΔ𝑦@JK + ⋯+ 𝛿NJKΔ𝑦@JNOK + 𝜖@
𝛼 = 𝑐𝑜𝑛𝑠𝑡𝑎𝑛𝑡𝛽 = 𝑐𝑜𝑒𝑓𝑓𝑖𝑐𝑖𝑒𝑛𝑡𝑜𝑓𝑡𝑖𝑚𝑒𝑡𝑟𝑒𝑛𝑑(𝑙𝑜𝑛𝑔𝑡𝑒𝑟𝑚𝑑𝑟𝑖𝑓𝑡)
Δ𝑦@ = 𝑦 𝑡 − 𝑦 𝑡 − 1
Testingnullhypothesis:𝛾 = 0◦ Indicatesthatprocessisarandomwalk(𝛼 = 𝛽 = 0)
AVI.THAKER@GMAIL.COM 12
AugmentedDickey-Fuller(ADF)TestTeststatistic:sampleproportionality/standarderrorofsampleproportionality
𝐷𝐹Y =𝛾Z
𝑆𝐸(𝛾Z)Negativenumber,andmustbelessthancriticalvaluestobesignificant
Codeadf_test.py
Calculated Test Statistic: -2.1900105031287529 P-Value: 0.2098910250427564# Datapoints: 210610%: -2.56750111766769565%: -2.86291337107029831%: -3.4334588739173006
Cannotrejectnullhypothesis,andunlikelytohavefoundameanrevertingtimeseries
AVI.THAKER@GMAIL.COM 13
HurstExponentAstochasticprocessisstronglystationaryifitsjoinprobabilitydistributionisinvariantundertranslationsintimeorspace◦ Meanandvarianceofprocessdonotchangeovertimeanddonotfollowatrend
HurstExponenthelpstocharacterizethestationarityofatimeseries◦ Reverting,trending,orneither
Varianceofalogpriceseriestoidentifyrateofdiffusivebehavior𝑉𝑎𝑟 𝜏 = log 𝑡 + 𝜏 − log 𝑡 b
Sincelarge𝜏,varianceisproportionalto𝜏 forGeometricBrownianMotion𝜏~ log 𝑡 + 𝜏 − log 𝑡 b
Ifautocorrelationsexisttherelationshipisnotvalid,butcanbemodifiedtoinclude2HwiththeHurstExponentvalueH
𝜏bd~ log 𝑡 + 𝜏 − log 𝑡 b
AVI.THAKER@GMAIL.COM 14
HurstExponent:Meaning𝐻 < 0.5meanrevertingprocess
𝐻 == 0.5 GBM𝐻 > 0.5 trendingprocessCharacterizesextent◦ Closerto0moremeanreverting◦ Closerto1moretrending
Trydifferenttimeperiods,differentstocks
Hurst(GBM):0.498349157279Hurst(MR):-6.26637088795e-05Hurst(TR):0.95964231812Hurst(GOOG):0.50788012279
AVI.THAKER@GMAIL.COM 15
VarianceandTermStructure
Notincludedincode
Plotoflog 𝑉𝑎𝑟 𝜏 𝑣𝑠 log 𝜏 forSPY◦ Slope/2istheHurstexponent◦ Intraday
◦ Returnsofmid-pricesfrom1minuteto2^10minutes◦ H = 0.494 ± 0.003;slightlymeanreverting
◦ Daily◦ Returnsfrom1dayto2^8days◦ H = 0.469 ± 0.007;stronglymeanreverting
MeanreversionstrategiesshouldworkbetterthanintradaystrategiesonSPY
http://epchan.blogspot.com/2016/04/mean-reversion-momentum-and-volatility.htmlAVI.THAKER@GMAIL.COM 16
VarianceandTermStructure:Gold
Intraday: 𝐻 = 0.505 ± 0.002
Daily: 𝐻 = 0.469 ± 0.007
16-32daysvolatilitiesdriftfromtheregression◦ Thisiswhereweshouldswitchfrommomentumtomeanreversionstrategies
ATrendingExample:USOIntraday 𝐻 = 0.515 ± 0.001Daily 𝐻 = 0.560 ± 0.020
Momentumstrategiesshouldworkwellhere http://epchan.blogspot.com/2016/04/mean-reversion-momentum-and-volatility.html
AVI.THAKER@GMAIL.COM 17
ExampleStrategiesMomentum◦ Exponentialmovingaverages(MACD◦ Breakouts◦ VolatilitySurges◦ Newsdriven◦ Tendtohavelowwinratesbuthighprofitability
Reversion◦ Bollingerbands◦ Statisticalpairstradingandindextrading◦ Tendtohavehighwinratesandlowprofitability
AVI.THAKER@GMAIL.COM 18
StrategyDetail:ExponentialMovingAverage:EMA
Infiniteimpulseresponsefilter
LesslagthanSMA
Commonlyusedsignal
𝛼 =2
𝑛 + 1𝐸𝑀𝐴stuuvw@=𝑝K + 1 − 𝛼 𝑝b + 1 − 𝛼 b + ⋯1 + 1 − 𝛼 + 1 − 𝛼 b +…
= 𝐸𝑀𝐴Nuvyz{t| + 𝛼 𝑝stuuvw@ − 𝐸𝑀𝐴Nuvyz{t|
AVI.THAKER@GMAIL.COM 19
TradingTheEMA
EnterLong:Close>EMA&Prev_Close >EMA_PrevEnterShort:Close<EMA&Prev_Close <EMA_Prev
AVI.THAKER@GMAIL.COM 20
StrategyDetail:CommonSignalsBollingerBands
VolatilityBands◦ Baseduponstandarddeviation◦ Identifiespointsofreversion
MiddleBand=50-DaySMA
UpperBand=50-DaySMA+50-DaySDofPrice
LowerBand=50-DaySMA- 50-DaySDofPrice
AVI.THAKER@GMAIL.COM 21
Example:TradingtheBollingerBands
AVI.THAKER@GMAIL.COM 22
NeuralNetworksThebelowlinkcontainsatutorialinwhichaneuralnetworkisusedtopredicttimeseriesstockdatausingMicrosoft’sdeeplearningplatformCNTKpublishedinconjunctionwithMSR
https://github.com/Microsoft/CNTK/blob/master/Tutorials/CNTK_104_Finance_Timeseries_Basic_with_Pandas_Numpy.ipynb
AVI.THAKER@GMAIL.COM 23
PersonalLearningsLESSONSFROMFAILURE,SUCCESS,ANDPUREDUMBLUCK
AVI.THAKER@GMAIL.COM 24
TechnicalIndicators
Technicalindicatorsaremostlyuselessontheirown
Mustidentifysomethingthathappensinthemarket,andusetheindicators(orcomeupwithyourown)torepresentthatsomething
Datavisualizationiscrucial
Simplicityisusuallybetter
RSIRelativeStrengthIndexParabolicSAR– ParabolicStopandReversePriceChannelsVWAP– VolumeWeightedAveragePriceZigZagMACD– MovingAverageConvergenceDivergencePPO– PercentagePriceOscillatorKST- KnowSureThingUltimateOscillatorVortexIndicator…Thelistgoesonforever
AVI.THAKER@GMAIL.COM 25
Backtesting aStrategy/Risk
Provideevidenceofprofitability◦ Curvefitting/optimizationbias◦ In-samplevsout-of-sample◦ Forwardlookingbias
Risktolerance
KeyStatisticsAveragewins ::0.637USDAverageloss ::-0.438USD#Wins ::214#Losses::210#Neutrals ::3WinRate ::0.501PPC ::0.104USD#Traded ::427.0Ann.Sharpe ::2.335
AVI.THAKER@GMAIL.COM 26
Backtesting aStrategyDoesthestrategyworkacrossmanyassets?
Howmanyyearsdoesitworkfor?
Doesitescapethebid-askbounce?
RiskTolerance?◦ MaximumDrawdown?
Fees?Tradingfrequency?
InSample:SPY2004-2010OutofSample:AssetsRandomlySelected:ADBEXLNXBBBYCFNEMCADPAFLDETSPLSDGADSALLMETCLPXWYN
Overall:19802016Sharpe:2.12PPC:0.13Wins:12634Losses:10527Trades:23666
Sharpe:1.299PPC:0.338Wins:255Losses:202Trades:463.0
Wouldyoutrademe?
AVI.THAKER@GMAIL.COM 27
OrderSizing
Generallysizeordersinverselyproportionaltovolatility
Overall:20012016Sharpe:2.38PPC:0.19Wins:23448Losses:19719Trades:43378
Overall:20012016Sharpe:2.91PPC:0.12Wins:23448Losses:19719Trades:43378
NotVolatilitySizedOrders VolatilitySizedOrders
AVI.THAKER@GMAIL.COM 28
BiasesandPitfallsThesecanbedoneunintentionally
CurveFittingBias◦ Adjusting/addingparametersuntilthestrategylooksattractiveinbacktest
Forwardlookingbias◦ Programlooksatfutureduetobugincode◦ Calculatingoptimalparameters,optimizations◦ Lookingatthedata!
SurvivorshipBias◦ Notincludingfulluniverse(pre2008crash,2007algo tradingblowup)
PsychologicalBias◦ Canyoutoleratea5monthdrawdown?Losehalfyourportfolio◦ Yourbacktests willsuggestpossibleseverity
AVI.THAKER@GMAIL.COM 29
GeneralTipsThisisnotagetrichquickscheme
Findingalphaishard,donotgetdiscouraged
Drawdownarepainful,becarefulwithleverage
Trustyouralpha(ifyouhavesome),strategiesareusuallysimple
Performance◦ Outofsampleperformanceisgenerally½ofinsampleperformance◦ Livetradingperformanceisgenerally¼ofinsampleperformance◦ Duetocurvefitting,unexpectedslippage,etc.
Makesureyouaccountfortransactionfeesandslippageand ordersizes
Funandexcitingwaytolearnnotonlythemarketsbutalsocomputerscienceandmath
Dataisyourfriend
Buildyourownbacktester/executionenvironment
AVI.THAKER@GMAIL.COM 30
SystemArchitectureOverview
PythonCompiledC
Multi-Threaded◦ Caninstantiatemultiplestrategies
EventDrivenBacktester◦ Eliminateserrors
Canusethesamestrategyfortradingandbacktesting
Strategy
RSI
BacktesterClient(IB) ClientA UDP ClientB
• Redundantinstances• MultipleinstancescommunicateoverUDPtocheckstate• Masterslave/slavesarchitecture• CanextendtoNinstances
• AWSandPersonalServer
AVI.THAKER@GMAIL.COM 31
LimitOrderExecution– PlaceOrderBids Price Asks
100.03 2,1
100.02 3,7,8100.01 5,2,15
100 1,2,5
1,2 99.99
2,5,8 99.98
3,8,1,5,3 99.97
2,3 99.85Placelimitorderof2lotsat99.99
AVI.THAKER@GMAIL.COM 32
LimitOrderExecution– BookMovementBids Price Asks
100.03 2,1
100.02 3,7,8
100.01 5,2,15
100 1,2,5
1,2,5 99.99
2,5,8 99.98
3,8,1,5,3 99.97
2,3 99.85
Fillat99.99,thisbecomesremoved,andpositionadvances.Atradehappens
Anotherorderisplacedbehindyou
Peoplecanceltheirorders
AVI.THAKER@GMAIL.COM 33
LimitOrderExecution– OrderFillBids Price Asks
100.03 2,1
100.02 3,7,8
100.01 5,2,15
100 1,2,5
2,5 99.99
2 99.98
3,8,1,5,3 99.97
2,3 99.85
Afteranorderisfilledyoumoveupinthequeue,untilyoueitherarefilledorcanceltheorderWearenowfirstinthequeue
AVI.THAKER@GMAIL.COM 34
Backtesting aStrategyBacktesting withLimitorderExecution◦ Simulatebyplacinglimitorders◦ Needtocheckforfills◦ Complexandrequirestime◦ Doesnotperfectlymodelslippage
Backtesting withCloseexecution◦ Ordersfilledoncloseofbar◦ Subjecttobid/askbounce◦ Mustsubtractslippagenumbers◦ Morethan2ticks?
EventDriven
AVI.THAKER@GMAIL.COM 35
AppendixDETAILSTHATMIGHTBEINTERESTINGTOREAD
AVI.THAKER@GMAIL.COM 36
Appendix:FurtherReadingsBestguidetostartingalgo trading(intro/backtester takenfromhere)◦ http://www.quantstart.com/
ExecutionEnvironment/Backtester/Community◦ https://www.quantopian.com/
CheaptradingplatformwithAPI◦ https://www.interactivebrokers.com/ind/en/main.php
◦ Stellardocumentationonhowtodoexecution
TechnicalAnalysisLibraryTA-Lib◦ http://ta-lib.org/◦ https://pypi.python.org/pypi/TA-Lib
Data:◦ Free:YahooFinance,GoogleFinance– errorprone◦ Cheap:PiTrading,Kibot,Tickwrite
AVI.THAKER@GMAIL.COM 37
Appendix:SharpeRatio𝑆ℎ𝑎𝑟𝑝𝑒 =
𝑟N − 𝑟}𝜎N
𝑟N = 𝑝𝑜𝑟𝑡𝑓𝑜𝑙𝑖𝑜𝑟𝑒𝑡𝑢𝑟𝑛𝑟} = 𝑟𝑖𝑠𝑘𝑓𝑟𝑒𝑒𝑟𝑎𝑡𝑒
𝜎N = 𝑠𝑡𝑎𝑛𝑑𝑎𝑟𝑑𝑑𝑒𝑣𝑖𝑎𝑡𝑖𝑜𝑛𝑜𝑓𝑟𝑒𝑡𝑢𝑟𝑛Measuresriskadjustedperformance◦ Riskvs.Reward
HigherisusuallybetterRiskfreeratesometimesassumedtobe0Usuallyannualizedandvolatilitytakenasstandarddeviation◦ Monthly:Volatilitysampledmonthly*sqrt(12)◦ Daily:Volatilitysampleddaily*sqrt(252)◦ Minutely:Volatilitysampledminutely*sqrt(390*252)
AVI.THAKER@GMAIL.COM 38
Appendix:Candlestick/BarDataOpen– priceatstartofbar
High– highestprice
Low– lowestprice
Close– priceatendofbar
Volume– numbertradedduringbar
Canbeonanytimescale:secondstomonthly
http://www.financial-spread-betting.com/course/candle-stick-charting.html
AVI.THAKER@GMAIL.COM 39
Appendix:OrderSizingAverageTrueRangeScaling
Reducestradesizeduringtimesofvolatility,Increaseduringlowvolatility
IncreasesSharpeRatio
Canadjusttosizeofcontract,and/orcontractprice
𝐼𝑛𝑖𝑡𝑖𝑎𝑙𝐶𝑎𝑝𝑖𝑡𝑎𝑙 = $1,000
𝑇𝑟𝑎𝑑𝑒𝑆𝑖𝑧𝑒 = 𝐼𝑛𝑖𝑡𝑖𝑎𝑙𝐶𝑎𝑝𝑖𝑡𝑎𝑙𝐼𝑛𝑖𝑡𝑖𝑎𝑙𝐶𝑎𝑝𝑖𝑡𝑎𝑙
𝐴𝑇𝑅 10 ∗ 𝑀𝑖𝑛𝑇𝑖𝑐𝑘𝑆𝑖𝑧𝑒($)𝑇𝑟𝑢𝑒𝑅𝑎𝑛𝑔𝑒 = max ℎ𝑖𝑔ℎ − 𝑙𝑜𝑤 , 𝑎𝑏𝑠 ℎ𝑖𝑔ℎ − 𝑐𝑙𝑜𝑠𝑒Nuvy , 𝑎𝑏𝑠 𝑙𝑜𝑤 − 𝑐𝑙𝑜𝑠𝑒Nuvy
𝐴𝑇𝑅@ =𝐴𝑇𝑅@JK 𝑛 − 1 + 𝑇𝑟𝑢𝑒𝑅𝑎𝑛𝑔𝑒@
𝑛
AVI.THAKER@GMAIL.COM 40
Appendix:PPCProfitPerContract
𝑟�𝑐 ∗ 𝑡|
𝑟� = 𝑎𝑣𝑒𝑟𝑎𝑔𝑒𝑟𝑒𝑡𝑢𝑟𝑛𝑐 = 𝑛𝑢𝑚𝑏𝑒𝑟𝑜𝑓𝑐𝑜𝑛𝑡𝑟𝑎𝑐𝑡𝑠𝑡𝑟𝑎𝑑𝑒𝑑
𝑡| = 𝑡𝑖𝑐𝑘𝑠𝑖𝑧𝑒
Ameasureofprofitability,measuredinticks
Ahighlyliquidstockusuallyhasaticksizeofapenny
Ifyourstrategyhasmorethan2ticks,itisconsideredprofitable(canescapethebid/askbounce),iftestingonbardatawithoutlimitorderexecutiononbarcloses◦ Youcansubmitmarketordersandstillmakemoney
◦ Assumesliquidity!!!!!
AVI.THAKER@GMAIL.COM 41
Appendix:CAPMCapitalAssetPricingModel
𝑟� = 𝑟} + 𝐵� 𝑟� − 𝑟}𝑟} = 𝑅𝑖𝑠𝑘𝐹𝑟𝑒𝑒𝑅𝑎𝑡𝑒𝐵� = 𝐵𝑒𝑡𝑎𝑜𝑓𝑆𝑒𝑐𝑢𝑟𝑖𝑡𝑦
𝑟� = 𝐸𝑥𝑝𝑒𝑐𝑡𝑒𝑑𝑀𝑎𝑟𝑘𝑒𝑡𝑅𝑒𝑡𝑢𝑟𝑛𝑟� = 𝐴𝑠𝑠𝑒𝑡𝑅𝑒𝑡𝑢𝑟𝑛
Describestherelationshipbetweenriskandtheexpectedreturn
Investorsneedtobecompensatedfortime(riskfreerate)andrisk(beta)
AVI.THAKER@GMAIL.COM 42
Appendix:DrawdownThemeasureofthelargestdropfrompeaktobottom(inpercentage)◦ Itisapainindexmeasure
Extremelyimportanttomeasurethedurationofthedrawdown◦ Doyouwanttobelosingmoneyforyears?
𝐷 𝑇 = max@∈(�,�)
{𝑋(𝑡) − 𝑋 𝑇 }
MDD 𝑇 = max@∈(�,�)
[ max@∈(�,Y)
{𝑋 𝑡 − 𝑋(𝜏)}]
Where𝑋 = 𝑋 𝑡 , 𝑡 ≥ 0 isarandomprocess
Simplyputmaximumdrawdownis:◦ (Peakvaluebeforelargestdrop– lowestvaluebeforenewhigh)/Peakvaluebeforedrop
AVI.THAKER@GMAIL.COM 43
Appendix:UnderwaterCurve
Goodwaytovisualizehowmuchofthetimeyouareinadrawdown
Letsyouevaluatehowmuchpainyoushouldbeabletohandle
http://ctaperformance.com/wntn
AVI.THAKER@GMAIL.COM 44
Appendix:DistributionofReturns
Generallyahistogramofreturns
Lookatcenter,shape,distribution,spread◦ Wantpositivecenter,andnomajoroutliers
http://ctaperformance.com/wntn
AVI.THAKER@GMAIL.COM 45
Appendix:StrategyCorrelation
Generallyyouwanttomakesurethatyourstrategiesarenotcorrelatedtoeachother(lookatdailyreturns)◦ Youdonotwanteverythingtohaveabaddayatthesametime◦ Balancedreturnsaregood
UncorrelatedstrategiestendtoyieldhigherSharperatioswhenmixed
Correlatedstrategiestendtoreflectthesamealpha◦ Thesestrategiestendtocompetewitheachother
Negativelycorrelatedstrategiescanbegood◦ Highlynegativelycorrelatedstrategiescanindicateproblemswithyouralpha
ThankyouAaronRosenforyourfeedback
AVI.THAKER@GMAIL.COM 46
Appendix:TradableAUMNotallstrategiesarecreatedequal
StrategyAmightbeabletotrade$1,000,000withoutincurringlargeslippagebuttrading$100,000,000itmightincurmuchmoreslippageandkillthestrategy◦ Marketmaking– yourabilitytocapturetheinsidebidofferdecreaseswithsize◦ Highfrequencystrategies◦ Somemomentumstrategies
SharperatiosandAUMtradableareusuallyinverselycorrelated◦ Therearesomeexceptions
Notethatthesenumbersareartificial
ThankyouAaronRosenforyourfeedback
AVI.THAKER@GMAIL.COM 47
top related