Skip to main content

BFJ manager api for python user

Project description

SIGMATMPY

SIGMATMPY-library is an APIRequest driven trading and monitoring platform. Each functionality (trades, price etc.) is represented by it's own class covering all aspect of that functionality.

Getting Started

Installation

$ pip install sigmatmpy

Basic functions

import sigmatmpy

# initualize APIRequest token
username = 'username'
password = 'password'
API = sigmatmpy.API(username,password)

# open a live order
API.open_order('EURUSD', 1, 0.01, 1.18245, 3, 0, 0,'comment')

# open a pending order (limit and stop order)
API.open_order('EURUSD', 3, 0.01, 1.18245, 3, 0, 0,'comment')

# close a live order 
API.close_order(9999999, 0.01, 1.18245)

# delete a pending order 
API.close_order(9999999)

# get trades history by datetime 
API.trades_history_by_datetime('2021-07-04 000000', '2021-07-16 075150')

# get trades history by unixtime 
API.trades_history_by_unixtime(1625991769, 1626423769)

# get live trades
API.live_trades()

# get account information
API.account_info()

# get server time
API.server_time()

Price data

# initialize data streaming for XAUUSD
API.initialize_price_stream('XAUUSD')

# get current price
API.current_price('XAUUSD')

# get XAUUSD 5 min bar chart data
API.bar_chart('XAUUSD', 5)

# check appearance of new bar
API.check_new_bar('XAUUSD', 5)

Error Code

Constant Value Description ERR_NO_ERROR 0 No error returned. ERR_NO_RESULT 1 No error returned, but the result is unknown. ERR_COMMON_ERROR 2 Common error. ERR_INVALID_TRADE_PARAMETERS 3 Invalid trade parameters. ERR_SERVER_BUSY 4 Trade server is busy. ERR_OLD_VERSION 5 Old version of the client terminal. ERR_NO_CONNECTION 6 No connection with trade server. ERR_NOT_ENOUGH_RIGHTS 7 Not enough rights. ERR_TOO_FREQUENT_REQUESTS 8 Too frequent requests. ERR_MALFUNCTIONAL_TRADE 9 Malfunctional trade operation. ERR_ACCOUNT_DISABLED 64 Account disabled. ERR_INVALID_ACCOUNT 65 Invalid account. ERR_TRADE_TIMEOUT 128 Trade timeout. ERR_INVALID_PRICE 129 Invalid price. ERR_INVALID_STOPS 130 Invalid stops. ERR_INVALID_TRADE_VOLUME 131 Invalid trade volume. ERR_MARKET_CLOSED 132 Market is closed. ERR_TRADE_DISABLED 133 Trade is disabled. ERR_NOT_ENOUGH_MONEY 134 Not enough money. ERR_PRICE_CHANGED 135 Price changed. ERR_OFF_QUOTES 136 Off quotes. ERR_BROKER_BUSY 137 Broker is busy. ERR_REQUOTE 138 Requote. ERR_ORDER_LOCKED 139 Order is locked. ERR_LONG_POSITIONS_ONLY_ALLOWED 140 Long positions only allowed. ERR_TOO_MANY_REQUESTS 141 Too many requests. ERR_TRADE_MODIFY_DENIED 145 Modification denied because an order is too close to market. ERR_TRADE_CONTEXT_BUSY 146 Trade context is busy. ERR_TRADE_EXPIRATION_DENIED 147 Expirations are denied by broker. ERR_TRADE_TOO_MANY_ORDERS 148 The amount of opened and pending orders has reached the limit set by a broker.

Authors

  • SIGMATM - Initial work - [SIGMATM]

Please read contributors for more information.

License

Please read LICENSE.md for more detail.

Project details


Download files

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

Source Distribution

sigmatmpy-0.0.20.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

sigmatmpy-0.0.20-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file sigmatmpy-0.0.20.tar.gz.

File metadata

  • Download URL: sigmatmpy-0.0.20.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.6.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for sigmatmpy-0.0.20.tar.gz
Algorithm Hash digest
SHA256 7b8c32ad3b8440d4575666741131de7eb14af02d3052ec5bd174fb5dcbbed90f
MD5 dbe83e0062f06fdfa8f6da6c53d5b9b2
BLAKE2b-256 ac6210d577c4fcc5c85df787e70260ecfb18c169668eb8b5c8933413be9b67e0

See more details on using hashes here.

File details

Details for the file sigmatmpy-0.0.20-py3-none-any.whl.

File metadata

  • Download URL: sigmatmpy-0.0.20-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.6.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for sigmatmpy-0.0.20-py3-none-any.whl
Algorithm Hash digest
SHA256 a621fca48b8c9c6426257113d135ac33809e00170e668957df8e9d8be1d97487
MD5 516aea91cf2cac9e3132e266a2e48dbb
BLAKE2b-256 e9d5d1f92edb24cfa5161426ce2a2253cc0cc66bd4a3e2a526e06cdab7ab71ea

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page