πŸ“‹Command line

The cli is designed for fast trading, enabling users to create tailored commands for various trading scenarios.

Command line button

This guide introduces the syntax and offers quickstart examples on how to use the CLI.

Command Syntax

Commands in Tree Terminal follow a structured format. Understanding mandatory vs. optional variables is crucial for effective use.

Mandatory Variables:

  1. {coin}:

    • Required for all commands.

    • Specifies the coin symbol (e.g., BTC, ETH).

    • ⚠️ all is a reserved keyword in Tree Terminal. If you wish to trade ALLUSDT (on Binance), please use allusdt instead of all

Optional Variables:

  1. {size}:

    • Specifies the position size.

    • Defaults to the first size in your trading configuration if omitted.

    • Shorthand:

      • 1k = $1,000

      • 1m = $1,000,000

  2. {account}:

    • Refers to the subaccount or trading account.

    • If omitted, the default account is used.

  3. {price}:

    • Limit price for the trade (e.g., p_41500 for $41,500).

    • Omit for market orders.

  4. {timeInForce}:

    • Specifies order duration:

      • GTC: Good Till Canceled.

      • IOC: Immediate or Cancel.

  5. {slippage}:

    • Sets acceptable price deviation.

    • Example: slippage=0.5%.

  6. {percent}:

    • Contextual variable used for percentage-based actions, such as:

      • Closing: Closing 50% of a position.

      • Creating Limit Orders: Setting a limit price based on a percentage deviation from the market price.

  7. {last}:

    • Refers to the first coin from the most recent notification.

    • Example: l {last} 10k executes a long position for the coin from the latest notification

  8. {size1}, {size2}, {size3}:

    • Correspond to predefined trading sizes in your configuration.

    • Example: l btc {size2} uses the second trading size from your setup.

Examples

Basic Commands:

  1. Long:

    • Long BTC with $10,000.

  2. Short:

    • Short ETH with $5,000 on Binance.

  3. Close:

    • Close 50% of BTC position across all accounts.

  4. Limit Order:

    • Place a limit order to long BTC at $62,000.

  5. Limit Order:

    • Place a limit order to long BTC 1% below current price


Scale Orders

Command Syntax

Splits your full intended position into {count} individual limit orders, each spaced {spacing}% apart. The first order is placed at the specified p_{price}

Examples

  • Long BTC in 5 tranches (using your default size), 2% apart, from 80k and below.

  • Click Shortcut: Assign a hotkey (e.g. Ctrl+Shift+S) to run

    which will place 5 staggered buy orders 2% apart from each other for the coin from the mouse's y-axis current price, for total of 200k size.

example of click shortcut

TWAP Features

TWAP (Time-Weighted Average Price) splits orders into smaller intervals for better execution.

Syntax:

Modifiers:

  • <70000: Execute trades only below $70,000.

  • max_200k: Stop once the position reaches $200,000.

  • until_{time_in_minutes}: Set time constraints.

  • maker : twap using only limit orders

if no {account name} is specified, the first account will be used

Examples:

  1. Long BTC in intervals:

    • Long BTC with $1,000 every 20 seconds.

  2. Short ETH with a cap:

  3. Time-limited TWAP:

    • Long $1,000 of BTC every 20 seconds for 30 minutes.

  4. Using TWAP to close a position:

    • Close btc position on {account name} via 1% of position size orders and default twap interval

    • ⚠️⚠️⚠️ Because this has no {account name} it will close btc position on all subaccounts via 1% of position size orders and default twap interval

  5. Using TWAP to close all positions:

    • Close all positions via 1% of position size orders and default twap interval

How to cancel:

There are two ways:

  1. Go to "open orders" and you will see your twap there. Click on the cancel button to stop the twap.

  2. Type cancel <ticker> , but do note this will cancel all outstanding limit / stop loss orders for the ticker as well.


Custom Commands

Custom commands build on the syntax and examples above, allowing users to simplify repetitive trading actions.

Adding Custom Commands:

Go to the "Shortcuts" field in General Settings and add commands.

Supported Variables:

  • {coin}, {size}, {timeInForce}, {account}, {cmd}, {slippage}, {percent}, {last}, {size(n)}.

Use Cases:

  1. Rename commands for better readability.

  2. Split orders across accounts for simultaneous entries.

  3. Define commands for specific time-in-force options (e.g., GTC vs. IOC).


Telegram Integration

These commands can also be used with Telegram and Discord bots by enabling them in the Trading field found in the general settings.

"account" command is unique to telegram and discord bot and will return your account balances and positions. Try it!

These commands are specifically designed for users accessing Tree Terminal remotely via Telegram or Discord. They allow quick management of positions, balances, and orders.

1. Accounts

  • Command:

  • Displays all current positions and account balances across connected accounts.


2. Cancel <ticker>

  • Command:

  • Cancels all active TWAPs and pending orders associated with the specified ticker.

  • Example:

    • Stops all TWAPs and cancels all orders for BTC.


3. Orders

  • Command:

  • Lists all active orders currently placed across your accounts.

  • Caution: Be mindful when using this command if you have many scale orders set, as it may produce a large amount of output and cause spam in Telegram or Discord.


Key Notes and Best Practices

  1. Defaults:

    • {size} defaults to the first size in your trading configuration.

    • {account} defaults to the main account if unspecified.

  2. Testing:

    • Test all commands in a safe environment with small sizes.

Advanced Features

  1. Tracking Twitter Accounts:

    • Add or remove Twitter accounts to monitor using simple commands:

      • Add Account:

        Example: add elonmusk will start tracking Elon Musk’s tweets.

      • Delete Account:

        Example: del elonmusk will stop tracking Elon Musk’s tweets.

      • Add Account with extra tracking

        Example: add elonmusk all will start tracking Elon Musk’s tweets, retweets, follows, replies, bio and picture changes.

  2. Tracking Specific Tweets:

    • Track specific tweets for potential deletions:

      Example: !track https://twitter.com/elonmusk/status/123456789 will notify you if that tweet is deleted.

  3. Shortening Keywords for Commands

    1. Custom Aliases:

      • You can map commands to shorter keywords for faster execution.

        • Instead of typing account, simply use pos to view all your balances and positions on Tree Terminal.

    2. Why Use Aliases?

      • Save time and effort during fast-paced trading.

      • Simplify repetitive actions with intuitive shortcuts

  4. Shortcuts for Closing TWAPs:

    • Example: cwap btc binance will execute c btc 1% twap binance, closing 1% of your BTC position per interval on the Binance account.

  5. Left click entry last headline on size4:

    • Pressing ctrl+left will long the coin from the last notification with the fourth trading size.

  6. Wait command

    • Wait allows you to pause before a command or between two commands.

    • Unit is always in ms, so 500ms would be 0.5s

  7. SL command

    • sl 25% of the btc position 2% below current price.

Last updated