Tag: quant

  • Positional encoding for timeseries data

    This is positional encoding for timseries data inspired by A Transformer-based Framework for Multivariate Time Series Representation Learning. Assuming that the input is (batch_size, sequence_length, feature_dim) and each feature is a float, the way we add positional encoding is: This is applied like: See PositionalEncoding of keras_nlp here for generic implementation.

  • A deep learning architecture to apply Dow theory in stock price prediction

    What are the features to predict stock price? Obvious choices include: When predicting the stock price of, say, AAPL, it’s critical to consider other stocks’ price, e.g., MSFT, GOOG, META, NVDA, etc. If all the tickers in the NASDAQ are going down, we can say with confidence that we’re in a bear market. DOW theory…

  • 101 Formulaic Alphas

    https://arxiv.org/abs/1601.00991 시장대비 초과 수익을 낼 수 있는 101 가지 시그널이 기재된 페이퍼입니다. 적어도 최초 퍼블리시하는 당시에 사용되던 시그널들이고 단기에 적용되는 상호 correlation 이 낮은 집합입니다. 이 패턴들이 지금도 통할지 아니면 이제는 쓸모 없어져버렸는지는 모르지만 테스트해보고 어떤 곳에서 시그널을 찾았는지 살펴보는건 흥미로워 보입니다.

  • openbb

    https://openbb.co/ 블룸버그 터미널을 대체를 목표로 하는 소프트웨어. 주가나 매크로등을 받아올 수 있나 봅니다. API 처럼 쓸 수도 있고 정말 터미널 처럼 실행도 됩니다. 터미널이라기 보다는 좀 CLI 에 가깝지만요. 저는 FMP, yfinance, fredapi 조합으로 사용중인데 여러가지 잘 몰랐던 지표도 한눈에 찾아보기 편해 오픈소스만으로도 참 많은 데이터를 얻을 수 있구나 하는 생각이 듭니다.

  • Stock technical indicator lib

    https://github.com/TA-Lib/ta-lib-python It’s a python wrapper of a BSD license c/c++ open-source code.

  • Quant 에 정말 좋은 책 추천

    Machine Learning for Algorithmic Trading 이란 책인데 정말 다양한 토픽을 망라하고 있습니다. MCMC 까지 사용한다는 건 생각도 못했습니다. 저자는 Applied AI 의 리드이자 파운더입니다.

  • Cointegration

    만약 두개의 타임 시리즈의 선형결합이 stationary 라면 그 둘을 cointegrated 되었다고 말합니다. 예를들면 주가가 서로 같이 변하는 경향이 있다던가 하는걸 보는데 좋은 도구입니다. 바로 선형결합이 stationary 가 되지 않고 차분후 되도 되는데 이렇게 설명하는 글이 wikipedia의 정의입니다. 반면에 correlation 은 값이 매우 똑같이 움직이지않으면 낮게 측정될 가능성이 있겠죠. 그래서 장기적 이동방향이 같은가 볼때 cointegration을 사용할…

  • keras의 timeseries_dataset_from_array 사용시 주의할 점

    timeseries_dataset_from_array 에 대한 github issue 예를들어 X=[1, 2, 3], y=[2, 3, 4] 일때 sequence_length=2 라면 X=[1, 2], y=[3] 이 올거라고 생각하지만 아니다. y=[2]가 옴. 다시말해 y는 x 의 시작점의 값임. 간단하게는 y를 shift 해서 호출하면 해결되지만 API에 이런 점이 있다는걸 놓치기 너무 쉽다. 이슈가 그냥 닫혀버려서 더욱 아쉬움.

  • MASE, RMSSE

    MAE, RMSE를 scale. Scale 시 이전 예측값으로 미래를 예측하는 방법 사용.

  • STR (Seasonal Trend decomposition using Regression)

    https://robjhyndman.com/publications/str/