Help Center

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

Can't find what you're looking for?
Contact us

General Info

Getting up and running is quick and easy and we are here to guide you through the process. You can simply download the terminal and install it on your computer. You can log in to any supported exchange using the demo-mode, which allow you to paper-trade. In order to connect to a real exchange account, you must first create an account on the exchange website. Once you have an account (and passed all possibly required KYC steps), you must create an API key set. Such a key set usually consists of a public and a secret key, however, sometimes additional fields such as a key name or an extra password are required. These fields can then be used in margin's login-mask to connect to your real exchange account.
For an extra piece of mind, we strongly recommend to disable withdrawal permissions on the keys that you use with margin.
Please also view our Getting Started tutorial for more info.
Don't worry, your locally installed instance of the terminal connects directly to the exchange and non of your account related data or keys is shared with our servers. The only communication with our server is to check for possible updates and to download the historical data.
Members of our team have been impersonated in order to scam people. Please be aware that teammates of margin will never DM you first. It is also important to compare the actual username of the person you are speaking with you vs the admin username in the official margin Telegram group. They should always match.
As a rule we don't ask for you to ever send any crypto-payments to a wallet. support@margin.de
Please stay vigilant and do not become a victim of a scam!
We have no access to your funds as none of your account-related information is sent to any of our servers. As an extra precaution we also strongly advise that you do not enable withdrawal permissions on the API keys that you use with margin.
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 whether there is an updated version of margin available
  2. Retrieving history data which is not available from the exchanges
  3. Retrieving crypto-price information from our API needed for some features inside the terminal
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 or something similar. 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. 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!
Please do not try to use an API key-pair that was previously used in another context as this can lead to all kinds of complications.

Software setup

Simply download the .AppImage binary and run it either by clicking on it on a graphical Desktop or by starting it from command line.
Starting with version 4.6.2 of the margin terminal, we will not be signing our Windows binaries anymore. This can cause Windows to show warning messages to users trying to install new versions of the terminal. If you do receive a warning message, click on "More Info", check that the "margin-windows" .exe is running and allow it to "Run Anyway".
Running Margin on a cloud-based VPS such as AWS, Azure or DigitalOcean allows you as a trader to run your strategies uninterrupted. It is definitely possible to do this, but since the concrete steps required to set up a VPS node with a window manager change from time to time, we don't provide a full how-to for this.

Here are some general suggestions

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.

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

Note that data usage (if connecting graphically 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.
No, if your laptop goes to sleep the bots will stop working. Amphetamine, NoSleep, and Caffeine are popular apps to stop your machine from going into sleep mode. Otherwise, you can use a VPS. See our other help article: "Setting up a Linux VPS to run Margin".
This error is related to the XCB-Platform plugin of the underlying Qt library. It can be fixed by manually installing all xcb-related packages:
sudo apt install libx11-xcb-dev libx11-xcb1 libxcb-dri2-0 libxcb-dri2-0-dev libxcb-dri3-0 libxcb-dri3-dev libxcb-glx0 libxcb-glx0-dev libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-present-dev libxcb-present0 libxcb-randr0 libxcb-randr0-dev libxcb-render-util0 libxcb-render0 libxcb-render0-dev libxcb-res0 libxcb-shape0 libxcb-shape0-dev libxcb-shm0 libxcb-sync-dev libxcb-sync1 libxcb-util1 libxcb-xfixes0 libxcb-xfixes0-dev libxcb-xinerama0 libxcb-xkb1 libxcb-xtest0 libxcb-xv0 libxcb1 libxcb1-dev
On Ubuntu 20.04, this is:
sudo apt install libx11-xcb1 libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-present0 libxcb-randr0 libxcb-render-util0 libxcb-render0 libxcb-res0 libxcb-shape0 libxcb-shm0 libxcb-sync1 libxcb-util1 libxcb-xfixes0 libxcb-xkb1 libxcb-xv0 libxcb1
If this does not suffice, you can export the following environment variable before starting margin, that should provide additional help to find out which additional libraries/packages are missing.
QT_DEBUG_PLUGINS=1 ./run-margin.sh
Yes, some VPSs run very minimal versions of Ubuntu that do not contain needed libraries for margin. If running margin on Ubuntu produces this
./run-margin.sh: 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.
Yes, you can! Please follow this link to run margin in Docker!
margin supports Windows, macOS and Linux in the following flavours:

Windows 10/11 x64
MacOS (every version from 10.14 onwards)
Ubuntu 20.04+ (64Bit)

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.
If you don't see any currency pairs in margin's login window, you should first look at the exchange website to see if either the whole exchange or the exchange API is currently in maintenance mode or not reachable.
If this did work before, the exchange might have put up some 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: Our support
We recommend at least 4GB RAM, a Dual-core 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.
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
( http://krypted.com/mac-os-x/maximum-files-in-mac-os-x/ )
sudo launchctl limit maxfiles 20000 20000
( https://stackoverflow.com/questions/5377450/maximum-number-of-open-filehandles-per-process-on-osx-and-how-to-increase )

On Linux

Perhaps, additional configuration steps are required and very important: some of these require you to restart the system [...]
sudo sysctl -w fs.file-max=20000
( https://www.cyberciti.biz/faq/linux-increase-the-maximum-number-of-open-files/ )

Exchange related

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:
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 typeTier
Verified2
Intermediate3
Pro4
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.
On some exchanges, you must internally transfer your funds from a "Wallet Account" to a trading account to make them appear through the API that margin uses to connect to the exchange. This allows you to only endow your bots with a limited set of your funds.
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.
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 support@margin.de.

Using the Terminal

No, at this time we only support manual trading on our futures exchanges.
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.
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).
Our Bollinger Band bot is inspired by the John Bollinger (https://www.investopedia.com/terms/b/bollingerbands.asp) 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.