Skip to content

Commit

Permalink
Fix flake8 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
eirik-thorp committed Nov 24, 2023
1 parent c510d0a commit 550b3ea
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions qf_lib/common/utils/miscellaneous/parabolic_sar.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import numpy as np
from qf_lib.common.enums.price_field import PriceField
from qf_lib.containers.dataframe.prices_dataframe import PricesDataFrame
from qf_lib.containers.series.qf_series import QFSeries
Expand Down Expand Up @@ -69,16 +68,3 @@ def parabolic_sar(df: PricesDataFrame, acceleration=0.02, max_acceleration=0.2):
sar_values.append(sar)

return QFSeries(sar_values, index=df.index[1:])


if __name__ == '__main__':
dummy_price_data_with_nan = {
PriceField.Low: [1.1, 1.4, 2.6, 3.4, None, 5.1, 4.4, 3.1],
PriceField.High: [None, 2.2, None, 6.5, 7.1, 7.4, 7.6, 5.],
PriceField.Close: [None, 1.2, 3.5, 5.3, 7.1, 6.3, 6.5, 4.2],
}
dummy_prices_dataframe_with_nan = PricesDataFrame(dummy_price_data_with_nan)

out = parabolic_sar(dummy_prices_dataframe_with_nan)
for i in out:
print(i)

0 comments on commit 550b3ea

Please sign in to comment.