MCPcopy Create free account
hub / github.com/ScottfreeLLC/AlphaPy / abovema

Function abovema

alphapy/transforms.py:53–73  ·  view source on GitHub ↗

r"""Determine those values of the dataframe that are above the moving average. Parameters ---------- f : pandas.DataFrame Dataframe containing the column ``c``. c : str Name of the column in the dataframe ``f``. p : int The period of the moving averag

(f, c, p = 50)

Source from the content-addressed store, hash-verified

51#
52
53def abovema(f, c, p = 50):
54 r"""Determine those values of the dataframe that are above the
55 moving average.
56
57 Parameters
58 ----------
59 f : pandas.DataFrame
60 Dataframe containing the column ``c``.
61 c : str
62 Name of the column in the dataframe ``f``.
63 p : int
64 The period of the moving average.
65
66 Returns
67 -------
68 new_column : pandas.Series (bool)
69 The array containing the new feature.
70
71 """
72 new_column = f[c] > ma(f, c, p)
73 return new_column
74
75
76#

Callers

nothing calls this directly

Calls 1

maFunction · 0.85

Tested by

no test coverage detected