Skip to content

Latest commit

 

History

History
57 lines (39 loc) · 2.21 KB

Readme.md

File metadata and controls

57 lines (39 loc) · 2.21 KB

Stock Trading Analysis with Apache Flink on Ververica

Note: The easiest way to get started and deploy the application is by signing up for a free trial of Ververica Cloud.

You can also find more details on this video here.

Project Overview

You can find the application here. This project provides multiple Apache Flink streaming jobs to handle various stock market scenarios:

  1. MarketEventImpactAnalysis
    Evaluates how specific market events impact stock prices in real time.

  2. PriceSpikeDetection
    Detects significant stock price increases within a defined time window using Flink's CEP.

  3. RapidTradeDetection
    Identifies potential rapid or manipulative trading activities by detecting multiple trades from the same trader in quick succession, while also enriching trade data.

  4. SmartTradeExecution
    Dynamically decides whether to execute, delay, or cancel trade orders based on real-time price volatility thresholds.

Sample Data Generation

  • models package
    Defines the data model for stock trading, including Market Events, Stocks, Trade Orders and Trader details.

  • StockMarketDataGenerator.java
    Uses javafaker to create realistic synthetic transaction data with random amounts, currency codes, merchants, and geolocation.

  • FxProducer.java Generates transactions and sends them to a Kafka topic. Make sure to fill in the required properties for bootstrap.servers and sasl.jaas.config into the AppConfig.java file.

Build and Package

Use Maven to build and package the application:

mvn clean package

Deploy and Run

Run any of the jobs by specifying its main class. For example:

java -cp target/your-jar-file.jar com.ververica.apps.SmartTradeExecution

Replace SmartTradeExecution with the desired job name.

Requirements

  • Java 11
  • Maven
  • Apache Flink 1.17