Files
pandas-ta/pandas_ta/overlap/hlc3.py
T
2020-10-01 16:18:01 +01:00

25 lines
522 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.0
# Offset
if offset != 0:
hlc3 = hlc3.shift(offset)
# Name & Category
hlc3.name = "HLC3"
hlc3.category = "overlap"
return hlc3