Files
pandas-ta/pandas_ta/overlap/hlc3.py
T
2019-05-20 13:25:33 -07:00

23 lines
518 B
Python

# -*- coding: utf-8 -*-
from ..utils import get_offset, verify_series
def hlc3(high, low, close, offset=None, **kwargs):
"""Indicator: HLC3"""
# Validate Arguments
high = verify_series(high)
low = verify_series(low)
close = verify_series(close)
offset = get_offset(offset)
# Calculate Result
hlc3 = (high + low + close) / 3
# Offset
if offset != 0:
hlc3 = hlc3.shift(offset)
# Name & Category
hlc3.name = "HLC3"
hlc3.category = 'overlap'
return hlc3