Varshney | Building Trading Bots Using Java | E-Book | www.sack.de
E-Book

E-Book, Englisch, 283 Seiten

Varshney Building Trading Bots Using Java


1. ed
ISBN: 978-1-4842-2520-2
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark

E-Book, Englisch, 283 Seiten

ISBN: 978-1-4842-2520-2
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark



Build an automated currency trading bot from scratch with java. In this book, you will learn about the nitty-gritty of automated trading and have a closer look at Java, the Spring Framework, event-driven programming, and other open source APIs, notably Google's Guava API. And of course, development will all be test-driven with unit testing coverage. The central theme of Building Trading Bots Using Java is to create a framework that can facilitate automated trading on most of the brokerage platforms, with minimum changes. At the end of the journey, you will have a working trading bot, with a sample implementation using the OANDA REST API, which is free to use.

What You'll Learn
Find out about trading botsDiscover the details of tradeable instruments and apply bots to themTrack and use market data eventsPlace orders and tradesWork with trade/order and account events
Who This Book Is For

Experienced programmers new to bots and other algorithmic trading and finance techniques.


Shekhar Varshney is a freelance software developer based in Switzerland with over 19 years of development experience. He started his journey with IBM mainframes, correcting COBOL programs infected with the Y2K bug. At present, his main software development focus is building enterprise services based on SOA principles. He has a keen interest in software design and architecture. In his free time, he loves experimenting with new APIs and frameworks mostly in the Java ecosystem.

Varshney Building Trading Bots Using Java jetzt bestellen!

Autoren/Hrsg.


Weitere Infos & Material


1;Contents at a Glance;5
2;Contents;6
3;About the Author;11
4;Chapter 1: Introduction to Trading Bot;12
4.1;What Is a Trading Bot?;13
4.2;Why Do We Need a Trading Bot?;14
4.3;The Capabilities of the Trading Bot;14
4.4;Design Goals;15
4.5;Code Organization and Software Stack Used;17
4.6;OANDA REST API as Reference Implementation;19
4.6.1;Opening an OANDA Practice Account;19
4.6.2;OANDA JSON Keys;24
4.6.3;Constructor Dependencies for OANDA Implementations;26
4.7;Event-Driven Architecture;27
4.7.1;Google EventBus;29
4.8;Provider Helper Interface;31
4.9;TradingConfig Class;33
4.10;Obtaining the Source Code;35
4.11;Try It Yourself Section;35
5;Chapter 2: Account Management;37
5.1;Account Provider Interface;41
5.2;A Concrete Implementation for AccountDataProvider;42
5.3;Encapsulating Everything Behind a Generic AccountInfoService;47
5.4;Try It Yourself;53
6;Chapter 3: Tradeable Instruments;56
6.1;Instrument Provider Interface;60
6.2;A Concrete Implementation for InstrumentDataProvider;61
6.3;Encapsulating Everything Behind a Generic InstrumentService;65
6.4;Try It Yourself;67
7;Chapter 4: Event Streaming: Market Data Events;70
7.1;Streaming Market Data Interface;70
7.2;A Concrete Implementation for MarketDataStreamingService;72
7.3;Downstream Market Data Event Dissemination: MarketEventCallback;78
7.4;Try It Yourself;79
8;Chapter 5: Historic Instrument Market Data;83
8.1;How to Read a Candlestick;83
8.2;Enum Defining the Candlestick Granularity;84
8.3;Define POJO to Hold Candlestick Information;85
8.3.1;Historical Data Provider Interface;87
8.4;A Concrete Implementation for HistoricMarketDataProvider;89
8.5;Discussion: An Alternate Database Implementation;93
8.6;Candlesticks for Moving Average Calculations;96
8.7;MovingAverageCalculationService;97
8.8;Try It Yourself;99
9;Chapter 6: Placing Orders and Trades;104
9.1;Order POJO Definition;105
9.2;Order Management Provider Interface;108
9.3;A Concrete Implementation for OrderManagementProvider;110
9.4;A Simple OrderInfoService;122
9.5;Validating Orders Before Execution: PreOrderValidationService;123
9.6;Putting It All Together in an OrderExecutionService;128
9.7;Trade POJO Definition;131
9.8;Trade Management Provider Interface;134
9.9;A Concrete Implementation for TradeManagementProvider;136
9.10;Encapsulating Read Operations Behind TradeInfoService;143
9.11;Try It Yourself;151
10;Chapter 7: Event Streaming: Trade/Order/Account Events;166
10.1;Streaming Event Interface;168
10.2;A Concrete Implementation for EventsStreamingService;169
10.3;Try It Yourself;178
11;Chapter 8: Integration with Twitter;181
11.1;Creating a Twitter Application;181
11.2;Spring Social;186
11.2.1;Using and Configuring Spring Social;186
11.3;Harvesting FX Tweets;187
11.3.1;TweetHarvester Interface;191
11.3.2;FXTweetHandler Interface;191
11.3.3;AbstractFXTweetHandler Base Class;192
11.3.4;User-Specific TweetHandlers;195
11.3.4.1;SignalFactoryFXTweetHandler;196
11.3.4.2;ZuluTrader101FXTweetHandler;199
11.4;Try It Yourself;203
12;Chapter 9: Implementing Strategies;208
12.1;Copy Twitter Strategy;209
12.2;Fade the Move Strategy;215
12.3;Try It Yourself;219
13;Chapter 10: Heartbeating;224
13.1;HeartBeatPayLoad;224
13.2;Streaming the Heartbeat Interface;225
13.3;A Concrete Implementation for HeartBeatStreamingService;226
13.4;HeartBeatCallback Interface;228
13.5;DefaultHeartBeatService;228
13.6;Try It Yourself;231
14;Chapter 11: E-Mail Notifications;235
14.1;Notification Design;235
14.1.1;EmailPayLoad POJO;235
14.1.2;EmailContentGenerator Interface;236
14.1.3;Sample Implementations;236
14.1.4;EventEmailNotifier Service;239
14.2;Try It Yourself;241
15;Chapter 12: Configuration, Deployment, and Running the Bot;246
15.1;Configuring the Trading Bot;246
15.1.1;Core Beans Configuration;247
15.1.2;Twitter-Related Beans Configuration;250
15.1.3;Provider Beans Configuration;251
15.1.3.1;AccountDataProviderService;252
15.1.3.2;ProviderHelper;252
15.1.3.3;InstrumentDataProvider;252
15.1.3.4;CurrentPriceInfoProvider;253
15.1.3.5;HistoricMarketDataProvider;253
15.1.3.6;OrderManagementProvider;253
15.1.3.7;TradeManagementProvider;253
15.1.3.8;PositionManagementProvider;254
15.1.3.9;EventStreamingService;254
15.1.3.10;Platform Event Handlers;254
15.1.3.11;MarketDataStreamingService;255
15.1.4;Strategies Configuration;257
15.1.5;Services Configuration;257
15.1.5.1;AccountInfoService;257
15.1.5.2;InstrumentService;258
15.1.5.3;MovingAverageCalculationService;258
15.1.5.4;OrderInfoService;258
15.1.5.5;TradeInfoService;258
15.1.5.6;PreOrderValidationService;258
15.1.5.7;OrderExecutionService;259
15.1.5.8;DefaultHeartBeatService;259
15.2;Building the Bot;259
15.3;Running the Bot;262
16;Chapter 13: Unit Testing;265
16.1;Using Mockito as a Mocking Framework;265
16.1.1;Mocking HTTP Interaction;266
16.1.2;Mocking Streams;269
16.1.3;The Versatile verify Mockito;273
16.1.4;Mocking Twitter Interaction;275
16.2;EclEmma Code Coverage Tool for Eclipse IDE;276
17;Index;279



Ihre Fragen, Wünsche oder Anmerkungen
Vorname*
Nachname*
Ihre E-Mail-Adresse*
Kundennr.
Ihre Nachricht*
Lediglich mit * gekennzeichnete Felder sind Pflichtfelder.
Wenn Sie die im Kontaktformular eingegebenen Daten durch Klick auf den nachfolgenden Button übersenden, erklären Sie sich damit einverstanden, dass wir Ihr Angaben für die Beantwortung Ihrer Anfrage verwenden. Selbstverständlich werden Ihre Daten vertraulich behandelt und nicht an Dritte weitergegeben. Sie können der Verwendung Ihrer Daten jederzeit widersprechen. Das Datenhandling bei Sack Fachmedien erklären wir Ihnen in unserer Datenschutzerklärung.