Our plans and pricing are changing on 1st November. Learn more...

Automated Trading Exchange Settings

exchangeSettings()

Allows exchange specific settings to be set.

This command allows you to change settings on individual exchanges.

The arguments vary from exchange to exchange.

At present, BitMEX, Binance Futures & Bybit are the only exchanges that exposes any settings. Using this command on any other exchange will have no effect.

Supported Settings for BitMEX, Binance Futures, FTX & Bybit

Setting Available values
maxOrderSize=100 Set the max size of any single order. Mainly intended for use in Trading Groups to control liquidity.
leverage=cross Enables Cross Margin.
leverage=20 A number from 0.01 to 100. Enabled Isolated Margin and sets the leverage value to the number given. Leverage values not supported by the symbol you are trading will be rejected. It's important that this can affect any open positions you have at the time also. Note: This does not change the way order sizes are calculated (details here).

Quirks

There are a couple of quirks with the different exchanges that you should be aware of...

FTX

FTX has details of their account leverage options in this help guide. A few things to note though:-

  • Only the following leverage settings can be used: 1, 3, 5, 10, 20, 50, 100, 101.
  • Setting leverage will set the leverage account wide (not just for the traded symbol).
  • It can not be changed if you have an open position.
  • 50x and higher attract higher fees.

Binance

Binance allows you to set the leverage for either cross or isolated margin. The exchangeSettings command does not fully support this and can either set the isolated margin level (using leverage=20 for example, to set it to 20x) or set it to cross, but not cross at a specific leverage. This is a limitation of commands properties as most exchange treat cross as trading at max leverage.

Example: Change the current leverage to 20x on BitMEX

myApiKeys(XBTUSD) {
    # Change the Leverage to 20x before we start placing orders
    exchangeSettings(leverage=20);

    # Place an order. As leverage will now be 20x
    # this will only use a small amount of available margin
    # (about $5 worth)
    market(side=buy, amount=100);
}

Example: Set the max order size to 5000 contracts

myApiKeys(BTCUSD) {
    # Limit the max order size to 5000 contracts
    exchangeSettings(maxOrderSize=5000);

    # Place an order. Will use 75% of balance, or 5000 contracts,
    # whichever is smaller
    market(side=buy, amount=75%);
}

Some images from Unsplash

About Alertatron.com

Your TradingView alerts, with charts, PM'd to you.

Get all your alerts from TradingView, sent to Telegram, Discord, Slack, Email or webhooks, with a chart snapshot attached.

Capture Charts

See a high quality chart with every alert, captured at the moment the alert was triggered. See exactly what the market was doing and make informed decisions.

Automate Trading

Trigger orders on popular cryptocurrency exchanges and trade 24/7. Access powerful algorithmic orders to maximise your profits.

Integrations

Connect your alerts to Telegram (channels, groups and private chats), Discord, Slack, email or send push notifications to other services with webhooks.

Easy To Setup

Nothing to install and no browser extensions. Captures alerts 24/7, even with your computer switched off. Be up and running in seconds.