Coder Social home page Coder Social logo

3commas-ftx-triggers's People

Contributors

nickpagz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

3commas-ftx-triggers's Issues

New ccxt naming conventions

HI, I just came across this project and thought it was pretty cool. I noticed that bot creation through Py3c_create.py is not working anymore likely because of a new CCXT naming convention here.

Fix connection errors

Occasionally the FTX connection will fail/timeout, causing the script to stop execution. The initial call is properly try/error wrapped and handled using a loop with multiple tries, but other calls to FTX are not wrapped. Need to add these, and asses the number of tries and the delay between tries.

Max bot usage wrong with leverage > 1

Hi,

When I'm using 1x leverage the calculated max bot usage is correct. When I set it to 3 it's wrong.

My settings:

UPDATE_BASE_ORDER_VOLUME = 33 #IN USD
UPDATE_TAKE_PROFIT = 1.25
UPDATE_SAFETY_ORDER_VOLUME = 60
UPDATE_MARTINGALE_VOLUME_COEFFICIENT = 1.2
UPDATE_MARTINGALE_STEP_COEFFICIENT = 1.1
UPDATE_MAX_SAFETY_ORERS = 10
UPDATE_ACTIVE_SAFETY_ORDERS_COUNT = 3
UPDATE_SAFETY_ORDER_STEP_PERCENTAGE = 2.0
UPDATE_LEVERAGE_CUSTOM_VALUE = 3
UPDATE_STOP_LOSS_TYPE = 'stop_loss'  # or stop_loss_and_disable_bot
UPDATE_STOP_LOSS_PERCENTAGE = 0
UPDATE_STOP_LOSS_TIMEOUT_ENABLED = False
UPDATE_STOP_LOSS_TIMEOUT_IN_SECONDS = 300
UPDATE_START_ORDER_TYPE = 'market'

3commas calculation:
image

Your calculation:
image

NoneType' object is not subscriptable

Dear Nic,.

When I run the "Py3c_create.py" i got the "object is not subscriptable " error. Could you please help me for solution .

Best Regards

Config File
TC_ACCOUNT_ID = '31369776'
TC_API_KEY = 'xxxxx'
TC_API_SECRET = 'xxxxxx'
BASE_URL = 'https://api.3commas.io'

API_KEY = 'xxxxx'
SECRET_KEY = 'xxxxx'
SUB_ACCOUNT = ''
PAIRS_BLACKLIST = ['DMG-PERP', 'BRZ-PERP', 'PERP/USD', 'SRN-PERP', 'PRIV-PERP']
LTF_DELAY = 60 #seconds between getting latest market data, processing orders.
LTF_INTERVALS = 5 # Delay * Intervals gives us the total time before the first order
LTF_BULL_CHANGE = 2.0
LTF_BEAR_CHANGE = -2.0
MAX_OPEN_POSITIONS = 20
ORDER_VALUE = 10
TAKE_PROFIT = '0.06'
STOP_LOSS = '0.03'
FUNDS_USAGE = 0.9
SWITCH_PERCENT = -7.0
TREND_STRENGTH = 65 # Percentage of longs vs shorts to consider not trading against a trend.
OPEN_POSITION_PRIORITY = True # True for max open positions, False for order size #not used in 3Commas, atm

ERROR
runfile('E:/malibot/Py3c_create.py', wdir='E:/malibot')
Reloaded modules: config
no existing bot ID files found, proceeding....
Error: {'error': True, 'msg': 'Other error occurred: not_found Not Found None.'}
Traceback (most recent call last):

File "E:\malibot\Py3c_create.py", line 175, in
build_bots()

File "E:\malibot\Py3c_create.py", line 150, in build_bots
longbot_list, no_long_bots = generate_long_bots(pairs_list, min_price)

File "E:\malibot\Py3c_create.py", line 81, in generate_long_bots
bot_list[key] = data["id"]

TypeError: 'NoneType' object is not subscriptable

Change triggers to use an ema crossover scheme

This might be a fork, or separate version since this would handle the capturing of prices in a very different way - ie polling ftx for candle data and processing it on the fly instead of just grabbing the latest price in each loop.

Add a readme file

Code is missing some context. Add a readme file to explain what it does, and how to use it.

Redeclared 'TAKE_PROFIT'

In the \example.config.py file, the TAKE_PROFIT var is duplicated:

...
TAKE_PROFIT = '0.06'
...
TAKE_PROFIT = 1.5

Automate adding newly listed perps

Add a function in the updater script to check for newly listed or delisted perps/tokens/coins, create/delete the bots, and update the bot id lists.

Using Lunacrush as trigger

Have read your latest blog post on bot settings for trending markets and saw comments about using Lunacrush for finding trending coins.

As I'm using your Python work as the basis for my own thing and implemented that Lunacrush stuff already, I thought giving back would be a nice idea. Below is what you would need to do to use your framework with Lunacrush.

Two new variables in config.py:

# script sorts by Lunacrush alt rank starting deals with the lowest. Set the maximum alt rank below to not chase any losers.
LUNACRUSH_MAX_ALT_RANK = 20

# API key can be found in the profile settings
LUNACRUSH_API_KEY = ""

A new function that replaces your top_pairs() one.

def lunacrush_top_pairs():
    ssl._create_default_https_context = ssl._create_unverified_context

    # Get all pairs of lbotid_list.txt
    coin_list = []
    with open("lbotid_list.txt") as f:
        for line in f:
            (key, val) = line.split(':')
            key = key.replace("USD_","").replace("-PERP","")  
            coin_list.append(key)
    
    coins = ','.join(coin_list)
    
    # query lunacrush for all coins 
    url = "https://api.lunarcrush.com/v2?data=assets&key=" + config.LUNACRUSH_API_KEY + "&symbol=" + coins
    assets = json.loads(urllib.request.urlopen(url).read())

    # sort coins by lowest ( = best) alt rank
    ranked_symbols = {}
    for asset in assets['data']:
        if 'alt_rank' in asset:
            if asset['alt_rank'] <= config.LUNACRUSH_MAX_ALT_RANK:
                ranked_symbols[asset['symbol']] = asset['alt_rank']

    ranked_symbols = sorted(ranked_symbols.items(), key=lambda item: item[1])
    ranked_symbols = {k: v for k, v in ranked_symbols}
    return ranked_symbols

top_bull_pairs = lunacrush_top_pairs()

Exchange row 385 with:

highest_bull_pair = get_nth_key(top_bull_pairs, n) + "-PERP"

That's it :-)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.