TakeProfit Increment - cyberjunky/3commas-cyber-bots GitHub Wiki
tpincrement.py
Take profit bot helper named Type = takeprofit adjuster
What does it do?
It will check active deals for the bot(s) specified and see how many SO are used, depending on number it will add a defined % per safety order to the TP value.
Some notes:
Example setting 'increment-step-scale = [0.1, 0.05, 0.03]' works like this:
Safety order 1 increment is 0.1%
Safety order 2 increment is 0.05%
Safety order 3 increment is 0.03%
Safety orders > 3 are ignored and not adjusted (you can increase the number of steps in the config to cater more safety orders e.g. [0.1, 0.05, 0.03, 0.03, 0.03] will cater for 5 SO)
Upon each update inteval, the safety orders are compared from the last 'run', so no SO are missed, the difference is then calculated. For example, using the above example config:
Update interval 1 = SO's complete is 0, so the increase is 0%
Update interval 2 = SO's complete is 2, so the increase is 0.15%
Update interval 3 = SO's complete is 3, so the increase is 0.03%
Existing deals will be updated on the first initiation of the database - so please take this into account - this is by design. Not yet tested over an extensive period.
All credits for this code go to !
Configuration
The configuration file for tpincrement
contains the following settings:
- timezone - timezone. (default is 'Europe/Amsterdam')
- timeinterval - update timeinterval in Seconds. (default is 3600)
- debug - set to true to enable debug logging to file. (default is False)
- logrotate - number of days to keep logs. (default = 7)
- botids - a list of bot id's to manage separated with commas.
- increment-step-scale - a list of increment percentages for the safety orders.
- 3c-apikey - your 3Commas API key value.
- 3c-apisecret - your 3Commas API key secret value.
- 3c-apikey-path - path to your own generated RSA private key, or empty.
- notifications - set to true to enable notifications. (default = False)
- notify-urls - one or a list of apprise notify urls, each in " " seperated with commas. See Apprise website for more information.
Example: (keys are bogus)
[settings]
timezone = Europe/Amsterdam
timeinterval = 1800
debug = False
logrotate = 14
usdt-botid = 123456
btc-botid = 789012
3c-apikey = 4mzhnpio6la4h1158ylt2
3c-apisecret = 4mzhnpio6la4h1158ylt4mzhnpio6la4h1158ylt4mzhnpio6la4h1158ylt4mzhnpio6la4h1158ylt4mzhnpio6la4h1158ylt4mzhnpio6la4h1158ylt4mzhnpio6la4h1158ylt4mzhnpio6la4h1158ylt
3c-apikey-path =
tgram-phone-number = +316512345678
tgram-api-id = 1234566
tgram-api-hash = o6la4h1158ylt4mzhnpio6la
tgram-channel = mytriggerchannel
notifications = True
notify-urls = [ "tgram://9995888120:BoJPor6opeHyxx5VVZPX-BoJPor6opeHyxx5VVZPX/" ]