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

Function belowma

alphapy/transforms.py:123–143  ·  view source on GitHub ↗

r"""Determine those values of the dataframe that are below 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

121#
122
123def belowma(f, c, p = 50):
124 r"""Determine those values of the dataframe that are below the
125 moving average.
126
127 Parameters
128 ----------
129 f : pandas.DataFrame
130 Dataframe containing the column ``c``.
131 c : str
132 Name of the column in the dataframe ``f``.
133 p : int
134 The period of the moving average.
135
136 Returns
137 -------
138 new_column : pandas.Series (bool)
139 The array containing the new feature.
140
141 """
142 new_column = f[c] < ma(f, c, p)
143 return new_column
144
145
146#

Callers

nothing calls this directly

Calls 1

maFunction · 0.85

Tested by

no test coverage detected