Update v1.0.6: TA variant: reduce number of config changes leading to bot restarts, improve error handling for pairs the exchange return incomplete data.
Update v1.0.5: fix several bugs related to properly setting overrides for the detected trading mode to use, should lead to less restarts. Add config presets for okgunbot exchange. Support new 'dynamic exit method' strategy option.
Update v1.0.4: fix several bugs related to handling SL and pair removal afterwards. Remove spread filter for adding pairs on huobi, improve pair exclude filters for kucoin.
Update v1.0.3: (requires Gunbot v23.5.0 or higher!) improve conditions for starting pairs in TA_MODE, fix crashing condition in addPairs job in case pairs from an uncontrolled exchange are present
Update v1.0.2: remove unneeded trading pair from all config presets
Update v1.0.1: fix default strategy name in legacy variant configs

This config bundle offers completely autonomous trading with the stepGridHybrid strategy, taking full adavantage of the trading modes this strategy offers. You set a few basic settings like how many pairs to trade, the script handles everything else.

Read more about it on Medium: https://medium.com/@Gunbot_com/how-to-launch-a-completely-autonomous-trading-bot-in-2022-using-gunbot-sghybrid-controller-6c9df00f889
 

Warnings:
- You need Gunbot v23.4.7 or higher. Do not try running it on an older version, it will not work.
– Because of how trading limit compounding is handled, the setup is difficult to combine with other trades on the same acount
– Manual trading on the same exchange account and base currency, or manually made config changes can lead to unexpected behavior
- Since stop losses are sometimes used in this setup, losing sell orders can happen
– All pairs for the exchange must be handled by the included AutoConfig jobs
– READ THE WHOLE INSTRUCTIONS 


Includes:
- Two different approaches to pair selection / removal: 
    1. scan multiple timeframe charts for pairs that suit one of the stepGridHybrid trading modes
    2. purely based on volatilty (like stepGrid controller)
– Hundreds of ready made config bundles for spot trading on binance, binanceus, ftx, huobi, kucoin, mex_gunthy and okex (kraken should follow soon)
– For devs: a build script and commented source code


Features:
– Scans markets for interesting pairs and adds them automatically, trades them with the stepGrid strategy
- Evaluates results for active trading pairs, continously replacing the worst performing pair with another
– Supports trading multiple base currencies on the same account, overlap between pairs is prevented automatically
– Supports the following base currencies: USDT, BUSD, USDC, USD, EUR, BTC, ETH, BNB. Granular balance settings per base currency.
– Compounding trading limit, with an option to keep reserves
- Can free up funds in case the account runs out of money for further buy orders


Notes:
– Don’t use all your funds for this. Keeping reserves is always a good idea, you never know what the market will bring in the future
– Try to keep relatively low numbers of pairs, to ensure frequent processing per pair. Not sure what to pick? 4 pairs USDT setups are a good start.
- You'll see more pairs being added than it may trade, this is fine because it won't actually trade every single added pair
- All included configs are for automatic pair selection
- Upgrades are as simple as overwriting the autoconfig.json file, unless specified differently in the release notes


Variations:
- TA:
--- Uses strategy modes to find pairs that seem interesting to trade, using 15m, 1h and 4h charts to process TA.
--- Trades pairs for as long as the mode allows them, pairs will generally trade for a relatively short period
--- Code optimized for less restarts, for example it will not add new pairs when another pair is trailing at that moment
- Legacy:
--- Is almost exactly like stepGrid controller, using stepGridHybrid instead
--- Selects pairs automatically, based on volatility and bid/ask spread
--- After all current pairs have ran for at least 12h, the worst performing pair eventually gets removed by enabling "stop after sell". Performance is measured for max drawdown, pnl and sell order frequency


Installation instructions:

Use one of the ready made bundles in the /build folder, you can just add your gunthy wallet address and exchange keys. But read on until the end.

Config bundles include:
- autoconfig.json with all needed jobs
- config.js with the needed strategy and exchange settings

Usage Instructions:

The following instructions should 'just work'. It is possible to bring existing pairs, but this requires more effort on your side.

1. Clean your account!
Sell every asset. Leave only base currency that may be used. Make sure to have balances in each base currency you want to use.

(Optional: change settings – explained below)

2. Enable AutoConfig
You will see a few jobs starting to run in the console logs. It takes at least one hour before it adds the first pairs.

3. One hour later: check if pairs got added and start trading
If pairs were added, hit the start trading button. From now on everything is automatic.

4. Done!
The first minutes/hours are a bit chaotic, in terms of the number of settings changes and restarts that go along with it.
After all pair slots are actively trading, restarts will happen a lot less frequently.


Settings options:

To control the strategy settings you need to change the relevant overrides in the output of the “addPairs” AutoConfig job. Do this in the autoconfig.json file, with a text editor or the code editor in Gunbot.
It is important to not change pair overrides for running pairs, it can cause unexpected behavior. If you want to change strategy settings, do it in the addPairs job.

The available overrides are shown below, comments are added for uncommon parameters. You cannot use these comments in the actual autoconfig.json file.
Read “do not change” as: only change if you know exactly what you are doing and you have modified the needed scripts.

Variations have a different set of settings options.

TA: (at least one trading mode needs to be enabled)
"TL_RATIO": 20, // sets trading limit as: (wallet balance - base reserve) / max pair per base / TL_RATIO
"BASE_RESERVE_PCT": 0, // reserves a percentage of wallet balance for the relevant base currency. settings 10 when trading USDT means that 10% of the wallet balance will not get assigned to active trading pairs
"ALLOW_SL": true, // allows using portfolio based stop loss: when enabled the bot will free up funds when it runs out of funds to trade with
"MAX_PAIR_PER_BASE": 4, // do not change
"TRADING_LIMIT": 0.00011, // do not change
"BUY_METHOD": "stepgridhybrid", // do not change
"SELL_METHOD": "stepgridhybrid", // do not change
"USE_TLR": true,
"USE_PSR": true,
"PARTIAL_SELL_RATIO": 0.4,
"MAX_BUY_COUNT": 999,  // do not change
"MIN_VOLUME_TO_SELL": 10,  // do not change
"PERIOD": 15,
"AUTO_STEP_SIZE": true, 
"STEP_SIZE": "500",
"PCT_STEP_SIZE": false,
"ENFORCE_STEP": false,
"PCT_TRAILING_RANGE": false, 
"CUSTOM_TRAILING_RANGE": 2,
"TREND_SYNC": false,
"TREND_BASIC": true,
"TREND_PLUS": true,
"TRAILING_MULTIPLIER": 2,
"SELL_STEP_MULTIPLIER": 1.2,
"PULLBACK_MODE": true, // allow trading pairs in pullback mode. At least one mode must be enabled.
"VOLATILITY_MODE": true, // allow trading pairs in volatility mode. At least one mode must be enabled.
"TA_MODE": true, // allow trading pairs in TA mode. At least one mode must be enabled.
"CUSTOM_TRADING_RANGE_MODE": true, // allow trrading pairs in custom trading range mode. At least one mode must be enabled.
"TRADING_RANGE_LOW": 0,
"TRADING_RANGE_HIGH": 0,
"TRADING_RANGE_STOP": 0,
"DYNAMIC_SL": true,
"STOP_AFTER_SELL": false,  // do not change
"FOREVER_BAGS": false,  
"BUY_ENABLED": false,  // do not change
"SELL_ENABLED": true,  // do not change
"PANIC_SELL": false,  // do not change
"SMAPERIOD": "50",
"ATR_PERIOD": "50",
"KEEP_QUOTE": "0",
"IGNORE_TRADES_BEFORE": "0", 
"STATUS": "new",  // do not change
"BAG_SIZE": "none",  // do not change
"RANKING_RESULT": -1,  // do not change
"REMOVE": false,  // do not change
"unit_cost": false,
"DYNAMIC_EXIT_LOGIC": true


Legacy: 
"TL_RATIO": 32,// sets trading limit as: (wallet balance - base reserve) / max pair per base / TL_RATIO
"BASE_RESERVE_PCT": 0, // reserves a percentage of wallet balance for the relevant base currency. settings 10 when trading USDT means that 10% of the wallet balance will not get assigned to active trading pairs
"ALLOW_SL": false, // allows using portfolio based stop loss: when enabled the bot will free up funds when it runs out of funds to trade with
"TRADING_LIMIT": 0.00011,  // do not change
"STATUS": "new",   // do not change
"STOP_AFTER_SELL": false,  // do not change
"BUY_ENABLED": false,  // do not change
"RANKING_RATIO": -1,  // do not change
"RANKING_RESULT": -1,  // do not change
"RANKING_TRADE_COUNT": -1,  // do not change
"RANKING_PNL": -1,  // do not change
"REMOVE": false,  // do not change
"MIN_VOLUME_TO_SELL": 10,  // do not change
"MAX_PAIR_PER_BASE": 4,  // do not change
"BAG_SIZE": "none",  // do not change
"MAX_BUY_COUNT": 999,  // do not change
"SELL_ENABLED": true,  // do not change
"SELL_METHOD": "stepgridhybrid",  // do not change
"BUY_METHOD": "stepgridhybrid",  // do not change
"TRAILING_MULTIPLIER": 2,
"SELL_STEP_MULTIPLIER": 1.2,
"PARTIAL_SELL_RATIO": 0.5,
"USE_TLR": false,
"USE_PSR": false,
"PCT_STEP_SIZE": false,
"TREND_SYNC": false,
"TREND_BASIC": true,
"TREND_PLUS": true,
"VOLATILITY_MODE": false, // discouraged to use modes in legacy variant
"PULLBACK_MODE": false, // discouraged to use modes in legacy variant
"TA_MODE": false, // discouraged to use modes in legacy variant
"CUSTOM_TRADING_RANGE_MODE": false, // discouraged to use modes in legacy variant
"TRADING_RANGE_LOW": 0,
"TRADING_RANGE_HIGH": 0,
"TRADING_RANGE_STOP": 0,
"PCT_TRAILING_RANGE": false,
"CUSTOM_TRAILING_RANGE": 2,
"DYNAMIC_SL": false,
"unit_cost": false,
"DYNAMIC_EXIT_LOGIC": true


Values for MIN_VOLUME_TO_SELL and TRADING_LIMIT get automatically set before trading is enabled for a pair.
If your exchange requires different minimums, you need to change these values in the function that sets pairVariables in the addPairs job using a text editor.



Balance handling:

Trading limit is set completely automatically, proportionally to the wallet balance.
Value only gets updated when a pair starts trading, or when it has no funds to sell.

The setup determines the total available base balance for each traded base, then allocates that between trading pairs.
If multiple base currencies are traded, like USDT and BTC, each of these will have it’s own total balance value.

The total wallet balance value is calculated at break even price of each bag, this makes the value comparable to how “wallet balance” in futures platforms is used.

Formula for trading limit:
(wallet balance - base reserve) / MAX_PAIR_PER_BASE / TL_RATIO

Make sure to allocate enough funds for your number of allowed pairs and settings for TL_RATIO
If not enough funds are available for your settings, a fallback trading limit of MIN_VOLUME_TO_SELL * 1.1 is set.

It is possible to set a base specific TL_RATIO, this is optional and can be used for any base.
For example, you trade both USDT and BTC pairs and want to use a different ratio for each, then add these settings to the overrides of your addPairs job:
"TL_RATIO_USDT": 40,
"TL_RATIO_BTC": 32

If a base currence is traded and no base specific ratio is set, it Uses TL_RATIO as fallback.


Build instructions (for devs):

You can find the source code for various functions in the autoconfig.json in the /src folder. The included build script can generate config bundles from that, and takes care of minifying the code.

Steps:
- Install Node.js
- Unpack controller folder. The two variations have their own folders and build script
- Run: npm install (in the folder where the package.json file is)
- Edit source code and autoconfig.json template in the /scr/compounding_auto-pairs folder
- You can add config variations for different exchanges or base currencies in /src/index.js, in the outputVariations array.
- Run: npm run build
- Get your configs in the /build folder
 

Disclaimer
It’s not feasible for a free config example to test all possible things that could go wrong. Use with caution!

Enjoy!
I’d appreciate it if you do not contact me through personal messages about this free config example. Thanks!
Creating and maintaining such setups is a lot of work, it is not reasonable to provide free support on top of that.
