Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

unused input in frama #132

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions finta/finta.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,17 +460,14 @@ def MAMA(cls, ohlc: DataFrame, period: int = 16) -> Series:
raise NotImplementedError

@classmethod
def FRAMA(cls, ohlc: DataFrame, period: int = 16, batch: int=10) -> Series:
def FRAMA(cls, ohlc: DataFrame, batch: int=10) -> Series:
"""Fractal Adaptive Moving Average
Source: http://www.stockspotter.com/Files/frama.pdf
Adopted from: https://www.quantopian.com/posts/frama-fractal-adaptive-moving-average-in-python

:period: Specifies the number of periods used for FRANA calculation
:batch: Specifies the size of batches used for FRAMA calculation
"""

assert period % 2 == 0, print("FRAMA period must be even")

c = ohlc.close.copy()
window = batch * 2

Expand All @@ -496,7 +493,7 @@ def FRAMA(cls, ohlc: DataFrame, period: int = 16, batch: int=10) -> Series:
continue
filt[i] = cl * x + (1 - x) * filt[i - 1]

return pd.Series(filt, index=ohlc.index, name="{0} period FRAMA.".format(period))
return pd.Series(filt, index=ohlc.index, name="{0} batch FRAMA.".format(batch))

@classmethod
def MACD(
Expand Down