mirror of
https://github.com/wassname/pandas-ta.git
synced 2026-06-27 16:10:07 +08:00
25 lines
522 B
Python
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
|