Python for finance: mastering data-driven finance
Gespeichert in:
1. Verfasser: | |
---|---|
Format: | Buch |
Sprache: | English |
Veröffentlicht: |
Beijing ; Boston ; Farnham ; Sebastopol ; Tokyo
O'Reilly
[2019]
|
Ausgabe: | Second edition |
Schlagworte: | |
Online-Zugang: | Inhaltsverzeichnis |
Beschreibung: | XVIII, 691 Seiten Illustrationen, Diagramme |
ISBN: | 1492024333 9781492024330 |
Internformat
MARC
LEADER | 00000nam a2200000 c 4500 | ||
---|---|---|---|
001 | BV045245522 | ||
003 | DE-604 | ||
005 | 20200319 | ||
007 | t | ||
008 | 181023s2019 a||| |||| 00||| eng d | ||
020 | |a 1492024333 |9 1-492-02433-3 | ||
020 | |a 9781492024330 |9 978-1-492-02433-0 | ||
035 | |a (OCoLC)1086279244 | ||
035 | |a (DE-599)BVBBV045245522 | ||
040 | |a DE-604 |b ger |e rda | ||
041 | 0 | |a eng | |
049 | |a DE-M347 |a DE-355 |a DE-91G |a DE-573 |a DE-N2 | ||
084 | |a ST 250 |0 (DE-625)143626: |2 rvk | ||
084 | |a ST 510 |0 (DE-625)143676: |2 rvk | ||
084 | |a ST 610 |0 (DE-625)143683: |2 rvk | ||
084 | |a DAT 366f |2 stub | ||
084 | |a WIR 650f |2 stub | ||
100 | 1 | |a Hilpisch, Yves |e Verfasser |0 (DE-588)122757831 |4 aut | |
245 | 1 | 0 | |a Python for finance |b mastering data-driven finance |c Yves Hilpisch |
250 | |a Second edition | ||
264 | 1 | |a Beijing ; Boston ; Farnham ; Sebastopol ; Tokyo |b O'Reilly |c [2019] | |
264 | 4 | |c © 2019 | |
300 | |a XVIII, 691 Seiten |b Illustrationen, Diagramme | ||
336 | |b txt |2 rdacontent | ||
337 | |b n |2 rdamedia | ||
338 | |b nc |2 rdacarrier | ||
650 | 0 | 7 | |a Finanzanalyse |0 (DE-588)4133000-6 |2 gnd |9 rswk-swf |
650 | 0 | 7 | |a Python |g Programmiersprache |0 (DE-588)4434275-5 |2 gnd |9 rswk-swf |
650 | 0 | 7 | |a Wirtschaftsinformatik |0 (DE-588)4112736-5 |2 gnd |9 rswk-swf |
689 | 0 | 0 | |a Python |g Programmiersprache |0 (DE-588)4434275-5 |D s |
689 | 0 | 1 | |a Wirtschaftsinformatik |0 (DE-588)4112736-5 |D s |
689 | 0 | |5 DE-604 | |
689 | 1 | 0 | |a Python |g Programmiersprache |0 (DE-588)4434275-5 |D s |
689 | 1 | 1 | |a Finanzanalyse |0 (DE-588)4133000-6 |D s |
689 | 1 | |5 DE-604 | |
856 | 4 | 2 | |m Digitalisierung UB Regensburg - ADAM Catalogue Enrichment |q application/pdf |u http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=030633634&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |3 Inhaltsverzeichnis |
999 | |a oai:aleph.bib-bvb.de:BVB01-030633634 |
Datensatz im Suchindex
_version_ | 1804178985079275520 |
---|---|
adam_text | Table of Contents
Preface........................................................................... xiii
Part I. Python and Finance
1. Why Python for Finance................................................ 3
The Python Programming Language 3
A Brief History of Python 5
The Python Ecosystem 6
The Python User Spectrum 7
The Scientific Stack 8
Technology in Finance 9
Technology Spending 9
Technology as Enabler 10
Technology and Talent as Barriers to Entry 11
Ever-Increasing Speeds, Frequencies, and Data Volumes 11
The Rise of Real-Time Analytics 13
Python for Finance 14
Finance and Python Syntax 14
Efficiency and Productivity Through Python 18
From Prototyping to Production 23
Data-Driven and AI-First Finance 24
Data-Driven Finance 24
AI-First Finance 28
Conclusion 31
Further Resources 31
2. Python Infrastructure.......................................................33
conda as a Package Manager 35
Installing Miniconda 35
Basic Operations with conda 37
conda as a Virtual Environment Manager 41
Using Docker Containers 45
Docker Images and Containers 45
Building an Ubuntu and Python Docker Image 46
Using Cloud Instances 50
RSA Public and Private Keys 51
Jupyter Notebook Configuration File 52
Installation Script for Python and Jupyter Notebook 53
Script to Orchestrate the Droplet Setup 55
Conclusion 56
Further Resources 57
Part II. Mastering the Basics
Data Types and Structures.................................... .............. 61
Basic Data Types 62
Integers 62
Floats 63
Booleans 66
Strings 69
Excursion: Printing and String Replacements 71
Excursion: Regular Expressions 74
Basic Data Structures 75
Tuples 75
Lists 76
Excursion: Control Structures 78
Excursion: Functional Programming 80
Diets 81
Sets 82
Conclusion 84
Further Resources 84
Numerical Computing with NumPy............................ .............. 85
Arrays of Data 86
Arrays with Python Lists 86
The Python array Class 88
Regular NumPy Arrays 90
iv | Table of Contents
5.
The Basics 90
Multiple Dimensions 94
Metainformation 97
Reshaping and Resizing 98
Boolean Arrays 101
Speed Comparison 103
Structured NumPy Arrays 105
Vectorization of Code 106
Basic Vectorization 107
Memory Layout 110
Conclusion 112
Further Resources 112
Data Analysis with pandas................................. ................113
The DataFrame Class 114
First Steps with the DataFrame Class 114
Second Steps with the DataFrame Class 119
Basic Analytics 123
Basic Visualization 126
The Series Class 128
Group By Operations 130
Complex Selection 132
Concatenation, Joining, and Merging 135
Concatenation 136
Joining 137
Merging 139
Performance Aspects 141
Conclusion 143
Further Reading 143
Object-Oriented Programming............................. ................ 145
A Look at Python Objects 149
int 149
list 150
ndarray 151
DataFrame 152
Basics of Python Classes 154
Python Data Model 159
The Vector Class 163
Conclusion 164
Further Resources 164
Table of Contents | v
Part III. Financial Data Science
7. Data Visualization....................................... .................167
Static 2D Plotting 168
One-Dimensional Data Sets 169
Two-Dimensional Data Sets 176
Other Plot Styles 183
Static 3D Plotting 191
Interactive 2D Plotting 195
Basic Plots 195
Financial Plots 199
Conclusion 203
Further Resources 204
8. Financial Time Series.................................... ................. 205
Financial Data 206
Data Import 206
Summary Statistics 210
Changes over Time 212
Resampling 215
Rolling Statistics 217
An Overview 218
A Technical Analysis Example 220
Correlation Analysis 222
The Data 222
Logarithmic Returns 224
OLS Regression 226
Correlation 227
High-Frequency Data 228
Conclusion 230
Further Resources 230
9. Input/Output Operations................................ .................. 231
Basic I/O with Python 232
Writing Objects to Disk 232
Reading and Writing Text Files 236
Working with SQL Databases 239
Writing and Reading NumPy Arrays 242
I/O with pandas 245
Working with SQL Databases 246
From SQL to pandas 247
Working with CSV Files 250
vi | Table of Contents
Working with Excel Files 252
I/O with PyTables 253
Working with Tables 254
Working with Compressed Tables 261
Working with Arrays 263
Out-of-Memory Computations 265
I/O with TsTables 268
Sample Data 268
Data Storage 270
Data Retrieval 271
Conclusion 273
Further Resources 274
Performance Python................................... ...................275
Loops 276
Python 277
NumPy 278
Numba 279
Cython 280
Algorithms 282
Prime Numbers 282
Fibonacci Numbers 286
The Number Pi 290
Binomial Trees 294
Python 294
NumPy 296
Numba 297
Cython 298
Monte Carlo Simulation 299
Python 300
NumPy 302
Numba 303
Cython 303
Multiprocessing 304
Recursive pandas Algorithm 305
Python 306
Numba 308
Cython 308
Conclusion 309
Further Resources 310
Table of Contents | vii
Mathematical Tnols................................. ................... 311
Approximation 312
Regression 313
Interpolation 324
Convex Optimization 328
Global Optimization 329
Local Optimization 331
Constrained Optimization 332
Integration 334
Numerical Integration 336
Integration by Simulation 337
Symbolic Computation 337
Basics 338
Equations 340
Integration and Differentiation 340
Differentiation 341
Conclusion 343
Further Resources 343
Stochastics.......................................... .................... 345
Random Numbers 346
Simulation 352
Random Variables 353
Stochastic Processes 356
Variance Reduction 372
Valuation 375
European Options 376
American Options 380
Risk Measures 383
Value-at-Risk 383
Credit Valuation Adjustments 388
Python Script 392
Conclusion 394
Further Resources 395
Statistics........................................... .....................397
Normality Tests 398
Benchmark Case 399
Real-World Data 409
Portfolio Optimization 415
The Data 416
The Basic Theory 417
viii l Table of Contents
Optimal Portfolios 421
Efficient Frontier 424
Capital Market Line 425
Bayesian Statistics 429
Bayes Formula 429
Bayesian Regression 430
Two Financial Instruments 435
Updating Estimates over Time 439
Machine Learning 444
Unsupervised Learning 444
Supervised Learning 448
Conclusion 462
Further Resources 463
Part IV. Algorithmic Trading
14. The FXCM Trading Platform............................ .................... 467
Getting Started 469
Retrieving Data 469
Retrieving Tick Data 470
Retrieving Candles Data 472
Working with the API 474
Retrieving Historical Data 475
Retrieving Streaming Data 477
Placing Orders 478
Account Information 480
Conclusion 480
Further Resources 481
15. Trading Strategies................................... .....................483
Simple Moving Averages 484
Data Import 485
Trading Strategy 485
Vectorized Backtesting 487
Optimization 489
Random Walk Hypothesis 491
Linear OLS Regression 494
The Data 495
Regression 497
Clustering 499
Frequency Approach 501
Table of Contents | ix
Classification 504
Two Binary Features 504
Five Binary Features 506
Five Digitized Features 508
Sequential Train-Test Split 509
Randomized Train-Test Split 511
Deep Neural Networks 512
DNNs with scikit-learn 512
DNNs with TensorFlow 515
Conclusion 519
Further Resources 519
16. Automated Trading........................................ ...............521
Capital Management 522
The Kelly Criterion in a Binomial Setting 522
The Kelly Criterion for Stocks and Indices 527
ML-Based Trading Strategy 532
Vectorized Backtesting 533
Optimal Leverage 537
Risk Analysis 539
Persisting the Model Object 543
Online Algorithm 544
Infrastructure and Deployment 546
Logging and Monitoring 547
Conclusion 550
Python Scripts 550
Automated Trading Strategy 550
Strategy Monitoring 553
Further Resources 554
Part V. Derivatives Analytics
17. Valuation Framework..................................................557
Fundamental Theorem of Asset Pricing 558
A Simple Example 558
The General Results 559
Risk-Neutral Discounting 560
Modeling and Handling Dates 561
Constant Short Rate 563
Market Environments 565
Conclusion 568
x | Table of Contents
Further Resources
569
18. Simulation of Financial Models........................................571
Random Number Generation 572
Generic Simulation Class 574
Geometric Brownian Motion 577
The Simulation Class 578
A Use Case 580
Jump Diffusion 582
The Simulation Class 583
A Use Case 585
Square-Root Diffusion 587
The Simulation Class 588
A Use Case 590
Conclusion 591
Further Resources 592
19. Derivatives Valuation.................................................. 595
Generic Valuation Class 596
European Exercise 600
The Valuation Class 600
A Use Case 602
American Exercise 607
Least-Squares Monte Carlo 608
The Valuation Class 609
A Use Case 611
Conclusion 614
Further Resources 616
20. Portfolio Valuation.................................................... 617
Derivatives Positions 618
The Class 619
A Use Case 620
Derivatives Portfolios 622
The Class 622
A Use Case 626
Conclusion 634
Further Resources 635
21. Market-Based Valuation................................................. 637
Options Data 638
Model Calibration 641
Table of Contents | xi
Relevant Market Data 641
Option Modeling 643
Calibration Procedure 646
Portfolio Valuation 651
Modeling Option Positions 652
The Options Portfolio 653
Python Code 654
Conclusion 656
Further Resources 657
A. Dates and Times............................................................ 659
B. BSM Option Class........................................................... 673
Index........................................................................ 679
xii | Table of Contents
|
any_adam_object | 1 |
author | Hilpisch, Yves |
author_GND | (DE-588)122757831 |
author_facet | Hilpisch, Yves |
author_role | aut |
author_sort | Hilpisch, Yves |
author_variant | y h yh |
building | Verbundindex |
bvnumber | BV045245522 |
classification_rvk | ST 250 ST 510 ST 610 |
classification_tum | DAT 366f WIR 650f |
ctrlnum | (OCoLC)1086279244 (DE-599)BVBBV045245522 |
discipline | Informatik Wirtschaftswissenschaften |
edition | Second edition |
format | Book |
fullrecord | <?xml version="1.0" encoding="UTF-8"?><collection xmlns="http://www.loc.gov/MARC21/slim"><record><leader>01909nam a2200469 c 4500</leader><controlfield tag="001">BV045245522</controlfield><controlfield tag="003">DE-604</controlfield><controlfield tag="005">20200319 </controlfield><controlfield tag="007">t</controlfield><controlfield tag="008">181023s2019 a||| |||| 00||| eng d</controlfield><datafield tag="020" ind1=" " ind2=" "><subfield code="a">1492024333</subfield><subfield code="9">1-492-02433-3</subfield></datafield><datafield tag="020" ind1=" " ind2=" "><subfield code="a">9781492024330</subfield><subfield code="9">978-1-492-02433-0</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(OCoLC)1086279244</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(DE-599)BVBBV045245522</subfield></datafield><datafield tag="040" ind1=" " ind2=" "><subfield code="a">DE-604</subfield><subfield code="b">ger</subfield><subfield code="e">rda</subfield></datafield><datafield tag="041" ind1="0" ind2=" "><subfield code="a">eng</subfield></datafield><datafield tag="049" ind1=" " ind2=" "><subfield code="a">DE-M347</subfield><subfield code="a">DE-355</subfield><subfield code="a">DE-91G</subfield><subfield code="a">DE-573</subfield><subfield code="a">DE-N2</subfield></datafield><datafield tag="084" ind1=" " ind2=" "><subfield code="a">ST 250</subfield><subfield code="0">(DE-625)143626:</subfield><subfield code="2">rvk</subfield></datafield><datafield tag="084" ind1=" " ind2=" "><subfield code="a">ST 510</subfield><subfield code="0">(DE-625)143676:</subfield><subfield code="2">rvk</subfield></datafield><datafield tag="084" ind1=" " ind2=" "><subfield code="a">ST 610</subfield><subfield code="0">(DE-625)143683:</subfield><subfield code="2">rvk</subfield></datafield><datafield tag="084" ind1=" " ind2=" "><subfield code="a">DAT 366f</subfield><subfield code="2">stub</subfield></datafield><datafield tag="084" ind1=" " ind2=" "><subfield code="a">WIR 650f</subfield><subfield code="2">stub</subfield></datafield><datafield tag="100" ind1="1" ind2=" "><subfield code="a">Hilpisch, Yves</subfield><subfield code="e">Verfasser</subfield><subfield code="0">(DE-588)122757831</subfield><subfield code="4">aut</subfield></datafield><datafield tag="245" ind1="1" ind2="0"><subfield code="a">Python for finance</subfield><subfield code="b">mastering data-driven finance</subfield><subfield code="c">Yves Hilpisch</subfield></datafield><datafield tag="250" ind1=" " ind2=" "><subfield code="a">Second edition</subfield></datafield><datafield tag="264" ind1=" " ind2="1"><subfield code="a">Beijing ; Boston ; Farnham ; Sebastopol ; Tokyo</subfield><subfield code="b">O'Reilly</subfield><subfield code="c">[2019]</subfield></datafield><datafield tag="264" ind1=" " ind2="4"><subfield code="c">© 2019</subfield></datafield><datafield tag="300" ind1=" " ind2=" "><subfield code="a">XVIII, 691 Seiten</subfield><subfield code="b">Illustrationen, Diagramme</subfield></datafield><datafield tag="336" ind1=" " ind2=" "><subfield code="b">txt</subfield><subfield code="2">rdacontent</subfield></datafield><datafield tag="337" ind1=" " ind2=" "><subfield code="b">n</subfield><subfield code="2">rdamedia</subfield></datafield><datafield tag="338" ind1=" " ind2=" "><subfield code="b">nc</subfield><subfield code="2">rdacarrier</subfield></datafield><datafield tag="650" ind1="0" ind2="7"><subfield code="a">Finanzanalyse</subfield><subfield code="0">(DE-588)4133000-6</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="650" ind1="0" ind2="7"><subfield code="a">Python</subfield><subfield code="g">Programmiersprache</subfield><subfield code="0">(DE-588)4434275-5</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="650" ind1="0" ind2="7"><subfield code="a">Wirtschaftsinformatik</subfield><subfield code="0">(DE-588)4112736-5</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="689" ind1="0" ind2="0"><subfield code="a">Python</subfield><subfield code="g">Programmiersprache</subfield><subfield code="0">(DE-588)4434275-5</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="0" ind2="1"><subfield code="a">Wirtschaftsinformatik</subfield><subfield code="0">(DE-588)4112736-5</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="0" ind2=" "><subfield code="5">DE-604</subfield></datafield><datafield tag="689" ind1="1" ind2="0"><subfield code="a">Python</subfield><subfield code="g">Programmiersprache</subfield><subfield code="0">(DE-588)4434275-5</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="1" ind2="1"><subfield code="a">Finanzanalyse</subfield><subfield code="0">(DE-588)4133000-6</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="1" ind2=" "><subfield code="5">DE-604</subfield></datafield><datafield tag="856" ind1="4" ind2="2"><subfield code="m">Digitalisierung UB Regensburg - ADAM Catalogue Enrichment</subfield><subfield code="q">application/pdf</subfield><subfield code="u">http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=030633634&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA</subfield><subfield code="3">Inhaltsverzeichnis</subfield></datafield><datafield tag="999" ind1=" " ind2=" "><subfield code="a">oai:aleph.bib-bvb.de:BVB01-030633634</subfield></datafield></record></collection> |
id | DE-604.BV045245522 |
illustrated | Illustrated |
indexdate | 2024-07-10T08:12:40Z |
institution | BVB |
isbn | 1492024333 9781492024330 |
language | English |
oai_aleph_id | oai:aleph.bib-bvb.de:BVB01-030633634 |
oclc_num | 1086279244 |
open_access_boolean | |
owner | DE-M347 DE-355 DE-BY-UBR DE-91G DE-BY-TUM DE-573 DE-N2 |
owner_facet | DE-M347 DE-355 DE-BY-UBR DE-91G DE-BY-TUM DE-573 DE-N2 |
physical | XVIII, 691 Seiten Illustrationen, Diagramme |
publishDate | 2019 |
publishDateSearch | 2019 |
publishDateSort | 2019 |
publisher | O'Reilly |
record_format | marc |
spelling | Hilpisch, Yves Verfasser (DE-588)122757831 aut Python for finance mastering data-driven finance Yves Hilpisch Second edition Beijing ; Boston ; Farnham ; Sebastopol ; Tokyo O'Reilly [2019] © 2019 XVIII, 691 Seiten Illustrationen, Diagramme txt rdacontent n rdamedia nc rdacarrier Finanzanalyse (DE-588)4133000-6 gnd rswk-swf Python Programmiersprache (DE-588)4434275-5 gnd rswk-swf Wirtschaftsinformatik (DE-588)4112736-5 gnd rswk-swf Python Programmiersprache (DE-588)4434275-5 s Wirtschaftsinformatik (DE-588)4112736-5 s DE-604 Finanzanalyse (DE-588)4133000-6 s Digitalisierung UB Regensburg - ADAM Catalogue Enrichment application/pdf http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=030633634&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA Inhaltsverzeichnis |
spellingShingle | Hilpisch, Yves Python for finance mastering data-driven finance Finanzanalyse (DE-588)4133000-6 gnd Python Programmiersprache (DE-588)4434275-5 gnd Wirtschaftsinformatik (DE-588)4112736-5 gnd |
subject_GND | (DE-588)4133000-6 (DE-588)4434275-5 (DE-588)4112736-5 |
title | Python for finance mastering data-driven finance |
title_auth | Python for finance mastering data-driven finance |
title_exact_search | Python for finance mastering data-driven finance |
title_full | Python for finance mastering data-driven finance Yves Hilpisch |
title_fullStr | Python for finance mastering data-driven finance Yves Hilpisch |
title_full_unstemmed | Python for finance mastering data-driven finance Yves Hilpisch |
title_short | Python for finance |
title_sort | python for finance mastering data driven finance |
title_sub | mastering data-driven finance |
topic | Finanzanalyse (DE-588)4133000-6 gnd Python Programmiersprache (DE-588)4434275-5 gnd Wirtschaftsinformatik (DE-588)4112736-5 gnd |
topic_facet | Finanzanalyse Python Programmiersprache Wirtschaftsinformatik |
url | http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=030633634&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |
work_keys_str_mv | AT hilpischyves pythonforfinancemasteringdatadrivenfinance |