TELEGRAM_BOT_TOKEN = token
TELEGRAM_BOT_CHAT_ID = chat id
OKEX_PASSPHRASE = passphrase
OKEX_API_KEY = API key
OKEX_SECRET_KEY = Secret key
Explain of strategy.json
{
"symbols": [
{
/**
* Symbol spot type
*/
"type": "ETH/USDT",
/**
* Buy or sell amount by current stage, can not
* less than `type` mininal trade amount, this should
* can learn from exchange.
* The OKEx `ETH/USDT` mininal amount is `0.001`
*
* @example [0.001, 0.002, 0.003, 0.006, 0.008]
*/
"amounts": [0.001, 0.002, 0.003],
/**
* To set the stage to allow buy or sell. The
* higher stage you set, the more you chase the decrease.
*/
"maxStage": 10,
/**
* Calculate next buy or sell price based on current price.
*
* @example 0.02
*/
"change": 0.03,
/**
* Safe change base current price,
* will convert to percentage, 0.08 = 8%.
* If over, will re-calculate the next
* buy and sell price.
*
* If this symbol never bought and the price keep increasing,
* Assume the state last price is `3943.03`, and keep increasing
* over `4158.47`, then will update this symbol next price to
* ```
* {
* "nextBuyPrice": 4033.7159,
* "nextSellPrice": 4283.2241
* }
* ```
*
* @example 0.08
*/
"safeChange": 0.08
},
{
"type": "LTC/USDT",
"amounts": [0.01, 0.02, 0.03],
"maxStage": 10,
"change": 0.03,
"safeChange": 0.08
}
]
}
Explain of state.json
, this is auto-generate and auto-update by workflow and next sell or buy will base this statement, so DO NOT MODIFY this file except you know what you’re doing.
{
"symbols": [
{
"type": "ETH/USDT",
/**
* This is your last trade price AKA current price,
* and we use this price
* to calcuate `nextBuyPrice` and `nextSellPrice` price.
*/
"price": 3943.03,
/**
* If current price is less than this price, will create
* and buy order.
* Remember, this is the trigger condition, not the order
* price.
* For example, if current price is `3810.4`, so the order
* price is `3810.4`, not `3824.7391000000002` .
*/
"nextBuyPrice": 3824.7391000000002,
/**
* Same as `nextBuyPrice`
*/
"nextSellPrice": 4061.3209,
/**
* This is based on strategy's amounts, assume your amounts
* is `[0.001, 0.002, 0.003]`, if first buy order triggered,
* it will buy `0.001` amount of this spot,
* then the `currentStage` will become `1`, the `nextBuyAmount`
* will become `0.002`, the `nextSellAmount` will become `0.001`
*/
"nextBuyAmount": 0.003,
/**
* Similar to above, but opposite.
*/
"nextSellAmount": 0.003,
/**
* Record your buy or sell stage, if this same as strategy's
* maxStage, it won't buy anymore until the sell order triggered,
* more to see below.
*/
"currentStage": 4
},
/**
* This is the explaination for currentStage = maxStage.
* When currentStage is = maxStage, even if current price is 130
* or less, it won't create buy order. If your assets(USDT) are
* much enough, you can increase the strategy's maxStage.
*/
{
"type": "LTC/USDT",
"price": 150.6,
"nextBuyPrice": 146.082,
"nextBuyAmount": 0.03,
"nextSellPrice": 155.118,
"nextSellAmount": 0.03,
"currentStage": 10
}
]
}