tr8dr / tseries-patterns

trend / momentum and other patterns in financial timeseries
MIT License
229 stars 70 forks source link

Locator attempting to generate 11571121 ticks ([729763.75, ..., 737799.25]), which exceeds Locator.MAXTICKS (1000). #10

Closed coolsnake closed 3 years ago

coolsnake commented 3 years ago

Hi tr8dr,

Thank you for your update. I downloaded the latest code to deal with the stock history data which is daily based.

I got the following error. " Locator attempting to generate 11571121 ticks ([729763.75, ..., 737799.25]), which exceeds Locator.MAXTICKS (1000). " I guess it is related to ggplot, but I can not figure out how to fix it.

sample code: import pandas as pd import numpy as np

from tseries_patterns import AmplitudeBasedLabeler df = pd.read_csv ("csv/WMT.csv", parse_dates=["stamp"]) df = df.iloc[::-1] df.head() labeler = AmplitudeBasedLabeler (minamp = 10, Tinactive = 10) labels = labeler.label (df,scale=1e2) labels.to_csv('Result.csv') labeler.plot()

the attached is the history data, please rename it to WMT.csv. WMT.txt

Thanks.

tr8dr commented 3 years ago

Due to the reversing of the dataframe, the index was descending. plotnine seems to have an issue with that. So I added a line to reset the index. Works now.

coolsnake commented 3 years ago

Thanks.