Skip to Content
Getting StartedStarting to Trade

Starting to Trade

So, you’ve finally developed a strategy, backtested it to ensure that it’s profitable, and perhaps even optimized it, and now it’s time to start trading said strategy.

Choosing an Exchange

Naxbot makes use of the CCXT library under the hood, and as such supports many dozens of exchanges on a technical level out of the box. However, not all exchanges are supported equally well. For example, some exchanges might not support certain timeframes, while others may not allow you to view as much historical data as other exchanges.

A good way to find out how well your exchange is supported is by going to the “Chart” tab in Naxbot, picking your desired exchange and market, and seeing how much (if any) data is available for you to view.

Here’s an example of an error message you might get from Coinbase when attempting to fetch any market in the 4h timeframe, which is not supported by Coinbase:

Failed to get coin pair: Failed to get klines for BTC/USDT on coinbase Caused by: 0: Other error 1: Failed to get klines 2: Error during promise execution: ExchangeError: coinbase {"error":"unknown","error_details":"parsing field \"granularity\": \"4h\" is not a valid value","message":"parsing field \"granularity\": \"4h\" is not a valid value"} at coinbase.handleErrors (file:///data/modules/ccxt/ccxt/src/coinbase.js:5033:19) at file:///data/modules/ccxt/ccxt/src/base/Exchange.js:699:51 at eventLoopTick (ext:core/01_core.js:175:7) at async coinbase.fetch2 (file:///data/modules/ccxt/ccxt/src/base/Exchange.js:4213:24) at async coinbase.request (file:///data/modules/ccxt/ccxt/src/base/Exchange.js:4235:16) at async coinbase.fetchOHLCV (file:///data/modules/ccxt/ccxt/src/coinbase.js:3743:24) at async timeoutCall (file:///data/modules/ccxt/index.ts:4:11) at async Module.fetchOHLCV (file:///data/modules/ccxt/index.ts:47:17)
💡
Tip

Naxbot stores historical kline data locally on your disk. When starting to trade new markets, especially those on lower timeframes, it is a good idea to make Naxbot “pre-fetch” those markets by looking at them in your chart. This will ensure that the bulk of the data is already fetched once your strategy starts trading, which will dramatically reduce the initial workload Naxbot has to perform upon activating your strategy.

Create Your API Key

If you’re planning to have Naxbot trade for you on an exchange, you’ll need an API key. API keys allow programs like Naxbot to interact with a cryptocurrency exchange on your behalf. The exact location of where you can create on differs from exchange to exchange, but is usually somewhere within your account settings. Some exchanges might put it it in a category named something like “developer settings”, or similar.

Once you’ve located it go ahead and create your API key. You will be presented with two keys: Your API key, and your secret key. Your API key is transmitted to the exchange for every request, which the exchange uses to map the request to your account. Your secret key is used to sign the request, in order to prove that it was really sent by you. While the exchange knows your API key, and it is safe for you to share it with others, your secret key should only be known by you. In fact, not even the exchange knows your secret key, since they only display it to you after it’s been generated, and do not store it anywhere afterwards. This is also why they cannot give you your secret key again if you happen to lose it.

💡
Tip

Most exchanges allow you to specify the API key’s permissions on a granular level. Naxbot only needs enough permission to be able to get market data, as well as to create and cancel orders. It does not need permission to see your account balance, make withdrawals, adjust leverage, etc. so if you want to follow best security practices, create an API key that only has the minimum permissions required for Naxbot to function properly.

Finally, put your API and secret key into your config.toml under the exchange they were generated for, and Naxbot will be able to enter trades for you.

Test Your Strategy

Even if you’ve successfully backtested your strategy, it’s still a good idea to start trading with a fairly low trading capital at first, just to ensure everything has been configured correctly and is running the way it is supposed to.

Note

Take care not to set your temporary trading capital too low, as most exchanges have minimum order sizes which can easily be undershot when hastily changing trading capital.

Start Trading!

Once you’ve ensured your strategy is working as intended, all that’s left to do is adjust the trading capital to your needs and let it fire away! While a strategy is trading, there are a few things to keep in mind:

  • If you deactivate a strategy, it will stop processing exit conditions for your trades. However, limit orders will remain open, and active trades will still be closed if their stop loss is hit.
  • If you change the risk percentage after a strategy has started trading, historical trade profit statistics will become invalidated, since they’ll use the new risk percentage to calculate profits. As such, it is better to create a new strategy instead, and leave the old strategy alone, as an “archived” strategy.