Skip to content

iamernie8199/A-Deep-RL-Framework-for-futures-Trading

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A-Deep-RL-Framework-for-Index-futures-Trading

hackmd-github-sync-badge

Data

  • 台指期
    • Source:
      • DQ2: 1987/1/7 ~ 2021/3/15
      • 期交所: 2021/3/15 ~
    • 交易時間: 前日夜盤+今日日盤
    • 其他說明:
      • DQ2成交量: 不含價差交易

feature

  • log return
    • $\ln\frac{P_t}{P_{t-1}}$, $P_t$為資產在t時刻的價格
  • 基差(basis)
    • def: 現貨價格 - 期貨價格
    • $\frac{現貨-期貨}{現貨}\times10$
      • 乘10目的是放大原始值域([-0.03, 0.07]->[-0.3, 0.7])
  • 成交量/OI
    • percentile: data[:t], 統計t時刻值在t時刻前所有資料的百分位數
      • 刻劃破新高
    • deg_change: $\arctan(V_t-V_{t-1}, 100)$
      • 刻劃變化量, 100為歷史成交量下限
  • K棒
    • 實體: $|o-c|$
    • 上影線: $high-\max(o, c)$
    • 下影線: $\min(o,c)-low$
    • 除range(h-l), 以分形角度看K棒
  • OHLC
  • Hurst exponent
    • Hurst Exponent and Trading Signals Derived from Market Time Series
    • $p(k) = Ck^{-\alpha}$
      • p(k) is an autocorrelation function
      • C is constant
      • k is number of lags
      • $\alpha$ is the decay parameter
        • $\alpha$ ranges between [0,2]
        • $0<\alpha<1$: persistence
        • $\alpha=1$: random walk
        • $1<\alpha<2$: mean reversion
    • $H=1-\frac{\alpha}{2}$
      • H=0.5: random walk
      • H<0.5: mean reversion
      • H>0.5: momentum
    • 2Q/4Q

ref

fractal

  • the first 100 pages of the book,"The Science of Fractal Images" edited by Heinz-Otto Peitgen and Dietmar Saupe

FinRL

https://towardsdatascience.com/deep-reinforcement-learning-for-automated-stock-trading-f1dad0126a02

todo

note

pip install numpy==1.19.5

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages