Searchโ€ฆ
Tradologics CLI
Meet tctl - Tradologics' command-line utility
For those who live inside the terminal, we made available a command-line tool named tctl (stands for Tradologics Controller), which simplifies your development workflow by allowing you to communicate with the Tradologics cloud.
While tctl is yet another way of working with Tradologics - it's important to note that it does not perform anything that you cannot do by using the web console or "vanilla" API calls, as they are all merely clients for our API.

Installation

To use tctl you'll need to have Python 3.6 (and pip) installed on your system. Once you have both on your system, simply execute the following command in your terminal of choice:
$ pip3 install -U tctl
Next, run tctl config to set up your tctl to work in conjunction with your account by providing your account's API key and Secret key.
If you're using Windows, you'll need to launch the Command Prompt with admin privileges in order to configure tctl. Once configured, you can use the Command Prompt as usual.
$ tctl config
โ€‹
-----------------------------------------------------
_______ _ _ _
|__ __| | | | | (_)
| |_ __ __ _ __| | ___ | | ___ __ _ _ ___ ___
| | '__/ _` |/ _` |/ _ \| |/ _ \ / _` | |/ __/ __|
| | | | (_| | (_| | (_) | | (_) | (_| | | (__\__ \
|_|_| \__,_|\__,_|\___/|_|\___/ \__, |_|\___|___/
__/ |
T R A D I N G C L O U D |___/
โ€‹
-----------------------------------------------------
tctl 0.0.45 - Tradologics Controller
-----------------------------------------------------
โ€‹
HELLO ๐Ÿ‘‹
โ€‹
tctl (Tradologics' Controller) helps you access
and control various aspects of your account.
โ€‹
To get started, make sure you have your API Key
and Secret Key handy in order to configure tctl.
โ€‹
Let's get started...
โ€‹
-----------------------------------------------------
โ€‹
[?] API Key : *****************
[?] API Secret : *************************************
โ€‹
...
โ€‹
SUCCESS ๐ŸŽ‰
โ€‹
`tctl` is now configured!

Getting around

Most of tctl commands are structured in the following format:
$ tctl COMMAND ACTION --OPTIONS|-O
To view available commands, simply type tctl :
$ tctl
โ€‹
Usage: tctl COMMAND ACTION [ARGS]...
โ€‹
Options:
--help Show this message and exit.
โ€‹
Commands:
assets List assets with misc.
brokers Access exchange and calendar information
config Initialize, authorize, and configure the tctl tool
connections List, create, update, or delete connections
exchanges Access exchange and calendar information
instances List, retrieve, modify, delete, create research instances
logo Displays Tradologics logo as ASCII art :)
me Get customer information, usage and billing
monitors List, create, update, or delete monitors
orders List, create, update, or cancel orders
positions Retreive position history with filtering options
price Retreive asset's price-related information
rates Retreive currency exchange rates
sandbox Send Tradehooks to a URL for development testing
strategies List, create, update, delete, deploy, start/stop strategies
tokens List, create, extend, or delete tokens
tradehooks List, create, update, or delete Tradehooks
trades Retreive trade history with filtering options
upgrade Upgrade tctl to the latest version
volumes List, retrieve, modify, delete, create research volumes
To view available actions for a specific command, type:
$ tctl COMMAND
For example:
$ tctl connections
Usage: tctl connections ACTION [OPTIONS]...
โ€‹
Available actions:
โ€‹
- list|ls Retreive connections list
- info Show connection information: --connection|-c {CONNECTION_ID}
- new Create new connection
- update|patch Update existing connection: --connection|-c {CONNECTION_ID}
- delete|rm Delete connection: --connection|-c {CONNECTION_ID}

Conventions

  • The pipe character (|) means "or" โ€“ For example, the snippet: list|ls translates into "you can use either list or ls", and for this additional snippet: --connection|-c, this translates into "you can use either--connection CONNECTION_ID or -aCONNECTION_ID``". Simply put, the pipe character (|) represents the "or" in a given statement.
  • Params with required input are marked with curly brackets (i.e. --connection|-a {CONNECTION_ID}). Otherwise, they are just flags (i.e. --show-ids in tctl tradehooks ls).
  • Params wrapped by [] are optional (i.e. [--start {YYYY-MM-DD}]).
TIP: Appending --raw to any command will display the API's response in raw JSON format. Otherwise, tabular data will be displayed.

Common identifiers

  • --connection|-c connection-id
  • --asset|-a asset identifier (link)
  • --order|-o order-id
  • --broker|-b broker-id
  • --tradehook|-t tradehook-id
  • --strategy|-s strategy-id
  • --monitor|-m monitor-id
  • --exchange|-e exchange-mic
  • --version|-v strategy's version-id

Common filters

  • --start {DATE|DATE-TIME} - Filter results to show from this day or this date-time onwards.
  • --end {DATE|DATE-TIME} - Filter results to show until this day or this date-time.
  • -- strategies {STRATEGY_ID,STRATEGY_ID,...} - Filter results to include positions/orders/trades from these strategies only.
  • --connections {CONNECTION_ID,CONNECTION_ID,...} - Filter results to include positions/orders/trades from these connections only.
  • --brokers {BROKER_ID,BROKER_ID,...} - Filter results to include positions/orders/trades from these brokers only.

Common flags

  • --decode - Instructs tctl to decode the data returned (i.e. for tokens and strategy codes).
  • --show-ids - Shows object ids (some objects with very long ids aren't displayed by default for readability).
  • --history - Retrieves an asset's history and indicates whether that asset has had a past name/ticker/exchange changes (for tctl assets info --asset {ASSET}).
  • --delisted - Include delisted assets in the results.
  • --unadjusted - Return/use unadjusted prices (back-adjusted prices are returned by default).
  • --raw - Display the API's response in raw JSON format. Otherwise, tabular data will be displayed.
Last modified 4mo ago
Copy link
On this page
Installation
Getting around
Conventions
Common identifiers
Common filters
Common flags