Jimmy-sha256 / SimpleFX_REST_API

This is a python wrapper to connect to SimpleFX's REST API
2 stars 0 forks source link
api-wrapper python3 rest-api simplefx

SimpleFX REST API

This is a python wrapper to connect to SimpleFX's REST API

Table of Contents

  1. Installation
  2. Credentials
  3. List Instruments
  4. Symbol Infomation
  5. Accounts Overview
  6. Account Status
  7. Market Order
  8. Pending Order
  9. Adjust Pending Order
  10. Adjust Take Profit Order
  11. Adjust Stop Loss Order
  12. Delete Pending Order
  13. Close Position
  14. Get Positions / Pending Orders

1. Installation Ubuntu

mkdir SimpleFX && cd SimpleFX

git clone https://github.com/Jimmy-sha256/SimpleFX_REST_API.git 

2. Credentials

Add your SimpleFX api access key and access secret to the credentials.py file:

Add either 'DEMO' or 'LIVE' to the credentials.py file

3. List Instrumnets

Get a list of available instrumnets

client.list_instrumets()

4. Symbol Information

client.symbol_info('symbol')
Paramaters Type Description
symbol string 'BTCUSD' , 'DJI30'

5. Account Overview

Retrieve status of all accounts

client.accounts_overview()

6. Account Status

Retrieve account status

client.account_status()

7. Market Order

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

8. Pending Order

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

9. Adjust Pending Order

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

10. Adjust Take Profit

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

11. Adjust Stop Loss

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

12. Delete Pending Order

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

13. Close Position

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

14. Get Postions / Pending Orders

client.get_postions()