Skip to main content

Unofficial Python library for Gain Capital API from Forex.com

Project description

gcapi-python

Python package for Gain Capital API used for trading on Forex.com

PyPI version

Table of Contents

Getting Started

Installation

pip install gcapi-python

Usage

After installing, import into your project

from gcapi import GCapiClient

Initialize with Forex.com credentials and app key.

api = GCapiClient(username='usr', password='***', appkey='***', proxies=None)

Endpoints

Account Information

api.get_account_info(get=None)

Margin Information

api.get_margin_info(get=None)

Market Information

api.get_market_info(market_name,get=None)

Pricing

api.get_prices(market_id=None, num_ticks=None, from_ts=None, to_ts=None, price_type=None)
api.get_ohlc(market_id=None, num_ticks=None, interval="HOUR", span=1, from_ts=None, to_ts=None)

Trading

api.trade_order(quantity, offer_price, direction, trading_acc_id=None, market_id=None, market_name=None, stop_loss=None, 
                take_profit=None, trigger_price=None)

List Open Positions

api.list_open_positions(trading_acc_id=None)

Examples

Click here to see examples

Contact

Please contact Kyu Mok (Ricky) Kim if you have any questions, suggestions, or feedback.

Website: rickykim.net

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for gcapi-python, version 0.0.8
Filename, size File type Python version Upload date Hashes
Filename, size gcapi-python-0.0.8.tar.gz (11.5 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page