[기술적 분석] 지표/전략 : 엘더의 시장 온도계 (Elder's Market Thermometer)

반응형

 

  이 지표는 그 유명한 알렉산더 엘더가 만든 엘더의 온도계, 혹은 시장 온도계. 알렉산더 엘더는 '나의 트레이딩룸으로 오라', '심리투자 법칙', '언제 매도할 것인가' 등의 책으로 유명한 트레이더다. 이 양반이 만든 각 종목의 과열 정도를 측정할 수 있는 변동성에 기반한 지표가 바로 엘더의 온도계다. 시장에 흔히 알려진 탐욕 공포 지수처럼 각 종목의 온도를 재는 용도의 지표라고 생각하면 된다.

 

  엘더의 온도계는 당일 고가와 전일 고가의 가격차, 당일 저가와 전일 고가의 가격차 중 큰 값을 절댓값으로 취한다. 즉 고가의 가격 변동폭, 저가의 가격 변동폭을 가지고 변동성을 측정한다는 이야기다. 여기서 고가의 가격 변동폭을 취했을 경우와 저가의 가격 변동폭을 취했을 경우 각각 빨간색과 파란색을 칠하기도 한다. 이 가격차들의 값들을 이용해 보통 20일 지수 이동 평균(EMA)을 그린다. 각 가격차와 이 이동평균 간의 차이를 이용해 변동성을 파악하고 매수 / 매도 시점을 파악하는 게 바로 이 엘더의 시장 온도계다.

 

엘더의 시장 온도계 지표

 

  엘더의 시장 온도계를 이용한 매매 방법은 시장 온도가 시장 온도의 지수 이동 평균의 절반일 경우 매수, 두 배일 경우 매도를 취한다. 이는 간단히 이야기하면 급락 시 매수, 급등 시 매도하는 전략이다. 단, 평소 움직임이 없다가 급격하게 거래가 터지고 쉽사리 사그라드는 종목들을 대상으로 삼았을 경우에는 적용에 유의해야 한다. 메뚜기 떼처럼 신나게 거래량과 가격이 올랐다가 며칠 후에 사그라드는 종목의 경우, 본격적인 가격 하락 시에 매수 신호가 발생하기 때문이다.

 

  엘더의 온도계를 이용한 전략은 역시 알렉산더 엘더의 전략답게 종목과 매수/매도 하는 배수(온도와 이동평균이 두 배 차이 나면 매수/매도하는)를 잘만 조정하면 수익은 꽤나 잘 나오는 지표다.

 

  마지막으로 트레이딩 뷰 파인 스크립트 소스와 pandas-ta 소스를 공유하며 마친다.

 

반응형

 

  • 엘더의 시장 온도계 (Elder's Market Thermometer) 트레이딩 뷰 파인 스크립트 지표 소스
//@version=5
indicator(title="Elder's Market Thermometer", shorttitle="Thermometer", overlay=false)
import TradingView/ta/7 as ta7 
import blackcat1402/pandas_ta/7 as pta
len = input.int(20, minval=1)

maType = input.string("EMA", "MA Type", options = ["SMA", "EMA", "DEMA", "TEMA", "FRAMA", "T3", "TRIMA", "RMA", "WMA", "HMA", "VWMA", "ALMA", "JMA", "SINWMA", "FWMA", "LINREG", "SWMA", "VIDYA", "VWAP", "ZLMA"])
ma(source, length, _type) =>
    switch _type
        "SMA" => ta.sma(source, length)
        "EMA" => ta.ema(source, length)
        "DEMA" => ta7.dema(source,length)
        "TEMA" => ta7.tema(source,length)
        "FRAMA" => ta7.frama(source,length)
        "T3" => ta7.t3(source,length)
        "TRIMA" => ta7.trima(source,length)
        "RMA" => ta.rma(source, length)
        "WMA" => ta.wma(source, length)
        "HMA" => ta.hma(source, length)
        "VWMA" => ta.vwma(source * volume, length)
        "ALMA" => pta.alma(source, length)
        "JMA" => pta.jma(source, length)
        "SINWMA" => pta.sinwma(source, length)
        "FWMA" => pta.fwma(source, length)
        "LINREG" => pta.linreg(source, length)
        "SWMA" => pta.swma(source)
        "YIDYA" => pta.vidya(source, length)
        "VWAP" => pta.vwap(source)
        "ZLMA" => pta.zlma(source, length)


thermoL = math.abs(low[1] - low)
thermoH = math.abs(high - high[1])
thermo = thermoL > thermoH ? thermoL : thermoH
thermo_ma = ma(thermo, len, maType)

plot(thermo, style=plot.style_columns, color=(thermo >= thermo_ma ? color.red : color.green), linewidth=2, title="Market Thermometer")
plot(thermo_ma, color=color.yellow, title="MA of Market Thermometer")

 

 

  • 엘더의 시장 온도계 (Elder's Market Thermometer) 트레이딩 뷰 파인 스크립트 전략 소스
//@version=5
strategy(title="Elder's Market Thermometer", shorttitle="Thermometer", overlay=false, margin_long=100, margin_short=100, default_qty_type=strategy.percent_of_equity, default_qty_value=50, commission_type=strategy.commission.percent, commission_value=0.2, pyramiding=0)
import TradingView/ta/7 as ta7
import blackcat1402/pandas_ta/7 as pta
len = input.int(20, minval=1)
long = input.float(0.5)
short = input.float(2.0)

maType = input.string("EMA", "MA Type", options = ["SMA", "EMA", "DEMA", "TEMA", "FRAMA", "T3", "TRIMA", "RMA", "WMA", "HMA", "VWMA", "ALMA", "JMA", "SINWMA", "FWMA", "LINREG", "SWMA", "VIDYA", "VWAP", "ZLMA"])
ma(source, length, _type) =>
    switch _type
        "SMA" => ta.sma(source, length)
        "EMA" => ta.ema(source, length)
        "DEMA" => ta7.dema(source,length)
        "TEMA" => ta7.tema(source,length)
        "FRAMA" => ta7.frama(source,length)
        "T3" => ta7.t3(source,length)
        "TRIMA" => ta7.trima(source,length)
        "RMA" => ta.rma(source, length)
        "WMA" => ta.wma(source, length)
        "HMA" => ta.hma(source, length)
        "VWMA" => ta.vwma(source * volume, length)
        "ALMA" => pta.alma(source, length)
        "JMA" => pta.jma(source, length)
        "SINWMA" => pta.sinwma(source, length)
        "FWMA" => pta.fwma(source, length)
        "LINREG" => pta.linreg(source, length)
        "SWMA" => pta.swma(source)
        "YIDYA" => pta.vidya(source, length)
        "VWAP" => pta.vwap(source)
        "ZLMA" => pta.zlma(source, length)


thermoL = math.abs(low[1] - low)
thermoH = math.abs(high - high[1])
thermo = thermoL > thermoH ? thermoL : thermoH
thermo_ma = ma(thermo, len, maType)

plot(thermo, style=plot.style_columns, color=(thermo >= thermo_ma ? color.red : color.green), linewidth=2, title="Market Thermometer")
plot(thermo_ma, color=color.yellow, title="MA of Market Thermometer")

startDate = input.time(defval=timestamp("01 Jan 1970 00:00 +0000"), group = "Test Range")
finishDate = input.time(defval=timestamp("31 Dec 2025 24:00 +0000"), group = "Test Range")
time_condition = time >= startDate and time <= finishDate

if(time_condition)
	if ta.crossunder(thermo, thermo_ma * long)
		strategy.entry("매수", strategy.long, oca_type=strategy.oca.cancel, comment="매수")
	if ta.crossover(thermo, thermo_ma * short)
		strategy.close_all('매도')

bgcolor(strategy.position_size > 0 ? color.new(color.yellow,90) : na)

 

 

  • 엘더의 시장 온도계 (Elder's Market Thermometer) pandas-ta 소스
import pandas as pd
import pandas_ta as ta
import FinanceDataReader as fdr
 
data = fdr.DataReader('005930')
thermo = ta.thermo(high=data['High'], low=data['Low'], length=20, long=0.5, short=2, mamode='EMA')
data = pd.concat([data, thermo], axis=1)
data.dropna(inplace=True)

 

  추가로 알렉산더 엘더 저서 중 읽어 봄직한 책들을 공유한다.

 

나의 트레이딩 룸으로 오라, 이레미디어, 알렉산더 엘더 저/조윤정 역주식시장에서 살아남는 심리투자 법칙, 이레미디어, 알렉산더 엘더 저/신가을 역언제 매도할 것인가:이익매도·손절매도·공매도·선물매도, 이레미디어, 알렉산더 엘더

 

나의 트레이딩 룸으로 오라

COUPANG

www.coupang.com

 

주식시장에서 살아남는 심리투자 법칙

COUPANG

www.coupang.com

 

언제 매도할 것인가:이익매도·손절매도·공매도·선물매도

COUPANG

www.coupang.com

"이 포스팅은 쿠팡 파트너스 활동의 일환으로, 이에 따른 일정액의 수수료를 제공받습니다."

반응형