Technical Indicator#

Initialize#

เริ่มต้นใช้งานได้โดยตั้งค่าผ่าน SETSignalCreator

Parameters
  • start_date : str format [yyyy-mm-dd]

  • end_date : str format [yyyy-mm-dd]

  • index_list : List[str]

  • symbol_list : List[str]

ตัวอย่าง การตั้งค่าและดึงราคา open, high, low และ close

sc = ez.SETSignalCreator(
   start_date="2022-01-01", # วันที่ต้องการเริ่มดึง data
   end_date="2022-01-04", # วันที่สิ้นสุดการดึง data
   index_list=['SET50'], # list index ที่ต้องการจะดึงข้อมูล ถ้าไม่ต้องการให้ใส่ list ว่าง
   symbol_list= ['NETBAY'] # list หุ้นที่ต้องการจะดึง ถ้าไม่ต้องการให้ใส่ list ว่าง
)

df_close = sc.get_data(field ="close",timeframe='daily')
df_open = sc.get_data(field ="open",timeframe='daily')
df_high = sc.get_data(field ="high",timeframe='daily')
df_low = sc.get_data(field ="low",timeframe='daily')

Generate Technical Indicator#

Simple Moving Average (SMA)#

ตัวอย่าง การดึง sma(3) ของราคาปิด

sma = sc.ta.sma(df_close, 3)

Exponential Moving Average (EMA)#

ตัวอย่าง การดึง ema(3) ของราคาปิด

sma = sc.ta.ema(df_close, 3)

Moving Average Convergence Divergence (MACD)#

ตัวอย่าง การดึง MACD(26,12,9) ของราคาปิด

macd, signal, histrogram = sc.ta.macd(df_close, 26, 12, 9)

Average Directional Movement Index (ADX)#

ตัวอย่าง การดึง ADX(14)

adx, negative_di, positive_di = sc.ta.adx(df_high, df_low, df_close, 14)

Commodity Channel Index (CCI)#

ตัวอย่าง การดึง CCI(20,0.015)

cci = sc.ta.cci(df_high, df_low, df_close, 20, 0.015)

Ichimoku (Ichimoku)#

ตัวอย่าง การดึง Ichimoku(9,26,52)

conversion_line, base_line, spanA, spanB = sc.ta.ichimoku(
     df_high, df_low, 9, 26, 52
 )

Parabolic Sar (PSAR)#

ตัวอย่าง การดึง PSAR

psar, psar_down, psar_down_indicator, psar_up, psar_up_indicator = sc.ta.psar(df_high, df_low, df_close)

Relative Strength Index (RSI)#

ตัวอย่าง การดึง RSI(14) ของราคาปิด

rsi = sc.ta.rsi(df_close,14)

Stochastic (STO)#

ตัวอย่าง การดึง STO(14,3)

sto, sto_sig = sc.ta.sto(df_high, df_low, df_close, 14, 3)

Rate Of Change (ROC)#

ตัวอย่าง การดึง ROC(2) ของราคาปิด

roc = sc.ta.roc(df_close, 2, True)

Average True Range (ATR)#

ตัวอย่าง การดึง ATR(14)

atr = sc.ta.atr(df_high, df_low, df_close, 14)

Bollinger Band (BB)#

ตัวอย่าง การดึง BB(20,2) ของราคาปิด

bb_h, bb_ch, bb_l, bb_cl, bb_m, bb_prc, bb_width = sc.ta.bb(df_close, 20, 2)

Donchian Channels (DC)#

ตัวอย่าง การดึง DC(1)

dc_high, dc_low, dc_mid, dc_prc, dc_width = sc.ta.dc(df_high, df_low, df_close, 1)

Keltner Channels (KC)#

ตัวอย่าง การดึง KC(20,10,2)

kc_h, kc_ch, kc_l, kc_cl, kc_m, kc_prc, kc_width = sc.ta.kc(
     df_high, df_low, df_close, 20, 10, 2, False, False
 )