Giter VIP home page Giter VIP logo

Comments (22)

wendellpalazzo avatar wendellpalazzo commented on July 27, 2024 1

Dentro do arquivo index.js
procure por
setInterval(requestLedger,3000) então está vindo 5000 (5s) estou usando 10000 (10s)
e
setInterval(myorders, 2000) está vindo 2000 (2s) estou usando 5000 (5s)

depois restarte o processo lá no console

from foxbit_bot.

wendellpalazzo avatar wendellpalazzo commented on July 27, 2024 1

@marcelloinfoweb
Cara.. acho q percebi uma coisa.. o bot só funciona quando o preço atual está dentro da faixa de mínima e máxima..
ou seja..
no momento que vc colocou uma min e max então irá verificar se tem ofertas para este intervalo...
caso contrário n.. então quando vc muda qualquer informação dos inputs, somente na próxima verificação (que está dentro dos intervals) então irá ver uma nova opção de ofertas...

eu n tive muito tempo pra estudar todo o código.. apenas tentar fazer rodar.. saca?

from foxbit_bot.

wendellpalazzo avatar wendellpalazzo commented on July 27, 2024 1

captura de tela 2018-01-08 as 00 02 08

from foxbit_bot.

wendellpalazzo avatar wendellpalazzo commented on July 27, 2024 1

@marcelloinfoweb
Cara fiz um teste.. e até acabei perdendo um momento bom de compra mas tá bom agora tb sei como este script tá funcionando.

Ele verifica sempre o valor atual.. a partir dele ele vai comparar com o seu MINIMO (ou buy ou sell)
e então irá tentar deixar vc como comprador ou vendedor sempre no inicio.. ajustando sempre de acordo com o livro de ofertas...
agora sim.. até pra mim o entendimento ficou esclarecido rsrsr agora vai!!!!

from foxbit_bot.

wendellpalazzo avatar wendellpalazzo commented on July 27, 2024 1

from foxbit_bot.

thiagotxd avatar thiagotxd commented on July 27, 2024

Server running at: http://localhost:3000
[3:02:38] OB:DELETE_ORDER:sell:5
C:\Foxbit_Bot\index.js:228
for (i = 0 ; i < variables.orderbooktemp.asks.length ;i++)
^

ReferenceError: i is not defined
at EventEmitter.onOrderBookDeleteOrder (C:\Foxbit_Bot\index.js:228:12)
at EventEmitter.emit (C:\Foxbit_Bot\node_modules\eventemitter2\lib\eventemitter2.js:358:22)
at C:\Foxbit_Bot\node_modules\blinktrade\lib\ws.js:274:44
at Array.map (native)
at Object.subscribeEvent [as callback] (C:\Foxbit_Bot\node_modules\blinktrade\lib\ws.js:255:25)
at BlinkTradeWS.dispatchPromise (C:\Foxbit_Bot\node_modules\blinktrade\lib\wsTransport.js:177:85)
at BlinkTradeWS.onMessage (C:\Foxbit_Bot\node_modules\blinktrade\lib\wsTransport.js:170:12)
at WebSocket.onMessage (C:\Foxbit_Bot\node_modules\ws\lib\WebSocket.js:442:14)
at emitTwo (events.js:125:13)
at WebSocket.emit (events.js:213:7)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: node index.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\tx\AppData\Roaming\npm-cache_logs\2017-06-15T18_02_38_526Z-debug.log

C:\Foxbit_Bot>

from foxbit_bot.

eduardofx avatar eduardofx commented on July 27, 2024

Corrigido

https://github.com/eduardofx/Foxbit_Bot

image

from foxbit_bot.

enriquevago avatar enriquevago commented on July 27, 2024

Edu seguinte estava tentando rodar o git principal e acabei encontrando o seu corrigido porem o bot nao segue pelo que li é algo relacionado aquelas condiçoes catch logo abaixo !

Description: Buy and sell automatic foxbit exchange
Version: 2.0.0


(node:9662) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): [object Object]
(node:9662) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

}
variables.LedgerIDs.FOX = ledger['LedgerListGrp'][0].LedgerID;
}
});
} catch (e) {
console.log(e);
}
}

//get orderbook
function myorders() {
try {
blinktrade.myOrders().then(function(myOrders) {
variables.orderstemp = myOrders['OrdListGrp']
});
} catch (err) {
console.log("Orderbook GET", err)
}
}

from foxbit_bot.

marcelloinfoweb avatar marcelloinfoweb commented on July 27, 2024

@eduardofx Funciona bem, mas quando crio uma compra retorna essa mensagem, poderia ajudar?

Obrigado


/run/media/msc/7A6C0E556C0E0D17/foxbitBot/node_modules/blinktrade/lib/wsTransport.js:221
throw new Error('Error: ' + data.Detail + ' ' + data.Description);
^

Error: Error: 16 messages in the last second Too many messages per second
at BlinkTradeWS.onMessage (/run/media/msc/7A6C0E556C0E0D17/foxbitBot/node_modules/blinktrade/lib/wsTransport.js:221:15)
at WebSocket.onMessage (/run/media/msc/7A6C0E556C0E0D17/foxbitBot/node_modules/ws/lib/EventTarget.js:103:16)
at emitTwo (events.js:126:13)
at WebSocket.emit (events.js:214:7)
at Receiver._receiver.onmessage (/run/media/msc/7A6C0E556C0E0D17/foxbitBot/node_modules/ws/lib/WebSocket.js:146:54)
at Receiver.dataMessage (/run/media/msc/7A6C0E556C0E0D17/foxbitBot/node_modules/ws/lib/Receiver.js:389:14)
at Receiver.getData (/run/media/msc/7A6C0E556C0E0D17/foxbitBot/node_modules/ws/lib/Receiver.js:330:12)
at Receiver.startLoop (/run/media/msc/7A6C0E556C0E0D17/foxbitBot/node_modules/ws/lib/Receiver.js:165:16)
at Receiver.add (/run/media/msc/7A6C0E556C0E0D17/foxbitBot/node_modules/ws/lib/Receiver.js:139:10)
at TLSSocket._ultron.on (/run/media/msc/7A6C0E556C0E0D17/foxbitBot/node_modules/ws/lib/WebSocket.js:142:22)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: node index.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/msc/.npm/_logs/2017-12-23T19_22_38_441Z-debug.log

from foxbit_bot.

wendellpalazzo avatar wendellpalazzo commented on July 27, 2024

Olá... tive esse problema.. e outros que já foram reportados aqui..
resolvi fazendo assim:

atualizei o node e npm
removi o node_modules
removi o cache do npm
depois só dar um npm install
e quando for rodar o index.js.. use este comando:
NODE_ENV=production node index.js (este evita o problema q reportaram de erro LyfeCicle)

from foxbit_bot.

WinGGAp avatar WinGGAp commented on July 27, 2024

@wendellpalazzo
O comando seria: "SET NODE_ENV=production node index.js"?
E como faz pra remover o node_modules?

from foxbit_bot.

wendellpalazzo avatar wendellpalazzo commented on July 27, 2024

from foxbit_bot.

WinGGAp avatar WinGGAp commented on July 27, 2024

@wendellpalazzo
Ao colocar o comando "NODE_ENV=production node index.js"
![image](https://user-images.githubusercontent.com/27193361/34636308-a302f1de-f285-11e7-8688-3e508cf09018.png.

from foxbit_bot.

wendellpalazzo avatar wendellpalazzo commented on July 27, 2024

@WinGGAp me desculpa!!!
O certo é o que vc indicou mais acima:
O comando seria: "SET NODE_ENV=production node index.js"?

pq vc está usando WINDOWS.. estou num mac.. e então n precisa do comando "SET"...
👍

from foxbit_bot.

marcelloinfoweb avatar marcelloinfoweb commented on July 27, 2024

Esta iniciando mas quando eu ativo pra comprar, não adiciona minha ordem de compra, nem de vendas. Não aparece no sistema e nem na FoxBit. O que pode ser?

capturadetelade2018-01-0615-43-31

from foxbit_bot.

wendellpalazzo avatar wendellpalazzo commented on July 27, 2024

@marcelloinfoweb
Cara as vezes demora entrar ... se vc ver no console ira ver vários comandos sendo executados... do tipo "BUY" "Buy:CHECK" e no padrao faz a cada 2s...

o problema eh q as vezes dá um erro de "16 messages in seconds.. to many messages".. isso pq a plataforma Blinktrade tem esta configuração.. para n dar tanto problema. .estou colocando coloco 3..5s

mais um detalhe.. estou usando o pullrequest que o @eduardofx corrigiu

from foxbit_bot.

marcelloinfoweb avatar marcelloinfoweb commented on July 27, 2024

Não entendi, onde eu altero esse intervalo?

from foxbit_bot.

marcelloinfoweb avatar marcelloinfoweb commented on July 27, 2024

Infelizmente não funcionou, minha ordem não é adicionada.

Poderia mandar um print do seu sistema funcionando, só pra eu tirar a minha dúvida. Estou usando o sistema do @eduardofx com as alterações que você recomendou.

Obrigado.

from foxbit_bot.

marcelloinfoweb avatar marcelloinfoweb commented on July 27, 2024

Vlw, me esclareceu também, vou fazer alguns testes aqui!

from foxbit_bot.

marcelloinfoweb avatar marcelloinfoweb commented on July 27, 2024

Olha só meu log no terminal:

[12:34:30] OB:DELETE_ORDER:sell:1
BUY.Check4: false
BUY.active: true
BUY.OrderID: 0
BUY.Check1: true
price: 54302.11
amount: 0.000001
onExecutionReportRejected { OrderID: null,
Volume: 0,
ExecID: null,
ExecType: '8',
OrdStatus: '8',
LeavesQty: 0,
Symbol: 'BTCBRL',
OrderQty: 100,
LastShares: 0,
LastPx: 0,
Side: '1',
TimeInForce: '1',
CumQty: 0,
MsgType: '8',
ClOrdID: 9144538,
OrdType: '2',
OrdRejReason: '3',
CxlQty: 0,
Price: 5430211000000,
ExecSide: '1',
AvgPx: 0 }


[12:34:32] Foxbit Order Rejected:
[12:34:32] Order Type: Buy
[12:34:32] Order Symbol: BTCBRL
[12:34:32] Order Value: 0.000543


[12:34:32] Foxbit Creating Purchase Order: Amount: 0.000001 BTC | Price: 54302.11 BRL

Não sei o que tem de errado.

from foxbit_bot.

wendellpalazzo avatar wendellpalazzo commented on July 27, 2024

from foxbit_bot.

marcelloinfoweb avatar marcelloinfoweb commented on July 27, 2024

Então, tenho que depositar mais Real, na cotação atual um pouco mais de 5 reais. Interessante.

from foxbit_bot.

Related Issues (16)

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.