This is a python wrapper to connect to SimpleFX's REST API
- Installation
- Credentials
- List Instruments
- Symbol Infomation
- Accounts Overview
- Account Status
- Market Order
- Pending Order
- Adjust Pending Order
- Adjust Take Profit Order
- Adjust Stop Loss Order
- Delete Pending Order
- Close Position
- Get Positions / Pending Orders
mkdir SimpleFX && cd SimpleFX
git clone https://github.com/Jimmy-sha256/SimpleFX_REST_API.git Add your SimpleFX api access key and access secret to the credentials.py file:
Add either 'DEMO' or 'LIVE' to the credentials.py file
Get a list of available instrumnets
client.list_instrumets()
client.symbol_info('symbol')| Paramaters | Type | Description |
|---|---|---|
| symbol | string | 'BTCUSD' , 'DJI30' |

Retrieve status of all accounts
client.accounts_overview()
Retrieve account status
client.account_status()
client.market_order('symbol', 'side', vol, tp, sl)| Paramaters | Type | Description |
|---|---|---|
symbol |
string |
BTCUSD , DJI30 |
side |
string |
BUY, SELL |
vol |
int |
number of units to purchase |
tp |
int |
take profit price |
sl |
int |
stop loss price |

client.pending_order('symbol', 'side', price, vol, tp, sl)| Paramaters | Type | Description |
|---|---|---|
symbol |
string |
BTCUSD , DJI30 |
side |
string |
BUY, SELL |
price |
int |
price to purchase units |
vol |
int |
number of units to purchase |
tp |
int |
take profit price |
sl |
int |
stop loss price |

client.adjust_order(order_id, price, vol, tp, sl)| Paramaters | Type | Description |
|---|---|---|
order_id |
int |
order id number |
price |
int |
price to purchase units |
vol |
int |
number of units to purchase |
tp |
int |
take profit price |
sl |
int |
stop loss price |

Add or adjust the take profit order of an open position.
client.adjust_tp(order_id, tp)| Paramaters | Type | Description |
|---|---|---|
order_id |
int |
order id number |
tp |
int |
take profit price |

Add or adjust the stop loss order of an open postion.
client.adjust_sl(order_id, sl)| Paramaters | Type | Description |
|---|---|---|
order_id |
int |
order id number |
sl |
int |
stop losstake price |

client.delete_order(order_id)| Paramaters | Type | Description |
|---|---|---|
order_id |
int |
order id number |

Close a partial or full position
client.close_position(order_id, vol)| Paramaters | Type | Description |
|---|---|---|
order_id |
int |
order id number |
vol |
int |
number of units to close |

client.get_postions()
