jonromero / forex_algotrading

My Forex algotrading platform in Python - based on my posts at http://jon.io
MIT License
477 stars 178 forks source link

Problem with ml script #1

Open lusum opened 8 years ago

lusum commented 8 years ago

I had a couple problem with your ml.py come

The first one is only a glitch and in the doc you say that the file unzipped in the data directory should be sample.csv, instead it is f.csv

The second one is a bug:

Traceback (most recent call last):
File "ml.py", line 56, in
main(sys.argv[1])
File "ml.py", line 21, in main
ticks_data = grouped_data['Sell'].resample('24H').ohlc() File "/usr/lib/python2.7/dist-packages/pandas/core/generic.py", line 2360, in getattr (type(self).name, name)) AttributeError: 'Series' object has no attribute 'ohlc'

I have solved this changing the line:

ticks_data = grouped_data['Sell'].resample('24H').groupby(['Sell']).ohlc()

with:

tick2_data = grouped_data.resample('24H', how={'Sell': 'ohlc'}) ticks_data = tick2_data['Sell']

jonromero commented 8 years ago

Nice. Make a pull request with the changes and I'll merge them

Cheers

lusum commented 8 years ago

Ok, i will test a cleaner code and i will submit

lusum commented 8 years ago

I don't know how to do it, sorry

jonromero commented 8 years ago

No worries, I'll fix it