Repository: fxcm/ForexConnectAPI
Branch: master
Commit: 52b753f671d9
Files: 5
Total size: 26.1 KB
Directory structure:
gitextract_ylp2kdzk/
├── AttachStopLimitToPosition.py
├── AvailableSymbols.md
├── ChangeOrder.py
├── CreateOCOOrder.py
└── README.md
================================================
FILE CONTENTS
================================================
================================================
FILE: AttachStopLimitToPosition.py
================================================
# example code how to attach Stop or Limit to open position, each create_order_request() can attach one order, to attach stop and limit need to call this function 2 times
# this code shows how to attach Limit, for a Stop replace order_type='S'
import argparse
from time import sleep
from threading import Event
from forexconnect import fxcorepy, ForexConnect, Common
import common_samples
def parse_args():
parser = argparse.ArgumentParser(description='Process command parameters.')
common_samples.add_main_arguments(parser)
common_samples.add_instrument_timeframe_arguments(parser, timeframe=False)
common_samples.add_direction_rate_lots_arguments(parser)
common_samples.add_account_arguments(parser)
args = parser.parse_args()
return args
class OrdersMonitor:
def __init__(self):
self.__order_id = None
self.__orders = {}
self.__event = Event()
def on_added_order(self, _, __, order_row):
order_id = order_row.order_id
self.__orders[order_id] = order_row
if self.__order_id == order_id:
self.__event.set()
def wait(self, time, order_id):
self.__order_id = order_id
order_row = self.find_order(order_id)
if order_row is not None:
return order_row
self.__event.wait(time)
return self.find_order(order_id)
def find_order(self, order_id):
if order_id in self.__orders:
return self.__orders[order_id]
else:
return None
def reset(self):
self.__order_id = None
self.__orders.clear()
self.__event.clear()
def main():
str_user_id = 'username'
str_password = 'password'
str_url = 'www.fxcorporate.com/Hosts.jsp'
str_connection = 'Demo'
str_session_id = None
str_pin = None
str_instrument = 'CAD/JPY'
str_buy_sell = 'B' # should be oposite direction than open position
str_rate = 104.610
str_lots = 10 # Quantity should be the same as open position
str_account = 'account_id'
trade_id = 'trade_id'
stop_ord = 'S'
limit_ord = 'L'
with ForexConnect() as fx:
fx.login(str_user_id, str_password, str_url, str_connection, str_session_id, str_pin, common_samples.session_status_changed)
try:
account = Common.get_account(fx, str_account)
if not account:
raise Exception("The account '{0}' is not valid".format(str_account))
else:
str_account = account.account_id
print("AccountID='{0}'".format(str_account))
offer = Common.get_offer(fx, str_instrument)
if offer is None:
raise Exception("The instrument '{0}' is not valid".format(str_instrument))
login_rules = fx.login_rules
trading_settings_provider = login_rules.trading_settings_provider
base_unit_size = trading_settings_provider.get_base_unit_size(str_instrument, account)
amount = base_unit_size * str_lots
request = fx.create_order_request(
order_type=limit_ord,
OFFER_ID=offer.offer_id,
ACCOUNT_ID=str_account,
BUY_SELL=str_buy_sell,
AMOUNT=amount,
RATE=str_rate,
TRADE_ID=trade_id,
)
orders_monitor = OrdersMonitor()
orders_table = fx.get_table(ForexConnect.ORDERS)
orders_listener = Common.subscribe_table_updates(orders_table, on_add_callback=orders_monitor.on_added_order)
try:
resp = fx.send_request(request)
order_id = resp.order_id
except Exception as e:
common_samples.print_exception(e)
orders_listener.unsubscribe()
else:
# Waiting for an order to appear or timeout (default 30)
order_row = orders_monitor.wait(30, order_id)
if order_row is None:
print("Response waiting timeout expired.\n")
else:
print("The order has been added. OrderID={0:s}, "
"Type={1:s}, BuySell={2:s}, Rate={3:.5f}, TimeInForce={4:s}".format(
order_row.order_id, order_row.type, order_row.buy_sell, order_row.rate,
order_row.time_in_force))
sleep(1)
orders_listener.unsubscribe()
except Exception as e:
common_samples.print_exception(e)
try:
fx.logout()
except Exception as e:
common_samples.print_exception(e)
if __name__ == "__main__":
main()
input("Done! Press enter key to exit\n")
================================================
FILE: AvailableSymbols.md
================================================
#Symbols and timeframes available from FXCM
Below we have listed a small portion of most popular symbols and timeframes available for resolutions: 1minute, 1hour and 1day
For a complete listing of available data please contact your FXCM representantive.
|Symbol|m1 From|H1 From|D1 From
|:---:|---|---|---
|**EUR/USD**|2001-11-27T23:09:00Z|2001-10-21T18:00:00Z|1993-05-10T17:00:00Z
|**NATGAS**|2001-11-27T23:10:00Z|2001-10-21T18:00:00Z|1993-05-10T17:00:00Z
|**GER30**|2008-09-10T05:01:00Z|2008-08-19T00:00:00Z|1970-02-10T17:00:00Z
|**GBP/USD**|2001-11-27T23:09:00Z|2001-10-21T18:00:00Z|1993-05-10T17:00:00Z
|**XAU/USD**|2009-02-24T16:00:00Z|2009-02-24T16:00:00Z|1920-01-29T17:00:00Z
|**USD/CAD**|2001-11-27T23:13:00Z|2001-10-21T18:00:00Z|1993-05-10T17:00:00Z
|**GBP/JPY**|2001-11-27T23:09:00Z|2001-10-21T18:00:00Z|1993-05-10T17:00:00Z
|**USTECH**|2001-11-27T23:10:00Z|2001-10-21T18:00:00Z|1993-05-10T17:00:00Z
|**US30**|2009-03-10T20:00:00Z|2008-08-19T06:00:00Z|1981-01-28T17:00:00Z
|**EUR/JPY**|2001-11-27T23:09:00Z|2001-10-21T18:00:00Z|1993-05-10T17:00:00Z
|**AUD/JPY**|2001-11-27T23:10:00Z|2001-10-21T18:00:00Z|1993-05-10T17:00:00Z
|**NZD/USD**|2001-11-27T23:12:00Z|2001-10-21T18:00:00Z|1993-05-10T17:00:00Z
|**EUR/GBP**|2001-11-27T23:09:00Z|2001-10-21T18:00:00Z|1993-05-10T17:00:00Z
|**Ustech**|2001-11-27T23:09:00Z|2001-10-21T18:00:00Z|1993-05-10T17:00:00Z
|**UK100**|2008-09-10T05:01:00Z|2008-08-19T00:00:00Z|1986-04-01T17:00:00Z
================================================
FILE: ChangeOrder.py
================================================
# example code how to change order, it can be used for any waiting order, attached stop or limit
#the AMOUNT field is optional,
import argparse
from time import sleep
from threading import Event
from forexconnect import fxcorepy, ForexConnect, Common
import common_samples
def parse_args():
parser = argparse.ArgumentParser(description='Process command parameters.')
common_samples.add_main_arguments(parser)
common_samples.add_instrument_timeframe_arguments(parser, timeframe=False)
common_samples.add_direction_rate_lots_arguments(parser)
common_samples.add_account_arguments(parser)
args = parser.parse_args()
return args
class OrdersMonitor:
def __init__(self):
self.__order_id = None
self.__orders = {}
self.__event = Event()
def on_added_order(self, _, __, order_row):
order_id = order_row.order_id
self.__orders[order_id] = order_row
if self.__order_id == order_id:
self.__event.set()
def wait(self, time, order_id):
self.__order_id = order_id
order_row = self.find_order(order_id)
if order_row is not None:
return order_row
self.__event.wait(time)
return self.find_order(order_id)
def find_order(self, order_id):
if order_id in self.__orders:
return self.__orders[order_id]
else:
return None
def reset(self):
self.__order_id = None
self.__orders.clear()
self.__event.clear()
class Args:
l = "username"
p = "password"
u = "http://www.fxcorporate.com/Hosts.jsp"
c = "Demo"
i = 'CAD/JPY'
session = None
pin = None
lots = 10
r = 104.568
stop_ord = 'S'
limit_ord = 'L'
account = 'account id'
order_id = 'order_id'
def main():
args = Args
str_user_id = args.l
str_password = args.p
str_url = args.u
str_connection = args.c
str_session_id = args.session
str_pin = args.pin
str_instrument = args.i
str_rate = args.r
lots = args.lots
str_account = args.account
str_order_type = args.limit_ord
order_id = args.order_id
with ForexConnect() as fx:
fx.login(str_user_id, str_password, str_url, str_connection, str_session_id, str_pin, common_samples.session_status_changed)
try:
account = Common.get_account(fx, str_account)
if not account:
raise Exception("The account '{0}' is not valid".format(str_account))
else:
str_account = account.account_id
print("AccountID='{0}'".format(str_account))
offer = Common.get_offer(fx, str_instrument)
if offer is None:
raise Exception("The instrument '{0}' is not valid".format(str_instrument))
login_rules = fx.login_rules
trading_settings_provider = login_rules.trading_settings_provider
base_unit_size = trading_settings_provider.get_base_unit_size(str_instrument, account)
amount = base_unit_size * lots
request = fx.create_order_request(
command=fxcorepy.Constants.Commands.EDIT_ORDER,
order_type=str_order_type,
OFFER_ID=offer.offer_id,
ACCOUNT_ID=str_account,
RATE=str_rate,
AMOUNT=lots,
ORDER_ID=order_id,
)
orders_monitor = OrdersMonitor()
orders_table = fx.get_table(ForexConnect.ORDERS)
orders_listener = Common.subscribe_table_updates(orders_table, on_add_callback=orders_monitor.on_added_order)
try:
resp = fx.send_request(request)
except Exception as e:
common_samples.print_exception(e)
orders_listener.unsubscribe()
except Exception as e:
common_samples.print_exception(e)
try:
fx.logout()
except Exception as e:
common_samples.print_exception(e)
if __name__ == "__main__":
main()
input("Done! Press enter key to exit\n")
================================================
FILE: CreateOCOOrder.py
================================================
import argparse
from distutils.cmd import Command
from time import sleep
from threading import Event
from tkinter import COMMAND
from forexconnect import fxcorepy, ForexConnect, Common
import common_samples
class OrdersMonitor:
def __init__(self):
self.__order_id = None
self.__orders = {}
self.__event = Event()
def on_added_order(self, _, __, order_row):
order_id = order_row.order_id
self.__orders[order_id] = order_row
if self.__order_id == order_id:
self.__event.set()
def wait(self, time, order_id):
self.__order_id = order_id
order_row = self.find_order(order_id)
if order_row is not None:
return order_row
self.__event.wait(time)
return self.find_order(order_id)
def find_order(self, order_id):
if order_id in self.__orders:
return self.__orders[order_id]
else:
return None
def reset(self):
self.__order_id = None
self.__orders.clear()
self.__event.clear()
class Args:
l = "YOUR USERNAME / LOGIN"
p = "PASSWORD"
u = "http://www.fxcorporate.com/Hosts.jsp"
c = "Demo"
i = 'EUR/USD'
session = None
pin = None
amount = 10000
r_up = 1.059
r_dn = 1.051
account = 'ACCOUNT ID'
def main():
args = Args
str_user_id = args.l
str_password = args.p
str_url = args.u
str_connection = args.c
str_session_id = args.session
str_pin = args.pin
str_instrument = args.i
rate_up = args.r_up
rate_dn = args.r_dn
str_amount = args.amount
str_account = args.account
with ForexConnect() as fx:
fx.login(str_user_id, str_password, str_url, str_connection, str_session_id, str_pin, common_samples.session_status_changed)
try:
account = Common.get_account(fx, str_account)
if not account:
raise Exception(
"The account '{0}' is not valid".format(str_account))
else:
str_account = account.account_id
print("AccountID='{0}'".format(str_account))
offer = Common.get_offer(fx, str_instrument)
if offer is None:
raise Exception(
"The instrument '{0}' is not valid".format(str_instrument))
login_rules = fx.login_rules
trading_settings_provider = login_rules.trading_settings_provider
base_unit_size = trading_settings_provider.get_base_unit_size(
str_instrument, account)
valuemap_oco = fx.session.request_factory.create_value_map()
valuemap_oco.set_string(fxcorepy.O2GRequestParamsEnum.COMMAND, fxcorepy.Constants.Commands.CREATE_OCO)
valuemap_up = fx.session.request_factory.create_value_map()
valuemap_up.set_string(fxcorepy.O2GRequestParamsEnum.COMMAND, fxcorepy.Constants.Commands.CREATE_ORDER)
valuemap_up.set_string(fxcorepy.O2GRequestParamsEnum.ORDER_TYPE, fxcorepy.Constants.Orders.STOP_ENTRY)
valuemap_up.set_string(fxcorepy.O2GRequestParamsEnum.ACCOUNT_ID, str_account)
valuemap_up.set_string(fxcorepy.O2GRequestParamsEnum.OFFER_ID, offer.offer_id)
valuemap_up.set_string(fxcorepy.O2GRequestParamsEnum.BUY_SELL, fxcorepy.Constants.BUY)
valuemap_up.set_int(fxcorepy.O2GRequestParamsEnum.AMOUNT, str_amount)
valuemap_up.set_double(fxcorepy.O2GRequestParamsEnum.RATE, rate_up)
valuemap_oco.append_child(valuemap_up)
valuemap_down = fx.session.request_factory.create_value_map()
valuemap_down.set_string(fxcorepy.O2GRequestParamsEnum.COMMAND, fxcorepy.Constants.Commands.CREATE_ORDER)
valuemap_down.set_string(fxcorepy.O2GRequestParamsEnum.ORDER_TYPE, fxcorepy.Constants.Orders.STOP_ENTRY)
valuemap_down.set_string(fxcorepy.O2GRequestParamsEnum.ACCOUNT_ID, str_account)
valuemap_down.set_string(fxcorepy.O2GRequestParamsEnum.OFFER_ID, offer.offer_id)
valuemap_down.set_string(fxcorepy.O2GRequestParamsEnum.BUY_SELL, fxcorepy.Constants.SELL)
valuemap_down.set_int(fxcorepy.O2GRequestParamsEnum.AMOUNT, str_amount)
valuemap_down.set_double(fxcorepy.O2GRequestParamsEnum.RATE, rate_dn)
valuemap_oco.append_child(valuemap_down)
request = fx.session.request_factory.create_order_request(valuemap_oco)
orders_monitor = OrdersMonitor()
orders_table = fx.get_table(ForexConnect.ORDERS)
orders_listener = Common.subscribe_table_updates(orders_table, on_add_callback=orders_monitor.on_added_order)
try:
resp = fx.send_request(request)
order_id = resp.order_id
except Exception as e:
common_samples.print_exception(e)
orders_listener.unsubscribe()
else:
# Waiting for an order to appear or timeout (default 30)
order_row = orders_monitor.wait(30, order_id)
if order_row is None:
print("Response waiting timeout expired.\n")
else:
print("The order has been added. OrderID={0:s}, "
"Type={1:s}, BuySell={2:s}, Rate={3:.5f}, TimeInForce={4:s}".format(
order_row.order_id, order_row.type, order_row.buy_sell, order_row.rate,
order_row.time_in_force))
sleep(1)
orders_listener.unsubscribe()
except Exception as e:
common_samples.print_exception(e)
try:
fx.logout()
except Exception as e:
common_samples.print_exception(e)
if __name__ == "__main__":
main()
input("Done! Press enter key to exit\n")
================================================
FILE: README.md
================================================
# ForexConnectAPI
This SDK is designed to get trading data, trade, load price histories and subscribe for the most recent prices.
It is intended to be used by FXCM clients on auto-trading robots and systems,
chart and market analysis application, custom trading application on FXCM accounts.
Forex Connect supports C++, C#, Java, VB, VBA, Windows, Linux and smart phones. And it is free.
You can use ForexConnect on Trading station account, no extra setup required.
If using O2G2 namespace, keep in mind that it is currently deprecated as it has not been updated since the beginning of 2015.
It may give the users errors or not be compatible in certain cases.
## How to start:
1) You need sign the [EULA](https://www.fxcm.com/uk/forms/eula/) form first.
2) A FXCM TSII account. You can apply for a demo account [here](https://www.fxcm.com/uk/algorithmic-trading/api-trading/).
3) Download [**ForexConnect SDK**](http://www.fxcodebase.com/wiki/index.php/Download)
4) Examples codes and documents are at ForexConnectAPI packages after installed.
5) Online documents: [**Getting Started**](https://apiwiki.fxcorporate.com/api/Getting%20Started.pdf)
6) ForexConnect with Matlab, at [here](https://apiwiki.fxcorporate.com/api/StrategyRealCaseStudy/ForexConnectAPI/FXCM-MATLAB-master.zip).
7) ForexConnect sample code for Android/iOS/macOS/Python/Linux/Windows, at [here](https://github.com/gehtsoft/forex-connect/tree/master/samples).
8) ForexConnect on Python at [here](http://fxcodebase.com/code/viewforum.php?f=51)
## Connect parameters:
1) URL="www.fxcorporate.com/Hosts.jsp"
2) Username="you username"
3) Password="your password"
4) Connection="demo"
5) You can ignore SessionID and PIN
## Suggested Popular Development Platform IDE:
[**Windows 32bit and 64bit – Visual Studio 2005 and up**](https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx)
[**Linux 32bit and 64bit – Eclipse**](https://eclipse.org/)
[**iOS – Xcode**](https://developer.apple.com/xcode/ide/)
[**Android - Android Studio**](https://developer.android.com/studio/intro/index.html)
## Table manager vs Non-table manager:
Table manager preload all tables to your local memoery, it is an in-memory representation of API tables. The table manager allows you to subscribe to table change events such as updates, adding rows, or removing rows. It is important to note that the
SummaryTable is only accessible through the table manager.
Table manager presents a performance decrease because it is constantly recalculating fields.
Non-table manager allow you to capture table updates adhoc via the use of a class that implements theIO2GResponseListener interface. It give performance advantage but you need to calculate some fields such as PipCost or P/L.
## How to get current balance?
You need to request the table from server. please refer to NonTableManagerSamples/PrintTable example program.
private static O2GAccountRow GetAccount(O2GSession session)
{
O2GResponseReaderFactory readerFactory = session.getResponseReaderFactory();
if (readerFactory == null)
{
throw new Exception("Cannot create response reader factory");
}
O2GLoginRules loginRules = session.getLoginRules();
O2GResponse response = loginRules.getTableRefreshResponse(O2GTableType.Accounts);
O2GAccountsTableResponseReader accountsResponseReader = readerFactory.createAccountsTableReader(response);
for (int i = 0; i < accountsResponseReader.Count; i++)
{
O2GAccountRow accountRow = accountsResponseReader.getRow(i);
Console.WriteLine("AccountID: {0}, Balance: {1}", accountRow.AccountID, accountRow.Balance);
}
return accountsResponseReader.getRow(0);
}
## How to get price history:
For pricehistory, you need to use non-table manage.
You can see examples under NonTableManagerSamples/GetHistPrices
## Real Case Study:
1. Learn how to build and backtest Rsi signals using ForexConnect API at <a href="https://apiwiki.fxcorporate.com/api/StrategyRealCaseStudy/ForexConnectAPI/RsiSignals_via_ForexConnectAPI.zip">here</a>.
2. Learn how to build and backtest CCI Oscillator strategy using ForexConnect API at <a href="https://apiwiki.fxcorporate.com/api/StrategyRealCaseStudy/ForexConnectAPI/2.1.CCI_via_FC_API.zip">here</a>.
3. Learn how to build and backtest Breakout strategy using ForexConnect API at <a href="https://apiwiki.fxcorporate.com/api/StrategyRealCaseStudy/ForexConnectAPI/3.1.BreakoutStrategy_via_FC_API.zip">here</a>.
4. Learn how to build and backtest Range Stochastic Strategy using ForexConnect API at <a href="https://apiwiki.fxcorporate.com/api/StrategyRealCaseStudy/ForexConnectAPI/4.1.StochasticStrategy_via.FC.API.zip">here</a>.
5. Learn how to build and backtest Mean Reversion Strategy using ForexConnect API at <a href="https://apiwiki.fxcorporate.com/api/StrategyRealCaseStudy/ForexConnectAPI/5.1.MeanReverionStrategy_via_FC_API.zip">here</a>.
6. Some examples like attached stop limit to position, create if-then ELS order, get rollover <a href="https://apiwiki.fxcorporate.com/api/StrategyRealCaseStudy/ForexConnectAPI/FC-examples-master.zip">at here</a>.
7. ForexConnect with Matlab, is coming....
8. Using ForexConnect downloading historical data <a href="https://apiwiki.fxcorporate.com/api/StrategyRealCaseStudy/ForexConnectAPI/FXCMHDD-master.zip">at here</a>.
## Note:
o This is for personal use and abides by our [EULA](https://www.fxcm.com//forms/eula/)
o For more information, you may contact us: api@fxcm.com
## Release Note:
Our price streams are moving from http to https using TLSv1.2 since 6/16/2019, to increase security on our price servers.
Please make sure client side software is compatible with TLSv1.2.
Clients use ForexConnect API, Java API will be affected.
The error you will get: ‘Can't connect to price server.’
if you have any questions, please reach out to api@fxcm.com.
### Due to security enhancement on our server side, http request by ForexConnect API users need switch to https.
End user need to upgrade their FC API package on their side.
First round release will target to demo environments this coming weekend. 5/1/2021
This release to demo target at 7/9/2021
### the above release to live will target in mid-end August/2021.
Please make sure you are ready.
Please send mail to api@fxcm.com if you have any questions.
please upgrade the latest version at
https://pypi.org/project/forexconnect/
https://fxcodebase.com/wiki/index.php/Download
### Performance improvment release
We did some performance improvement and released to Demo. It should transparent to API users.
However, you are welcome to test your current setting on Demo and contact api@fxcm.com if you experience any issues.
If everything goes well, we plan to release to Production by the end of next week. Dec 17 2022.
## Disclaimer:
Stratos Group is a holding company of Stratos Markets Limited, Stratos Europe Limited, Stratos Trading Pty. Limited, Stratos South Africa (Pty) Ltd, Stratos Global LLC and all affiliates of aforementioned firms, or other firms under the Stratos Group of companies (collectively "Stratos Group").
The Stratos Group is headquartered at 20 Gresham Street, 4th Floor, London EC2V 7JE, United Kingdom. Stratos Markets Limited is authorised and regulated in the UK by the Financial Conduct Authority. Registration number 217689. Registered in England and Wales with Companies House company number 04072877. Stratos Europe Limited (trading as "FXCM"), is a Cyprus Investment Firm ("CIF") registered with the Cyprus Department of Registrar of Companies (HE 405643) and authorised and regulated by the Cyprus Securities and Exchange Commission ("CySEC") under license number 392/20. Stratos Trading Pty. Limited (trading as "FXCM") (AFSL 309763, ABN 31 121 934 432) is regulated by the Australian Securities and Investments Commission. The information provided by FXCM is intended for residents of Australia and is not directed at any person in any country or jurisdiction where such distribution or use would be contrary to local law or regulation. Please read the full Terms and Conditions. Stratos South Africa (Pty) Ltd is an authorized Financial Services Provider and is regulated by the Financial Sector Conduct Authority under registration number 46534. Stratos Global LLC ("FXCM") is incorporated in St Vincent and the Grenadines with company registration No. 1776 LLC 2022 and is an operating subsidiary within the Stratos Group. FXCM is not required to hold any financial services license or authorization in St Vincent and the Grenadines to offer its products and services. Stratos Global Services, LLC is an operating subsidiary within the Stratos Group. Stratos Global Services, LLC is not regulated and not subject to regulatory oversight.
Stratos Markets Limited: CFDs are complex instruments and come with a high risk of losing money rapidly due to leverage. 67% of retail investor accounts lose money when trading CFDs with this provider. You should consider whether you understand how CFDs work and whether you can afford to take the high risk of losing your money.
Stratos Europe Limited: CFDs are complex instruments and come with a high risk of losing money rapidly due to leverage. 68% of retail investor accounts lose money when trading CFDs with this provider. You should consider whether you understand how CFDs work and whether you can afford to take the high risk of losing your money.
Stratos Trading Pty. Limited: Trading CFDs on margin and margin FX carries a high level of risk, and may not be suitable for all investors. Retail clients could sustain a total loss of the deposited funds, but wholesale clients could sustain losses in excess of deposits. Trading CFDs on margin and margin FX does not give you any entitlements or rights to the underlying instruments.
Stratos Global LLC: Our products are traded on leverage which means they carry a high level of risk and you could lose more than your deposits. These products are not suitable for all investors. Please ensure you fully understand the risks and carefully consider your financial situation and trading experience before trading. Seek independent advice if necessary.
Past Performance: Past Performance is not an indicator of future results.
gitextract_ylp2kdzk/ ├── AttachStopLimitToPosition.py ├── AvailableSymbols.md ├── ChangeOrder.py ├── CreateOCOOrder.py └── README.md
SYMBOL INDEX (25 symbols across 3 files)
FILE: AttachStopLimitToPosition.py
function parse_args (line 14) | def parse_args():
class OrdersMonitor (line 25) | class OrdersMonitor:
method __init__ (line 26) | def __init__(self):
method on_added_order (line 31) | def on_added_order(self, _, __, order_row):
method wait (line 37) | def wait(self, time, order_id):
method find_order (line 48) | def find_order(self, order_id):
method reset (line 54) | def reset(self):
function main (line 60) | def main():
FILE: ChangeOrder.py
function parse_args (line 14) | def parse_args():
class OrdersMonitor (line 25) | class OrdersMonitor:
method __init__ (line 26) | def __init__(self):
method on_added_order (line 31) | def on_added_order(self, _, __, order_row):
method wait (line 37) | def wait(self, time, order_id):
method find_order (line 48) | def find_order(self, order_id):
method reset (line 54) | def reset(self):
class Args (line 60) | class Args:
function main (line 76) | def main():
FILE: CreateOCOOrder.py
class OrdersMonitor (line 12) | class OrdersMonitor:
method __init__ (line 13) | def __init__(self):
method on_added_order (line 18) | def on_added_order(self, _, __, order_row):
method wait (line 24) | def wait(self, time, order_id):
method find_order (line 35) | def find_order(self, order_id):
method reset (line 41) | def reset(self):
class Args (line 46) | class Args:
function main (line 60) | def main():
Condensed preview — 5 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (28K chars).
[
{
"path": "AttachStopLimitToPosition.py",
"chars": 4782,
"preview": "# example code how to attach Stop or Limit to open position, each create_order_request() can attach one order, to attach"
},
{
"path": "AvailableSymbols.md",
"chars": 1437,
"preview": "#Symbols and timeframes available from FXCM\n\nBelow we have listed a small portion of most popular symbols and timeframes"
},
{
"path": "ChangeOrder.py",
"chars": 4286,
"preview": "# example code how to change order, it can be used for any waiting order, attached stop or limit\r\n#the AMOUNT field is o"
},
{
"path": "CreateOCOOrder.py",
"chars": 5893,
"preview": "import argparse\nfrom distutils.cmd import Command\nfrom time import sleep\nfrom threading import Event\nfrom tkinter import"
},
{
"path": "README.md",
"chars": 10366,
"preview": "# ForexConnectAPI\n\nThis SDK is designed to get trading data, trade, load price histories and subscribe for the most rece"
}
]
About this extraction
This page contains the full source code of the fxcm/ForexConnectAPI GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 5 files (26.1 KB), approximately 6.5k tokens, and a symbol index with 25 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.