Username: Password:

Author Topic: Gunbot 3.2 config white space and comment fixes  (Read 21866 times)

Offline someone111

  • Rookie
  • *
  • Posts: 10
    • View Profile
Gunbot 3.2 config white space and comment fixes
« on: May 12, 2017, 01:45:53 AM »
Original:
https://github.com/GuntharDeNiro/BTCT/releases/tag/Core3.2

Minor white space and comment fixes. Tried to be more consistent about when to use white spaces and when not. Changes:
- generally use a white space after colon
- generally use a white space before // comments
- no duplicate white spaces
- no trailing spaces

Code: [Select]
var config = {
//-----------------------------------------------
//   DEBUG
//-----------------------------------------------
DEBUG_LOG: true,
I_REALLY_WANT_IT: false,
BUY_SMALL_PORTION: 1,
INSUFFICIENT_FUNDS_ON_SELL_FIX: 0.0005,
INSUFFICIENT_FUNDS_ON_BUY_FIX: 0.0005,

//-----------------------------------------------
//   STARTUP OPTIONS
//-----------------------------------------------
SELL_ON_START: false,
CANCEL_SELL_ORDERS_ON_START: false,
CANCEL_BUY_ORDERS_ON_START: false,
CANCEL_OPEN_ORDERS_ON_START: false,



MAX_LATEST_PRICES: 200, // limit of latest prices to analyze to determine if price is growing or falling
MAX_LATEST_DIRECTIONS: 30, // limit of latest price directions, used in supergun detection
MAX_LAST_ORDERS: 5, // keeping last orders bought
PERIOD: 15, // candlestick period

SAVEFILE_SUFFIX: '-save.json',

//-----------------------------------------------
//   PRIMARY SETTINGS
//-----------------------------------------------
DEFAULT_MARKET_NAME: "poloniex",
DEFAULT_CURRENCY_PAIR: "BTC_ETH", // single pair format for all markets !
BUYLVL1: 3, // buy when the price drops by this percentual or lower if BUYLVL is 1
BUYLVL2: 12, // buy when the price drops by this percentual or lower if BUYLVL is 2
SELLLVL1: 2, // sell when the price drops by this percentual or higher is SELLLVL is 1
SELLLVL2: 70, // sell when the price drops by this percentual or higher is SELLLVL is 2
BUYLVL: 2, // possible values 1 and 2 (if you want to buy at level 1 or level 2)
SELLLVL: 2, // possible values 1 and 2 (if you want to sell at level 1 or level 2)
BUY_STRATEGY: "BB", // accepted values BB or STEPGAIN or GAIN or PINGPONG
SELL_STRATEGY: "GAIN", // accepted values BB or STEPGAIN or GAIN or PINGPONG
LOW_BB: 5, // buy when the price is higher than low BB by this percentual
HIGH_BB: 5, // sell when the price is lower than high BB by this percentual
PINGPONG_BUY: 0.001, // price to buy (or lower) in the ping pong strategy
PINGPONG_SELL: 0.002, // price to sell (or higher) in the ping pong strategy
BUY_LEVEL: 0.1, // If GAIN buy strategy is used, buy at this percentual below lower ema value
GAIN: 0.1, // If GAIN sell strategy is used, sell at this percentual above bought price
BTC_TRADING_LIMIT: 0.01,// max amount of BTC balance to use for each pair
SECURITY_MARGIN: 60, // sell all balance if currency decreases x% after you bought it
MIN_VOLUME_TO_BUY: 0.0005, // bitrex min volume

//-----------------------------------------------
//   BITTREX
//-----------------------------------------------
BITTREX_KEY: '',
BITTREX_SECRET: '',

BITTREX_PRICE_METHOD: 'ohlc', // ohlc OR vwa "price to buy" definition method
BITTREX_VWA_1_INTERVAL: 10, // weighted average interval in minutes
BITTREX_VWA_2_INTERVAL: 120, // weighted average interval in minutes


//-----------------------------------------------
//   KRAKEN
//-----------------------------------------------
KRAKEN_ASSET_PAIR: 'XETHXXBT',

KRAKEN_KEY: '',
KRAKEN_SECRET: '',

KRAKEN_PRICE_METHOD: 'vwa', // ohlc OR vwa "price to buy" definition method
KRAKEN_VWA_1_INTERVAL: 1, // weighted average interval in minutes
KRAKEN_VWA_2_INTERVAL: 15, // weighted average interval in minutes

//-----------------------------------------------
//   POLONIEX
//-----------------------------------------------
POLONIEX_KEY: '',
POLONIEX_SECRET: '',

POLONIEX_PRICE_METHOD: 'vwa', // ohlc OR vwa "price to buy" definition method
POLONIEX_VWA_1_INTERVAL: 0.02, // weighted average interval in hours
POLONIEX_VWA_2_INTERVAL: 0.04, // weighted average interval in hours

//-----------------------------------------------
//   BOT TIMINGS
//-----------------------------------------------
API_CALLS_DELAY: 777,
BOT_SLEEP_DELAY: (1000)*10, // bot cycle delay (koef*sec)
BOT_MAX_LIFETIME: 999999999, // overall bot lifetime (koef*min)
BOT_ON_FAIL_DELAY: (1000)*5, // bot repeat cycle delay if previous cycle failed (koef*sec)

//-----------------------------------------------
//   EMAIL
//-----------------------------------------------
ALERT_ON_NO_FUNDS: false, // email on insufficient funds
SMTP_EMAIL: '%40@gmail.com',
ALERT_EMAIL: '********',
SMTP_PASSWORD: '**********',
SMTP: true,
SMTP_PROTOCOL: 'SMTPS',
SMTP_HOST: 'smtp.gmail.com',

//-----------------------------------------------
//   OUTPUT
//-----------------------------------------------
MAX_LATEST_PRICES_SHOWN: 0, // limit of latest prices to show in console.log
SHOW_LASTEST_DIRECTIONS: false, // show chart in console
MAX_LATEST_DIRECTIONS_SHOWN: 0, // chart height
LASTEST_DIRECTIONS_LIST_WIDTH: 0, // chart width

//-----------------------------------------------
//   OTHER (might be deprecated/not in use)
//-----------------------------------------------
BTC_BALANCE: 2 // btc balance for test purposes,
};

module.exports = config;

Please take that version.

(It would be helpful to have the releases available in git. I am not proposing to publish the full cleartext gunbot source code. But the releases and config files would be useful to have in git to download releases and to send git pull requests for minor config fixes.)

Offline densmirnov

  • Rookie
  • *
  • Posts: 7
    • View Profile
    • densmirnov.com
Re: Gunbot 3.2 config white space and comment fixes
« Reply #1 on: May 12, 2017, 08:58:36 PM »
Thanks for excellent addition! I have also reworked config template a bit with much clearer formatting and more easy-to-read comments. Feel free to use this version as well. To download simply click on image or follow this link.

P.S. It would be cool if we can provide additional config file with only static exchange-related options. And pair config will became smaller, with only neccessary trade-related options.



Code: (json) [Select]
var config = {

    //  -----------------------------------------------
    //  STARTUP OPTIONS
    //  -----------------------------------------------
        SELL_ON_START: false,
        CANCEL_SELL_ORDERS_ON_START: false,
        CANCEL_BUY_ORDERS_ON_START: false,
        CANCEL_OPEN_ORDERS_ON_START: false,

        MAX_LATEST_PRICES: 600,             // Limit of latest prices to analyze to determine if price is growing or falling;
        MAX_LATEST_PRICES_TREND: 60,        // Limit of latest prices to analyze to determine if price is growing or falling;
        MAX_LATEST_DIRECTIONS: 30,          // Limit of latest price directions, used in supergun detection;
        MAX_LAST_ORDERS: 10,                // Keeping last orders bought;
        PERIOD: 15,                         // Candlestick period.

        SAVEFILE_SUFFIX: '-save.json',

    //  -----------------------------------------------
    //  PRIMARY SETTINGS
    //  -----------------------------------------------
        DEFAULT_MARKET_NAME: "poloniex",
        DEFAULT_CURRENCY_PAIR: "BTC_LSK",   // Single pair format for all markets!
        BUYLVL1: 3,                         // Buy when the price drops by this percentual or lower if BUYLVL is 1;
        BUYLVL2: 12,                        // Buy when the price drops by this percentual or lower if BUYLVL is 2;
        SELLLVL1: 2,                        // Sell when the price drops by this percentual or higher is SELLLVL is 1;
        SELLLVL2: 80,                       // Sell when the price drops by this percentual or higher is SELLLVL is 2;
        BUYLVL: 2,                          // Possible values 1 and 2 (if you want to buy at level 1 or level 2);
        SELLLVL: 2,                         // Possible values 1 and 2 (if you want to sell at level 1 or level 2);
        BUY_STRATEGY: "BB",                 // Accepted values BB or STEPGAIN or GAIN or PINGPONG;
        SELL_STRATEGY: "BB",                // Accepted values BB or STEPGAIN or GAIN or PINGPONG;
        LOW_BB: 30,                         // Buy when the price is higher than low BB by this percentual;
        HIGH_BB: 30,                        // Sell when the price is lower than high BB by this percentual;
        PINGPONG_BUY: 0.001,                // Price to buy (or lower) in the ping pong strategy;
        PINGPONG_SELL: 0.002,               // Price to sell (or higher) in the ping pong strategy;
        BUY_LEVEL: 2,                       // If GAIN buy strategy is used, buy at this percentual below lower EMA value;
        GAIN: 2,                            // If GAIN sell strategy is used, sell at this percentual above bought price;
        BTC_TRADING_LIMIT: 0.15,            // Max amount of BTC balance to use for each pair;
        SECURITY_MARGIN: 80,                // Sell all balance if currency decreases XX% after you bought it.

    //  -----------------------------------------------
    //  BITTREX
    //  -----------------------------------------------
        BITTREX_KEY: '',
        BITTREX_SECRET: '',

        BITTREX_PRICE_METHOD: 'ohlc',       // OHLC OR VWA "Price to Buy" definition method;
        BITTREX_VWA_1_INTERVAL: 10,         // Weighted Average Interval in minutes;
        BITTREX_VWA_2_INTERVAL: 120,        // Weighted Average Interval in minutes;

        MIN_VOLUME_TO_BUY: 0.0005,          // Bitrex MIN volume.

    //  -----------------------------------------------
    //  KRAKEN
    //  -----------------------------------------------
        KRAKEN_ASSET_PAIR: 'XETHXXBT',

        KRAKEN_KEY: '',
        KRAKEN_SECRET: '',

        KRAKEN_PRICE_METHOD: 'vwa',         // OHLC OR VWA "Price to Buy" definition method;
        KRAKEN_VWA_1_INTERVAL: 1,           // Weighted Average Interval in minutes;
        KRAKEN_VWA_2_INTERVAL: 15,          // Weighted Average Interval in minutes.

    //  -----------------------------------------------
    //  POLONIEX
    //  -----------------------------------------------
        POLONIEX_KEY: '',
        POLONIEX_SECRET: '',

        POLONIEX_PRICE_METHOD: 'vwa',       // OHLC OR VWA "Price to Buy" definition method;
        POLONIEX_VWA_1_INTERVAL: 0.02,      // Weighted Average Interval in hours;
        POLONIEX_VWA_2_INTERVAL: 0.04,      // Weighted Average Interval in hours.

    //  -----------------------------------------------
    //  BOT TIMINGS
    //  -----------------------------------------------
        API_CALLS_DELAY: 777,
        BOT_SLEEP_DELAY: (1000)*60,         // Bot cycle delay (Coef * Sec);
        BOT_MAX_LIFETIME: 999999999,        // Overall bot lifetime (Coef * Min);
        BOT_ON_FAIL_DELAY: (1000)*30,       // Bot repeat cycle delay if previous cycle failed (Coef * Sec).

    //  -----------------------------------------------
    //  EMAIL
    //  -----------------------------------------------
        ALERT_ON_NO_FUNDS: false,           // Send E-mail on insufficient funds.
        SMTP_EMAIL: '%40@gmail.com',
        ALERT_EMAIL: '********',
        SMTP_PASSWORD: '**********',
        SMTP: false,
        SMTP_PROTOCOL: 'SMTPS',
        SMTP_HOST: 'smtp.gmail.com',

    //  -----------------------------------------------
    //  OUTPUT
    //  -----------------------------------------------
        MAX_LATEST_PRICES_SHOWN: 0,         // Limit of latest prices to show in console.log;
        SHOW_LASTEST_DIRECTIONS: false,     // Show chart in console;
        MAX_LATEST_DIRECTIONS_SHOWN: 0,     // Chart height;
        LASTEST_DIRECTIONS_LIST_WIDTH: 0,   // Chart width.

    //  -----------------------------------------------
    //  OTHER (might be deprecated/not in use)
    //  -----------------------------------------------
        BTC_BALANCE: 5,                     // BTC balance for test purposes.

    //  -----------------------------------------------
    //  DEBUG
    //  -----------------------------------------------
        DEBUG_LOG: true,
        I_REALLY_WANT_IT: false,
        BUY_SMALL_PORTION: 1,
        INSUFFICIENT_FUNDS_ON_SELL_FIX: 0.0005,
        INSUFFICIENT_FUNDS_ON_BUY_FIX: 0.0005
};

module.exports = config;
« Last Edit: May 12, 2017, 09:01:13 PM by densmirnov »

Offline dobcrypto

  • Contributor
  • **
  • Posts: 196
  • Russian - native language
    • View Profile
Re: Gunbot 3.2 config white space and comment fixes
« Reply #2 on: May 12, 2017, 09:17:10 PM »
Thanks to both of you!

Offline dobcrypto

  • Contributor
  • **
  • Posts: 196
  • Russian - native language
    • View Profile
Re: Gunbot 3.2 config white space and comment fixes
« Reply #3 on: May 12, 2017, 09:22:21 PM »
Original:
https://github.com/GuntharDeNiro/BTCT/releases/tag/Core3.2

Minor white space and comment fixes. Tried to be more consistent about when to use white spaces and when not. Changes:
- generally use a white space after colon
- generally use a white space before // comments
- no duplicate white spaces
- no trailing spaces

Code: [Select]
var config = {
//-----------------------------------------------
//   DEBUG
//-----------------------------------------------
DEBUG_LOG: true,
I_REALLY_WANT_IT: false,
BUY_SMALL_PORTION: 1,
INSUFFICIENT_FUNDS_ON_SELL_FIX: 0.0005,
INSUFFICIENT_FUNDS_ON_BUY_FIX: 0.0005,

//-----------------------------------------------
//   STARTUP OPTIONS
//-----------------------------------------------
SELL_ON_START: false,
CANCEL_SELL_ORDERS_ON_START: false,
CANCEL_BUY_ORDERS_ON_START: false,
CANCEL_OPEN_ORDERS_ON_START: false,



MAX_LATEST_PRICES: 200, // limit of latest prices to analyze to determine if price is growing or falling
MAX_LATEST_DIRECTIONS: 30, // limit of latest price directions, used in supergun detection
MAX_LAST_ORDERS: 5, // keeping last orders bought
PERIOD: 15, // candlestick period

SAVEFILE_SUFFIX: '-save.json',

//-----------------------------------------------
//   PRIMARY SETTINGS
//-----------------------------------------------
DEFAULT_MARKET_NAME: "poloniex",
DEFAULT_CURRENCY_PAIR: "BTC_ETH", // single pair format for all markets !
BUYLVL1: 3, // buy when the price drops by this percentual or lower if BUYLVL is 1
BUYLVL2: 12, // buy when the price drops by this percentual or lower if BUYLVL is 2
SELLLVL1: 2, // sell when the price drops by this percentual or higher is SELLLVL is 1
SELLLVL2: 70, // sell when the price drops by this percentual or higher is SELLLVL is 2
BUYLVL: 2, // possible values 1 and 2 (if you want to buy at level 1 or level 2)
SELLLVL: 2, // possible values 1 and 2 (if you want to sell at level 1 or level 2)
BUY_STRATEGY: "BB", // accepted values BB or STEPGAIN or GAIN or PINGPONG
SELL_STRATEGY: "GAIN", // accepted values BB or STEPGAIN or GAIN or PINGPONG
LOW_BB: 5, // buy when the price is higher than low BB by this percentual
HIGH_BB: 5, // sell when the price is lower than high BB by this percentual
PINGPONG_BUY: 0.001, // price to buy (or lower) in the ping pong strategy
PINGPONG_SELL: 0.002, // price to sell (or higher) in the ping pong strategy
BUY_LEVEL: 0.1, // If GAIN buy strategy is used, buy at this percentual below lower ema value
GAIN: 0.1, // If GAIN sell strategy is used, sell at this percentual above bought price
BTC_TRADING_LIMIT: 0.01,// max amount of BTC balance to use for each pair
SECURITY_MARGIN: 60, // sell all balance if currency decreases x% after you bought it
MIN_VOLUME_TO_BUY: 0.0005, // bitrex min volume

//-----------------------------------------------
//   BITTREX
//-----------------------------------------------
BITTREX_KEY: '',
BITTREX_SECRET: '',

BITTREX_PRICE_METHOD: 'ohlc', // ohlc OR vwa "price to buy" definition method
BITTREX_VWA_1_INTERVAL: 10, // weighted average interval in minutes
BITTREX_VWA_2_INTERVAL: 120, // weighted average interval in minutes


//-----------------------------------------------
//   KRAKEN
//-----------------------------------------------
KRAKEN_ASSET_PAIR: 'XETHXXBT',

KRAKEN_KEY: '',
KRAKEN_SECRET: '',

KRAKEN_PRICE_METHOD: 'vwa', // ohlc OR vwa "price to buy" definition method
KRAKEN_VWA_1_INTERVAL: 1, // weighted average interval in minutes
KRAKEN_VWA_2_INTERVAL: 15, // weighted average interval in minutes

//-----------------------------------------------
//   POLONIEX
//-----------------------------------------------
POLONIEX_KEY: '',
POLONIEX_SECRET: '',

POLONIEX_PRICE_METHOD: 'vwa', // ohlc OR vwa "price to buy" definition method
POLONIEX_VWA_1_INTERVAL: 0.02, // weighted average interval in hours
POLONIEX_VWA_2_INTERVAL: 0.04, // weighted average interval in hours

//-----------------------------------------------
//   BOT TIMINGS
//-----------------------------------------------
API_CALLS_DELAY: 777,
BOT_SLEEP_DELAY: (1000)*10, // bot cycle delay (koef*sec)
BOT_MAX_LIFETIME: 999999999, // overall bot lifetime (koef*min)
BOT_ON_FAIL_DELAY: (1000)*5, // bot repeat cycle delay if previous cycle failed (koef*sec)

//-----------------------------------------------
//   EMAIL
//-----------------------------------------------
ALERT_ON_NO_FUNDS: false, // email on insufficient funds
SMTP_EMAIL: '%40@gmail.com',
ALERT_EMAIL: '********',
SMTP_PASSWORD: '**********',
SMTP: true,
SMTP_PROTOCOL: 'SMTPS',
SMTP_HOST: 'smtp.gmail.com',

//-----------------------------------------------
//   OUTPUT
//-----------------------------------------------
MAX_LATEST_PRICES_SHOWN: 0, // limit of latest prices to show in console.log
SHOW_LASTEST_DIRECTIONS: false, // show chart in console
MAX_LATEST_DIRECTIONS_SHOWN: 0, // chart height
LASTEST_DIRECTIONS_LIST_WIDTH: 0, // chart width

//-----------------------------------------------
//   OTHER (might be deprecated/not in use)
//-----------------------------------------------
BTC_BALANCE: 2 // btc balance for test purposes,
};

module.exports = config;

Please take that version.

(It would be helpful to have the releases available in git. I am not proposing to publish the full cleartext gunbot source code. But the releases and config files would be useful to have in git to download releases and to send git pull requests for minor config fixes.)
U forget
MAX_LATEST_PRICES_TREND: 30

Offline someone111

  • Rookie
  • *
  • Posts: 10
    • View Profile
Re: Gunbot 3.2 config white space and comment fixes
« Reply #4 on: May 14, 2017, 05:00:29 AM »
U forget
MAX_LATEST_PRICES_TREND: 30
(Not my mistake. From https://github.com/GuntharDeNiro/BTCT/releases/tag/Core3.2 I copied the config below "Here are the values in config and a brief explanation:". And did whitespace / comment fixes only to keep it simple. You're right in so far that MAX_LATEST_PRICES_TREND is missing from the original config. But that's something only gunthar can fix. I intentionally did not make any other changes. Just wanted to get this small improvement in before perhaps suggesting something else small step by step.)

Thanks to both of you!
I am happy if I my post would lead to an improvement. :)

I like densmirnov's version even more than my own version. It also has MAX_LATEST_PRICES_TREND and looks really clean. Would be cool if gunthar would add this improved config in the next version.