Skip to content
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.

Configuration

Steven Thewissen edited this page Apr 19, 2018 · 21 revisions

There are a few settings you can configure to alter the behavior of the bot. These settings are stored in the configuration files in the various runtime projects. A sample of the configuration file for the Azure Functions runtime can be found below.

{
  "IsEncrypted": false,
  "Values": {
    "AzureWebJobsStorage": "",
    "AzureWebJobsDashboard": "",

    "BindingRedirects": "[ { \"ShortName\": \"Newtonsoft.Json\", \"RedirectToVersion\": \"11.0.0.0\", \"PublicKeyToken\": \"30ad4fe6b2a6aeed\" } ]",

    "Exchange": "Binance",
    "ApiKey": "KeyValue",
    "ApiSecret": "SecretValue",
    "PassPhrase": "PassPhrase",

    "AzureTableStorageConnectionString": "",
    "SqlServerConnectionString": "",
    "SqliteConnectionString": "",

    "TelegramBotToken": "",
    "TelegramChatId": "",
    "DiscordWebhookId": "",
    "DiscordWebhookToken": "",
    "SlackWebhookUrl": "",

    "MaxNumberOfConcurrentTrades": 2,
    "AmountOfBtcToInvestPerTrader": 0.01,
    "TransactionFeePercentage": 0.0025,
    "StopLossPercentage": -0.07,
    "ImmediatelyPlaceSellOrder": false,
    "ImmediatelyPlaceSellOrderAtProfit": 0.02,
    "EnableTrailingStop": true,
    "TrailingStopStartingPercentage": 0.02,
    "TrailingStopPercentage": 0.05,
    "CancelUnboughtOrdersEachCycle": true,
    "PlaceFirstStopAtSignalCandleLow": false,
    "MinimumAmountOfVolume": 300,
    "BuyInPriceStrategy": "SignalCandleClose",
    "AskLastBalance": 0.2,
    "BuyInPricePercentage": 0.005,
    "ProfitStrategy":"Reinvest",
    "ReturnOnInvestment": "[{\"Duration\":300,\"Profit\":0.05},{\"Duration\":600,\"Profit\":0.02}]",
    "QuoteCurrencies": "[\"BTC\"]",
    "MarketBlackList": "[\"TRX\", \"XVG\"]",
    "OnlyTradeList": "[\"ETH\", \"LTC\"]",
    "AlwaysTradeList": "[\"ETH\", \"LTC\"]"
  }
}

Exchange, ApiKey, ApiSecret and PassPhrase

The exchange you want to use. For a lot of the private endpoints (such as placing orders) you will also need to provide an API key and the secret key to use to communicate with the exchange of your choosing. Please make sure that you have withdrawal permissions disabled for the API keys you put in here. No external tool should ever be trusted with any withdrawal privileges. Luckily our source code is available here for you to look at 😎

// Bittrex settings
public const string BittrexApiKey = "";
public const string BittrexApiSecret = "";

BinanceApiKey and BinanceApiSecret (string)

The API key and the secret key to use to communicate with Binance. Please make sure that you have withdrawal permissions disabled for the API keys you put in here. No external tool should ever be trusted with any withdrawal privileges. Luckily our source code is available here for you to look at 😎

// Binance settings
public const string BinanceApiKey = "";
public const string BinanceApiSecret = "";

Azure-related settings

This section contains the connection string used to connect to the Azure Table Storage used to store the trade data. This is a required section because otherwise the bot doesn't have any place to store our trade data. It also allows you to define names for both the Order table and the Trader table.

// Azure settings (`string`)
public const string TableStorageConnectionString = "DefaultEndpointsProtocol=https;AccountName=***;AccountKey=***;BlobEndpoint=https://***.blob.core.windows.net/;QueueEndpoint=https://***.queue.core.windows.net/;TableEndpoint=https://***.table.core.windows.net/;FileEndpoint=https://***.file.core.windows.net/;";
public const string OrderTableName = "orders";
public const string TraderTableName = "traders";

Trader settings

Decides how many trader instances you want to be running simultaneously. It also defines how many each trader should use as its stake amount. Each trader will take the given amount off your stack and trade with that amount in its own bubble. That way none of your other funds are touched. Buy orders that aren't filled at the next buy cycle can be cancelled automatically.

// Trader settings
public const int MaxNumberOfConcurrentTrades = 2;
public const double AmountOfBtcToInvestPerTrader = 0.01;
public bool CancelUnboughtOrdersEachCycle = true;

Coin blacklist & whitelist and only trade list (List<string>)

A list of market names to never trade on and a list of markets we always want to check for trades. You only need to specify the base currency here, because the bot can decide how to format the actual currency depending on the exchange you're going to use. If there is a subset of coins you want to trade you can use the OnlyTradeList setting. When there are coins listed here they will be the only coins that will be traded. You can also define a minimum amount of volume that needs to be traded to filter the list of coins further.

// Setting this to 0 means we will not look at volume and only look at our AlwaysTradeList. 
// Setting this to any value higher than 0 means we will get a list of markets currently
// trading a volume above this value and analyze those for buy signals.
public int MinimumAmountOfVolume { get; set; } = 150;

// These are the markets we don't want to trade on
public static readonly List<string> MarketBlackList = new List<string>() {
   "XVG", "TRX", "BCC" // Wasa wasa wasa wasa...
};
   
// These are the markets we want to trade on regardless of volume
public static readonly List<string> AlwaysTradeList = new List<string>() {
   "VEN", "OMG", "NEO", "XRP", "LSK", "ETH", "LTC", "ARK"
};

// These are the markets we want to trade on regardless of volume
public List<string> OnlyTradeList { get; set; } = new List<string>() {
   "VEN"
};

Stop-loss options

There are a few options to limit your losses. You can provide a default stop loss percentage at which point the trade will be abandoned by using the StopLossPercentage variable. You can also enable a trailing stop, which starts when the profit percentage set for the TrailingStopStartingPercentage variable is reached. For each X percent profit (as defined in the TrailingStopPercentage variable) the trailing stop is increased. You can also tell the bot to put an initial stop at the low of the signal candle as defined by the strategy you use.

// If we go below this profit percentage, we sell immediately.
public double StopLossPercentage = -0.07;

// Use a trailing stop to lock in your profits.
// WARNING: This can't be used in combination with ImmediatelyPlaceSellOrder.
public bool EnableTrailingStop = true;
public double TrailingStopStartingPercentage = 0.02;
public double TrailingStopPercentage = 0.05;
public bool PlaceFirstStopAtSignalCandleLow = false;

Buy-in settings

There are a few settings related to placing your buy order. Depending on the chosen strategy these can be used. The options for defining your buy-in are:

  • Ask/last balance - A value of 0.0 will use the ask price, 1.0 will use the last price and values between those interpolate between ask and last price. Using the ask price will guarantee quick success in bid, but the bot will also end up paying more then would probably have been necessary.
  • Percentage below current bid - Uses a percentage below the current bid as defined by BuyInPricePercentage.
  • Match current bid - Matches the current bid.
  • Signal candle close - Uses the close of the signal candle defined by the strategy as buy price.
public BuyInPriceStrategy BuyInPriceStrategy = Enums.BuyInPriceStrategy.SignalCandleClose;
public double AskLastBalance = 0.2;
public double BuyInPricePercentage = 0.002;

Sell settings

We all need our trades to sell eventually. How will we make any profit if we don't? To sell your trades you have a few settings you can use. You can immediately place a sell order at a specific profit percentage by using ImmediatelyPlaceSellOrder and ImmediatelyPlaceSellOrderAtProfit. Another way to take your profits is by using the return on investment functionality. The duration is a value in minutes and the profit is a double containing a percentage. This list is used to define constraints such as "Sell when 5 minutes have passed and profit is at 3%".

public bool ImmediatelyPlaceSellOrder = false;
public double ImmediatelyPlaceSellOrderAtProfit = 0.02;

public List<(int Duration, double Profit)> ReturnOnInvestment = new List<ValueTuple<int, double>>()
{
    new ValueTuple<int, double>(1440, 0.02),
};
Clone this wiki locally