https://github.com/neka-nat/python-forexconnect
Python binding of forexconnect api
https://github.com/neka-nat/python-forexconnect
forex-trading python-bindings
Last synced: 2 months ago
JSON representation
Python binding of forexconnect api
- Host: GitHub
- URL: https://github.com/neka-nat/python-forexconnect
- Owner: neka-nat
- Created: 2015-10-10T14:57:23.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2018-02-15T15:00:29.000Z (over 7 years ago)
- Last Synced: 2025-03-18T13:51:25.380Z (7 months ago)
- Topics: forex-trading, python-bindings
- Language: C++
- Size: 3.29 MB
- Stars: 39
- Watchers: 6
- Forks: 24
- Open Issues: 3
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
python-forexconnect
===================.. image:: https://travis-ci.org/neka-nat/python-forexconnect.svg?branch=master
:target: https://travis-ci.org/neka-nat/python-forexconnectAbout
------
This library is a Python binding of Forexconnect API
using boost.python.Build
-----First, install the required packages.
$ sudo apt-get install build-essential cmake libboost-log-dev libboost-date-time-dev libboost-python-dev
And then, download "ForexConnectAPI-1.4.1" from http://www.fxcodebase.com/wiki/index.php/Download
and set environment "FOREXCONNECT_ROOT" which is the path ForexConnectAPI installed.$ wget http://fxcodebase.com/bin/forexconnect/1.4.1/ForexConnectAPI-1.4.1-Linux-x86_64.tar.gz
$ tar xvf ForexConnectAPI-1.4.1-Linux-x86_64.tar.gz
$ export FOREXCONNECT_ROOT=$(pwd)/ForexConnectAPI-1.4.1-Linux-x86_64
$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/ForexConnectAPI-1.4.1-Linux-x86_64/lib
Next, clone this repository.
$ git clone https://github.com/neka-nat/python-forexconnect.git
Build and install.
$ cd python-forexconnect
$ mkdir build
$ cd build
$ cmake .. -DDEFAULT_FOREX_URL="http://"
$ make install
Usage
------This tutorial is simple trading using python-forexconnect.
First, give FXCM account username, password and type ("Real" or "Demo") to login.
Next, send query to open position and get the position list which you have.
Finally, close the opened position and logout.::
>> import forexconnect
>> cl = forexconnect.ForexConnectClient("usrname", "pass", "Real")
>> cl.open_position("EUR/JPY", forexconnect.BUY, 1)
>> ti = cl.get_trades()
>> cl.close_position(ti[0].trade_id)
>> cl.logout()Requirements
-------------* boost 1.54
* ForexConnectAPI 1.4.1