A rastrear o anúncio da Binance de desativar moedas

Autora:Bem-estar, Criado: 2019-02-20 11:28:46, Atualizado:

Objectivo da estratégia:

Em 15 de fevereiro, a Binance anunciou o lançamento do CLOAK, MOD, SALT, SUB, WINGS. Após o anúncio, a moeda envolvida começou imediatamente a cair, geralmente 15% em uma hora, com mais e mais usuários sabendo as notícias, o declínio continuou e não houve recuperação, e caiu pela metade até agora.

Esta estratégia funciona na plataforma de negociação quantitativa FMZ (anteriormente BotVS).

Ideia:

O formato específico é Binance irá excluir CLOAK, MOD, SALT, SUB, WINGS, Binance excluirá BCN, CHAT, ICN, TRIG.

A estratégia usará a will delist como uma palavra-chave para rastrear o novo anúncio de lançamento, é claro, não exclui o formato de notificação de mudança do Binance, você pode consultar esta estratégia para melhorar. Como a tarefa do rastreador é muito simples, ela será escrita em JavaScript simples. Depois de rastrear a moeda da delist, as informações da conta serão verificadas. Se houver uma moeda da delist, ela será vendida a um preço mais baixo. Se houver um pedido incompleto, ele será revogado primeiro. Até que a venda das moedas restantes seja completamente vendida.

Código de rastreamento:

var html = HttpQuery('https://support.binance.com/hc/zh-cn/sections/115000202591-%E6%9C%80%E6%96%B0%E5%85%AC%E5%91%8A')//Announcement page
html = html.slice(html.indexOf('article-list'),html.indexOf('pagination')) // Article list section
if(html.indexOf('will delist')>0){
    if(html.slice(html.indexOf('will delist')+3,html.indexOf('</a>')) != title){ //crawl only the first delist information
        var title = html.slice(html.indexOf('delist')+3,html.indexOf('</a>'))
        var downList = title.split('、')
        Log('New announcement is detected, the currency will be delist:', title, '@')//WeChat push release announcement
    }
}

Código de ordem de revogação:

function cancellOrder(){
    var openOrders = exchange.IO('api', 'GET', '/api/v3/openOrders')//Get all unexecuted orders
    for (var i=0; i<openOrders.length; i++){
        var order = openOrders[i];
        for (var j=0;j<downList.length;j++){
            if(order.symbol.startsWith(downList[j])){
                var currency = downList[j] + '_' + order.symbol.slice(downList[j].length);
                Log('There is a delist currency order exist, revoked', currency)
                exchange.IO("currency", currency)//To revoke a order, you need the trading pair information, so you must first switch to the trading pair.
                exchange.CancelOrder(order.orderId)
            }
        }
    }
}

Código da conta de cheque:

function checkAccount(){
    var done = false
    while(!done){
        account = _C(exchange.GetAccount)
        done = true
        for (var i=0; i<account.Info.balances.length; i++){
            if(downList.indexOf(account.Info.balances[i].asset)>-1 && parseFloat(account.Info.balances[i].free)>pairInfo[account.Info.balances[i].asset+'BTC'].minQty){
                Log('delist currency will be emptied', account.Info.balances[i].asset)
                sellAll(account.Info.balances[i].asset, parseFloat(account.Info.balances[i].free))
                done = false
            }
        }
        Sleep(1000)
    }
    Log('Sale completed')
}

Código de encomenda:

var exchangeInfo = JSON.parse(HttpQuery('https://api.binance.com/api/v1/exchangeInfo'))
var pairInfo = {}  //Trading pair information, storing transaction progress, minimum trading volume and other related information, placing order will needed
if(exchangeInfo){
    for (var i=0; i<exchangeInfo.symbols.length; i++){
        var info = exchangeInfo.symbols[i];
        pairInfo[info.symbol] = {minQty:parseFloat(info.filters[2].minQty),tickerSize:parseFloat(info.filters[0].tickSize), 
            stepSize:parseFloat(info.filters[2].stepSize), minNotional:parseFloat(info.filters[3].minNotional)}
    }
}else{
    Log('Failed to get transaction information')
}
function sellAll(coin, free){
    var symbol = coin + 'BTC'
    exchange.IO("currency", coin+'_BTC') //switching trading pair
    var ticker = _C(exchange.GetTicker)
    var sellPrice = _N(ticker.Buy*0.7, parseInt((Math.log10(1.1/pairInfo[symbol].tickerSize))))
    var sellAmount = _N(free, parseInt((Math.log10(1.1/pairInfo[symbol].stepSize))))
    if (sellAmount > pairInfo[symbol].minQty && sellPrice*sellAmount > pairInfo[symbol].minNotional){
        exchange.Sell(sellPrice, sellAmount, symbol)
    }
}

Resumindo:

O código acima é apenas para demonstração, o código completo pode ser encontrado emFMZ.COMA página de anúncios pode ser rastreada uma vez por minuto, o que terá tempo suficiente para vender antes do usuário comum.

Mas pode haver alguns problemas, como rastreamento sendo bloqueado, alterações no formato de anúncio, etc. Se a moeda não estiver no Binance, você também pode se referir a esta estratégia para outras exchanges.


Mais.