Back to Community
history() got multiple values for keyword argument 'frequency'

mavg_short = np.mean(history(security, "price", bar_count = 30, frequency = "1m"))
TypeError: history() got multiple values for keyword argument 'frequency'

I have been reading and it looks like I need to use history in stead of data.history so trading also will start right away. If this is not true or is no longer true please let me know. Any way i'm getting the above error and I am not sure as to why. I tested it with a single "sid" in place of security and removing and replaced ".mean()" with "np.mean()" and still have no ideas why this is happening or how to fix it.

Tanks in advance for any helpful replies.

1 response

use data.history vs history to get the data:

mavg_short = np.mean(data.history(security, "price", bar_count = 30, frequency = "1m"))