Welcome to my techblogs! 💻📈₿

TU dortmund Msc. Data Science

Plotly

Uncertainty metrics:

May 1, 2025 Â· 1 min

Regime Changing detection

Regime Changing detection is useful in many cases, including finance, economics, climate science, and engineering. Financial Market Analysis: Helps identify shifts in market trends (e.g., bull vs. bear markets). Improves trading strategies by adjusting risk management based on detected changes. Can be used to detect changes in volatility, correlation, or liquidity. Algorithmic Trading & Quantitative Finance: Useful for adapting trading algorithms when market conditions change. Helps optimize stop-loss and take-profit levels by recognizing trend shifts. ...

February 25, 2025 Â· 2 min

Journey to a universal hedge system (part 2)

Journey to a universal hedge system (part 2) In the previous post we have talked about the implementation of models in pairs trading and their experiment, now let’s try these strategies out using a backtesting framework. Model budget analysis Notice that the BSTS model has o(n) computation complexity. Other models have negligible complexity level. Backtesting framework The backtesting frame uses simple object-oriented programming structure. Strategy flow chart The strategy can multiple exit position options to prevent high drop down. ...

February 9, 2025 Â· 3 min

Journey to a universal hedge system (part I)

Journey to a universal hedge system Intro Statistical arbitrage or hedging has already been known for a long time, people usually tackle this trading strategy with models that have strong assumptions, and generally have only limited amount of asset pairs to trade based on the some macro or micro economics assumption. In this essay, we want to explore more modern and diverse statistical method or machine learning methods for hedging. We will address two questions: ...

February 8, 2025 Â· 9 min

Trading strategies based on Bayesian theory (Part 3)

In the last essay we talked about using the Gamma-Poisson conjugate distribution to develop trading strategies. In the following article, we will try to use the more complex Dirichlet-Multinominal conjugate distribution. What is Dirichlet Distribution The Dirichlet distribution is a family of continuous multivariate probability distributions parameterized by a positive real vector. It is often used as a prior distribution for multinomial distributions in Bayesian statistics. The formula for the probability density function of the Dirichlet distribution is as follows: ...

November 13, 2024 Â· 8 min

Trading strategies based on Bayesian theory (Part 2)

In the previous post we learned how to design trading strategies using the beta-binomial conjugate distribution. Can we design trading strategies using the gamma-Poisson conjugate distribution? This post will show an example of a trading strategy. Model Objective: simulate the average number of increases over a period of time Prior distribution: gamma distribution, the following is the distribution function of gamma distribution: $$ f(x; \alpha, \beta) = \frac{\beta^{\alpha} x^{\alpha - 1} e^{-\beta x}}{\Gamma(\alpha)} $$ Below are the images of the gamma distribution function with different parameters:: It can be seen that the domain of the gamma distribution is [0, +$\infty$], which means that we can no longer choose to study the parameter $\theta$, which is a 0 to 1 probability of increase. We can study the average number of increases $\lambda$ over a period of time. This is why we need to choose the Poisson distribution to calculate the likelihood. ...

November 12, 2024 Â· 9 min

Trading strategies based on Bayesian theory (Part 1)

Model Logic Assuming that the long cycle can reflect the trend, and after observing the short-term data, we can better judge the long-term trend. Goal: Predict whether there will be a trend in the future Parameter:$\theta$ :The probability of rising is a float between 0 and 1. Model:Based on long-term data,Determine the prior distribution of $\theta$, and then update our belief in $\theta$ based on short-term data to obtain the posterior distribution. prior:Because $\theta$ is a continuous distribution from 0 to 1, we choose Beta distribution. likelihood:Because we want to predict the rise and fall, we can simplify the data to tossing a coin, which is a binomial distribution. beta - binomial conjugate, if beta distribution is used as the prior distribution and binomial distribution is used as the Siran function, then the posterior distribution is also beta distribution, which can simplify the calculation. Applying Bayesian theory $f(\theta)$ is the prior distribution prior $f(\theta|X)$ is the posterior distribution posterior $f(X|\theta)$ is the likelihood function ...

November 11, 2024 Â· 5 min

Grid trading application

Parameter Definition Strategy logic parameters upperPrice lowerPrice currentPrice gridStep gridAmount initPrice initAmount totalGrids tarPos baseCurrency quoteCurrency Strategy performance calculation startPrice initBase initQuote finalBase finalQuote initDate unilateral posAvg totalDays What’s grid trading Strategy usage background: after a big bullish market, the market starts to go bearish, that’s the right moment for using grid trading strategy. Just like the graph above, the green lines stand for buy limit orders, red lines stand for sell limit orders. The grid trading is just placing orders based on the current price, places sell orders at prices that are higher than current price, places buy orders at prices that are lower than current price. Assume that the price drop to 5, the limit buy order at 5 would be executed, we replenish another sell order at 5.1, the orders list would like the above graphs. The reverse situation would be the same, so during a market where the volatility is high, this strategy can generate profit. ...

June 21, 2021 Â· 13 min

Event driven trading system

Event driven trading system This article is inspired by VNPY, which is available under the MIT License. And the official ByBit python SDK PyBit. Algorithmic trading has inspired many people to implement their strategies. It frees the hands of the traders and materialize doesn’t suffer from the human emotion. Here I will introduce an event-driven trading system: Websocket and Rest API As the graph above shows, we have two data sources which are websocket and rest api, we usually use websocket API for market data stream since it’s a long connection, and we use Rest API for sending order and it’s a quick one time connection, but the function from these two types of API are interchangable. ...

June 9, 2021 Â· 6 min

About me

Education Background TU dortmund 10/2022 - till now Major M.Sc. Data Science Beijng Institute of Technology, Zhuhai 2016 - 2020 Major B.Sc. Applied Statistics Work Experience Beijing FengYunTianDi (2021) Job title: Data Analyst Python Geometry data analysis using Geopandas Radar data preprocessing, automatic alarm system for power grid Alarming strategy developing Guangdong Molecular Assets Management Co., Ltd. (2021-2022) Job title: Quantitative Trading Engineer Developing testing and maintaining hedging and grid trading strategy Market data scrapping and analysis Backtesting framework development Research assisstant in TU dortmund (2024-2025) Hyper parameter tuning method research Experiment data analysis Testfunction modification TOPSEC (Internship) (2019) Intern in the After-sales department Push products: issued data leak prevention software to users by company’s server Prize Mathematical Contest in Modeling (Honorable Mention Winner 2019) ...

February 8, 2020 Â· 1 min