Skip to content
/ gac Public

A code translator for the Gunbot trading bot autoconfig beta feature. Allows you write scripts in a readable fashion, and transpiles them down to the necessary format using Babel.js

Notifications You must be signed in to change notification settings

dreddi/gac

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gac - gunbot autoconfig compiler

Turns

{
    "update_tradinglimit": {
        "pairs": {
            "exclude": "",
            "include": "USDT-",
            "exchange": "binanceFutures"
        },
        "filters": {
            "long": {
                "type": "exact",
                "state": "LONG"
            },
        },
        "clearOverrides": false,
        "setPairVariable": {
        },
        "overrides": {
            "TRADING_LIMIT": function autotl(wallet) {

                if(wallet > 5000 && wallet <= 7000){
                    return 100;
                } else if(wallet > 7000 && wallet <= 10000){
                    return 120;
                } else if(wallet > 10000 && wallet < 15000){
                    return 150;
                }

                return 0;
            }(
                this.pair.balancesdata['USDT'].walletBalance
            ),
            "ROE": this.pair.leverage * 0.5
        },
        "schedule": "* * * * *",
        "type": "manageOverrides",
        "enabled": true,
        "debug": false
    }
}

into

{
  "update_tradinglimit": {
    "pairs": {
      "exclude": "",
      "include": "USDT-",
      "exchange": "binanceFutures"
    },
    "filters": {
      "long": {
        "type": "exact",
        "state": "LONG"
      }
    },
    "clearOverrides": false,
    "setPairVariable": {},
    "overrides": {
      "TRADING_LIMIT": " function autotl(wallet) { if (wallet > 5000 && wallet <= 7000) { return 100; } else if (wallet > 7000 && wallet <= 10000) { return 120; } else if (wallet > 10000 && wallet < 15000) { return 150; } return 0; }(this.pair.balancesdata['USDT'].walletBalance)",
      "ROE": " this.pair.leverage * 0.5"
    },
    "schedule": "* * * * *",
    "type": "manageOverrides",
    "enabled": true,
    "debug": false
  }
}

Installation

Requires node v12+

npm install -g dreddi/gac

Usage

$ gac ~/autoconf.js
New autoconfig written to /home/dreddi/autoconfig.json

About

A code translator for the Gunbot trading bot autoconfig beta feature. Allows you write scripts in a readable fashion, and transpiles them down to the necessary format using Babel.js

Resources

Stars

Watchers

Forks