jonromero / forex_algotrading Goto Github PK
View Code? Open in Web Editor NEWMy Forex algotrading platform in Python - based on my posts at http://jon.io
License: MIT License
My Forex algotrading platform in Python - based on my posts at http://jon.io
License: MIT License
Everything worked out until trying to open Chat.html.
It was an empty page with nothing on it. I used the sample data, and I setup the http server. I could access the files, but the chart.html was empty
I think it should be scikit-learn. That's the library name. sklearn is a module in that library.
Another recommendation is to do a "pip install wheel" first.
I get this error:
.\git\forex_algotrading>python .\post3\runner.py ------ System online ------- 2017-07-02 00:39:28.751531 Bad Request 2017-07-01T22:39:13.752105Z Traceback (most recent call last): File ".\post3\runner.py", line 46, in <module> main() File ".\post3\runner.py", line 27, in main prices = response.get("prices", 200) File "C:\Python35\lib\site-packages\v20\response.py", line 30, in get raise ResponseUnexpectedStatus(self, status) v20.errors.ResponseUnexpectedStatus: GET https://api-fxpractice.oanda.com:443/v3/accounts/.../pricing?instruments=E UR_USD&includeUnitsAvailable=False&since=2017-07-01T22%3A39%3A13.752105Z expected status 200, got 400 (Bad Request)
Are examples still working on your side?
It is not clear where I can fetch this information. The Token was easy, but this wasn't.
Thank you,
Houman
Hello,
maybe you might support Python 3
print ...
should be replaced by print(...)
python -m http.server 8000
should be use to run micro web server
Kind regards
Edit 16/11/17: Issue not resolved. I was able to run the code till the end (verified by "Done. Goto 0.0.0.0:8000/chart.html"), and went into http://MYPCNAME:8000 but I could not find any "Chart" file in the server... Help from anyone??
i have a few ideas
when the second daily candle close (above for buy) (below for sell)
i want to start building a postion in the direction of the trend
following day i want to take a postion when prices breaks and retest
the previous day high or low on the 1 hour
every daily candle that closes above or below the 5 ema i want to add to my postion using
1 hour break and retest of he previous day high or using the days opening price 30 min timeframe after 9 pm eastern
close all postion on the first close back below/above the 5 ema
@jonromero
Hello,
it's not very safe to have OANDA_ACCESS_TOKEN
and OANDA_ACCOUNT_ID
in script
(because you can accidentally push to GitHub these very private data)
You might have
config.py
file andconfig.default.py
fileAdd config.py
to .gitignore
config.default.py
could be simply
OANDA_ACCESS_TOKEN="...."
OANDA_ACCOUNT_ID="..."
User will have to copy
config.default.py
to config.py
and edit config.py
your scripts will contains
from config import OANDA_ACCESS_TOKEN, OANDA_ACCOUNT_ID
Kind regards
I got error when running create-ohlc.py.
Here the message:
**>
Traceback (most recent call last):
File "create_OHLC.py", line 36, in
main(sys.argv[1])
File "create_OHLC.py", line 12, in main
df = pandas.read_csv(filename, parse_dates={'DateTime'}, index_col='DateTime', names=['Tid', 'Dealable', 'Pair', 'DateTime', 'Buy', 'Sell'], date_parser=parse)
File "/Users/yusuf81/anaconda/envs/forex27/lib/python2.7/site-packages/pandas/io/parsers.py", line 646, in parser_f
return _read(filepath_or_buffer, kwds)
File "/Users/yusuf81/anaconda/envs/forex27/lib/python2.7/site-packages/pandas/io/parsers.py", line 389, in _read
parser = TextFileReader(filepath_or_buffer, **kwds)
File "/Users/yusuf81/anaconda/envs/forex27/lib/python2.7/site-packages/pandas/io/parsers.py", line 730, in init
self._make_engine(self.engine)
File "/Users/yusuf81/anaconda/envs/forex27/lib/python2.7/site-packages/pandas/io/parsers.py", line 923, in _make_engine
self._engine = CParserWrapper(self.f, self.options)
File "/Users/yusuf81/anaconda/envs/forex27/lib/python2.7/site-packages/pandas/io/parsers.py", line 1378, in init
ParserBase.init(self, kwds)
File "/Users/yusuf81/anaconda/envs/forex27/lib/python2.7/site-packages/pandas/io/parsers.py", line 1032, in init
kwds.pop('parse_dates', False))
File "/Users/yusuf81/anaconda/envs/forex27/lib/python2.7/site-packages/pandas/io/parsers.py", line 1015, in _validate_parse_dates_arg
raise TypeError(msg)
TypeError: Only booleans, lists, and dictionaries are accepted for the 'parse_dates' parameter
---------------------------------------------------------------------------
I think "def parse" output rejected by parse_dates.
I did exactly what was in the installation guide, and after trying to run runner.py, I got the following message:
Traceback
(most recent call last):
File "runner.py", line 46, in <module>
main()
File "runner.py", line 27, in main
prices = response.get("prices", 200)
File "/tmp/falgo/local/lib/python2.7/site-packages/v20/response.py", line 30, in get
raise ResponseUnexpectedStatus(self, status)
v20.errors.ResponseUnexpectedStatus: GET https://api- fxpractice.oanda.com:443/v3/accounts/999743/pricing?instruments=EUR_USD&since=2017-
02-23T23%3A16%3A26.691541Z&includeUnitsAvailable=False expected status 200, got 401 `(Unauthorized)
I am pretty sure I have the right account number form manage funds section on OANDA and the right API key as well.
I am very VERY new to messing with anything more advanced that using matlab to do matrix equations. I got this bot from on here but even using others I get the same message. The token and ID that used are indeed the correct ones with my account. Please help! I hope this is the right place to ask a question..
Trace back message
ubuntu@ubuntu:~/Downloads/forex_algotrading-master/post3$ python runner.py
------ System online ------- 2016-09-16 21:53:13.002630
Buy at 1.11532
Traceback (most recent call last):
File "runner.py", line 29, in
main()
File "runner.py", line 23, in main
type='market')
File "/home/ubuntu/Downloads/forex_algotrading-master/post3/oandapy.py", line 73, in create_order
return self.request(endpoint, "POST", params=params)
File "/home/ubuntu/Downloads/forex_algotrading-master/post3/oandapy.py", line 262, in request
raise OandaError(content)
oandapy.OandaError: OANDA API returned error code 4 (The access token provided does not allow this request to be made)
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']
Can someone tell me how to get new sample data to test or upload a new spreadsheet file
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.