Python package for Gain Capital API used for trading on Forex.com
pip install gcapi-python
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)
api.get_account_info(get=None)
api.get_margin_info(get=None)
api.get_market_info(market_name,get=None)
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)
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)
api.list_open_positions(trading_acc_id=None)
Click here to see examples
Please contact Kyu Mok (Ricky) Kim if you have any questions, suggestions, or feedback.
For any other questions beside this tool, post your questions on http://faq.labs.gaincapital.com/
Website: rickykim.net