Help Center

Get answers to common questions and learn how to use margin like a pro!

Can’t find what you’re looking for?
Click the intercom button in the bottom right of the page.

Frequently asked questions

My account

Getting up and running is quick and easy and we are here to guide you through the process.

Of course, you need an account at one of the exchanges we support. Then you can simply choose a license, create an API key pair on your exchange account and submit the first half of the secret from the pair to us (see "Getting Started" tutorial).

Once you have submitted your API key info, you need to download margin, choose the exchange you want to trade on and then input your full API key and secret to login.

Don’t worry, we connect directly to the exchange and the only communication with our web server is to make sure you are a paid up customer and to download the historical data.

Yes, if you would like to support us, please spread the word! We will pay you $600 if you bring us a Professional license and $52 for a Standard license customer. What's more with your coupon your referees can get a 10% discount when purchasing a margin license. Let us know if you want us to create a unique coupon for you!

Want to join? Email us at [email protected] with your interest to become an advertiser and then we will get you signed up!

We have no access to your funds! We only store one quarter (in hashed form) of a two part API key pair on our servers to ensure you are a paid up customer. Even in the very unlikely event that a hacker compromised our servers there is nothing they could do with that. As an extra precaution we also advise that you do not enable withdrawal permissions on your API key pair.

You can upgrade your license by logging into your account and clicking the upgrade button. Downgrading a license is not possible.

No! We don’t send orders through our servers; margin connects directly to your exchange account. That means we have no knowledge of your trading patterns

There are only a few of instances when we need communication between your copy of margin and our servers.

  1. Checking if you are on the correct payment plan
  2. Retrieving history data which is not available from the exchanges
  3. Checking whether there is an updated version of margin available

No problem! Just log into your account and go to the Manage Exchanges section. There you can delete the current API half secret you have registered with us and add a new one. Note that only 1 API half secret per exchange is allowed unless you are a Professional customer, in which case you can add up to 3 APIs per exchange.

It is important you setup a new API key/secret pair for margin. On most exchanges you can do this by going to the settings/security sections of their websites. Then you need to create a new API key/secret pair.
Let’s take a look at an example on Bittrex. After clicking the ‘Add New Key’ button and entering my 2FA code a new key is generated.

You should immediately save your secret as on many exchanges it is only shown once. We only need at least the first half of your secret so in this example the following would be enough


This needs to be added to your margin account here: Manage exchanges
Note that all options, except for withdrawal rights, should be checked.

To login at the exchange later please save the full key and the full secret.

On each exchange the procedure is basically the same, but don’t hesitate to get in touch with us if you need any assistance!

The most likely reason for this is that you haven’t registered your half secret with us (see here: “How do I set up my API keys?”) or that you registered your key instead of your secret. You should also make sure that you submitted the first half of your secret and not some other part.

Please also check if you are entering the full API key and the full secret at the login window as this is needed to authenticate at the exchange.

If you continue to get a “key not registered” error message, please contact [email protected] or click the intercom chat bubble and ask for help!

Software setup


  1. Download from (where will be something like 3.1.4)

  2. Extract the file with “Extract here” in the file manager.

  3. Optionally, move and/or rename the newly created folder to where you want margin to reside. A common choice is ~/opt/margin

  4. Go into the margin folder and run the file called “margin”. Before the first run, the icon will be a default icon and not the margin logo shown in the screenshot.

  5. Optionally, if you want to copy the .desktop file used to run margin to a different place, e. g. your desktop, or ~/.local/share/applications/ to be seen by your desktop environment, you'll have to change the last line to read something like


    Adapt for the location you actually put margin in.

Command Line

  1. Download margin-linux-x86-<version>.zip (where will be something like 3.1.4)
  2. In the directory the file is in, do: unzip margin-linux-x86-<version>.zip
  3. cd margin-linux
  4. ./

Yes, some VPSs run very minimal versions of Ubuntu that do not contain needed libraries for margin. If running margin on Ubuntu produces this

./ line 30: 2043 Aborted (core dumped) LD_LIBRARY_PATH=$DIR/lib:$LD_LIBRARY_PATH QT_PLUGIN_PATH=$DIR/plugins ./bin/margin.bin

Then please do the following:

sudo apt install libxcb-xkb-dev libxkbcommon-*

Then you should be good to go! Note, if you set up a fresh full version of Ubuntu, these libraries are included and this step is not needed.

Kraken used to recommend that you set a 10 second nonce window, meaning you need to enter 10000 as the value is in milliseconds. You can read more about this on Kraken's website:

margin supports Windows, macOS and Linux in the following flavours:

Windows 10 x64
macOS (every version from 10.12 Sierra onwards)
Ubuntu 18.04

Please note that while margin might run on other variants of these operating systems, officially we can only offer customer support on those listed above.

Yes, you can encrypt your stored API keys using margin. Just click on the small lock icon in the login screen and follow the instructions. Make sure to keep that password safe and not stored in plain text on your computer.

Yes you can and we recommend it! You can use Microsoft Remote Desktop to connect to your VPS or VPN instance (there are even iOS and Android apps) and check in on how margin is trading for you from your PC, phone or tablet. And what’s more, you won’t need to leave your laptop running 24/7.

A few things to remember.

1) Do not to run two instances of margin in parallel connecting to an exchange with the same API key pair.
2) Make sure to set your VPS instance to the same time as the PC/laptop on which you were running margin. Otherwise, your API keys might not work.
3) Make sure your API keys do not have withdrawals activated.
4) Use margin’s encryption tool in the login screen to encrypt your keys to give you further peace of mind.

If you have any questions, don’t hesitate to get in touch with us.

Note that data usage (if connecting to your VPS instance using a phone or tablet) is pretty high so take care depending on the data plan you have for the VPS.

If you don’t see any currency pairs in margin's login window, can you type the following URL for the exchange you want to connect to into your browser:


What is the outcome you get in your browser?

Did you have to get past a reCAPTCHA? If you did, then right now margin does not handle this. The exchange has put up an extra barrier to connecting to its API in your country/region. One way to get around it is to connect through a VPN/VPS.

Please get in touch with us if you continue to have issues by mailing: [email protected]

We recommend at least 4GB RAM, a Core 2 Duo processor and a HD display for Windows, macOS and Linux systems. It is possible to run margin on lower spec machines (2GB RAM with a 720p display) but this will restrict the number of pairs/bots that can reasonably be run.

Software handling

When logging into your account on Kraken you need to enter a Tier so that the software knows what API polling limits to set. You can ask Kraken support for your Tier, but in general the following is true:

Account type       Tier
Verified                2
Intermediate       3
Pro                       4

It is important to enter the correct Tier when logging in as otherwise over polling can occur which can render your API key pair invalid.

When running several exchanges with many currency pairs, the amount of network connections that are opened simultaneously by margin can become huge. Each connection internally requires margin to create a so called "file handle". However, the maximum number of simultaneously held file-handles by a single process is usually limited by the OS.
Depending on the exchange implementation, a single connection/handle for the whole exchange might be sufficient or, in the other extreme, several connections for each loaded currency pair are required. In addition, log-files that are written by margin and client-side databases also require a set of "free" file-handles.

To prevent margin from running into system limitations (that usually lead to a crash), margin will initially try to raise the limit to a "care-free" large amount:

  • On MacOS: 4096 (apparently depending on the hardware, different hard limits are defined but this value should work on all machines)
  • On Linux: 4096 (note that this seems to be a difficult to overcome limit)
  • On Windows: This issue doesn't seem to apply, the limit is not adapted at all

If increasing the limit to the desired value was not successful, margin will show a warning dialog to the user before the login window becomes visible.

More technically, the operating system usually defines two "max-open-file-handles" limits:

  • the soft limit describes the default value for each application -- the application can explicitly increase the soft limit if that is required, but only up to the hard limit (see next)
  • the hard limit is the absolute maximum of max-open-file-handles per application. Usually administrator permissions are required to alter this value

As an example, on a current standard MacOS system, the default soft-limit is set to 256, but the hard-limit is actually set to "unlimited", which means, applications can autonomously set their soft-limit to any number they desire. However, customizations or other OS versions might define other limits. On Ubuntu Linux, the default soft limit can be as low as 128 or 256 max open file-handles, which is why also here margin will automatically try to increase the soft limit at startup. On Linux increasing the hard limit beyond 4096 seems to be more difficult and thus we set the limit to this for now ..

Before startup, margin will try to raise the soft-limit to at least the desired value and it will show a warning dialog if this was not successful. Please note that you can increase the soft limit manually (through your OS settings) beyond the limits required by margin. margin won't decrease the current limit if it is higher than necessary.

If you get an error message, please try the following steps:

For MacOS

Unfortunately, different version of MacOS seem to have come up with different ways to set up these limits.
Here are some suggestions and howtos:

sudo sysctl -w kern.maxfilesperproc=20000 


sudo launchctl limit maxfiles 20000 20000


On Linux

sudo sysctl -w fs.file-max=20000

Perhaps, additional configuration steps are required and very important: some of these require you to restart the system

Please follow this link to run margin in Docker!

The EMA crossover bot can be started in one of three modes: buy, sell or any. In the 'buy' mode it will wait until a buy situation arises before triggering its first spot order. In 'any' mode it is ready to either buy or sell, whichever situation occurs first.

What triggers a buy?
A buy event is triggered when the short term EMA line crosses the long term EMA line from below.

What triggers a sell?
A sell event is triggered when the short term EMA line crosses the long term EMA line from above.

Important details
Please note that in default mode the EMA bot waits for a candle to fully form before calculating the current value of the two EMA lines. The actual value taken for each candle can be configured in the GUI, but the default is to take the closing value. This means that even though a crossover event may have occurred in a particular candle the bot will react one candle later. Reacting within a currently forming candle had the undesired effect of potentially multiple crossover events occurring. It is possible for the bot to react to a crossover event immediately, but we then advise that offsets are used (see Crossover fine tuning below).

It is also important to note that once the bot triggers a buy or sell event it places a spot order. This means that the resulting trade can be displaced from the crossover event due to having to overcome the spread and in cases where there is a shallow order book this can result in many partial order fills.

Crossover fine tuning
It is possible to add a buy or sell offset which provides more confidence that a crossover situation has occurred. These are visualised in the chart as separate lines ensuring you have a visual confirmation of their affect.

On the exchange’s website, your BTC might be in your “Main Account”, and not your “Trading Account”. To trade with margin, you need to move it to your Trading Account.

This could be a timestamp issue as Binance expects clients connecting to their API to be in sync (timewise) with their server. This might mean your system clock needs to be up-to-date. If you are on Windows, please follow these steps to get up and running :

  1. Right click on the time in the task bar and select “Adjust date/time”. In the window that appears, make sure “Set time automatically” is on.

  2. In the same window, click on “Additional date, time & regional settings”, then under “Date and Time” go to "Set the time and date”. In the “Internet Time” tab, click “Change settings...”, then make sure “Synchronize with an Internet time server” is selected and click “Update now”, then “OK”.

  3. Next, run services.msc via the Start menu, then right click on “Windows Time” in the list of services and select “Properties”. Make sure “Startup type” is set to “Automatic” and that the service is started right now. Click the “Start” button if the service status is “Stopped” right now.

  4. If all else fails, start a PowerShell as administrator and run the following lines:

    net stop w32time
    w32tm /unregister
    w32tm /register
    net start w32time
    w32tm /resync

If you continue to get the same error message or use a macOS, please contact [email protected] or click the Intercom chat bubble and ask for help!

Our Bollinger Band bot is inspired by the John Bollinger ( technical indicator of the same name. We have made setting it up super easy and intuitive.

The ‘Start with’ combo box (see figure) allows you to start the bot in three modes: buy, sell or any. Starting in any mode will activate both the buy and sell thresholds and is great if you are not sure which way the market will initially move.

Rather than placing limit orders like the static ping pong and mArgin maker bots, the Bollinger Band bot places spot orders. Once the bot triggers a spot order it will place it, which means you need to be prepared that the actual trade might not be at the price the order was triggered at.

How does an order get triggered? There are two bands, a sell band (solid red line) and a buy band (solid blue line), that can be configured. These are set relative to the Bollinger Bands. For an order to trigger, the opposite orderbook has to intersect the buy/sell band. For example, in the buy case, the top of sell orderbook has to touch the ‘Current buy threshold’. Note that in volatile markets this means that it can commonly occur that the orderbook rapidly retreats after triggering a spot order. This results in the spot order having to overcome the spread to get filled. On certain pairs this can be some percentage points off the trigger price.

In order to protect against unwanted losses it is possible to set a Min effective gain parameter. This can be set on both sides. In the figure the Minimum effective gain displaces the current buy threshold by more than 4% to ensure that the desired Minimum effective gain is achieved.

In the figure above, a minimum effective gain ensures that the bot does not buy back in too soon in a market that had trended upwards. Also note that the two sell trades (small yellow triangles) went through above the Bollinger Band sell threshold because of the Min effective gain setting.

Stop loss is also available on both sides. On the buy side a stop loss can be setup relative to the last buy the bot performed. This is visualised in the chart and the percentage can be manipulated by dragging the annotation up or down. Note that if stop loss is triggered, the bot will stop trading.

The mArgin maker bot is a dynamic bot that places limit orders.

There are a number of parameters you can set, some of which can be set directly in the chart. The ‘time window’ is set by dragging the long vertical blue line (see image below - it’s the thin blue line in the middle of the chart running from top to bottom) to determine what time period is desired. The vertical height of the time window is given by the lowest and highest priced trades that occurred during that time.

Inside this window the relative buy and sell margins can be set (dashed red horizontal lines). As the lowest and highest trade price will change over time, the vertical height of the window changes accordingly, which in turn means the buy and sell margin prices will change. As the market contracts, the prices become closer to each other. This also means that the initial Eff. gain* shown in the center of the time window will also change.

The Min. effective gain [%] is a very important parameter. For the mArgin maker it applies to both buy/sell and sell/buy cycles. It is always active, the default value being 0.0%. If you want to ensure that the bot makes a gain after trading fees have been subtracted, a positive value must be given. Note that this means a bot order can get stuck at a particular price in order not to violate the Min. effective gain.

The other parameters are quite self explanatory - especially if you hover over their tooltips.

Stop loss can be enabled and then adapted in the chart. If a stop-loss event occurs, the bot will accept the user-specified loss by triggering a spot sell order and then the bot stops.

The static ping pong bot places limit orders.

This is the simplest bot in margin. Click on the strategy button (chess knight with +) to create a new bot. Initially it will default to an effective gain of 0.1% around the spread. Click and drag the buy and sell price lines to set the prices you want. The bot waits until its order is fully filled before switching actions and then places a limit order on the opposite side. In the example below, the bot has just placed a limit buy order and is waiting for the order to become active. If this order gets filled, a limit sell order for the same amount will be placed on the opposite side. Here, we’ve specified an effective gain of just over 3%.

The bot will continue to trade until you explicitly stop it.

This occurs because you do not have enough funds to place even the minimum allowed order. For example for a BTC/USD market, if you see an invalid range in margin, it means in the ‘buy’ case that you do not have enough USD and in the ‘sell’ case enough BTC to place the minimum order possible.

Note that some bots require you to have a little more than the minimum in order to overcome trading fees and continue trading. That means that it is possible to have enough funds to place a manual trade but not start a bot in some cases.