msolters / gdax-multipong Goto Github PK
View Code? Open in Web Editor NEWMulti-bucket range trading for the GDAX exchange
Multi-bucket range trading for the GDAX exchange
When a buy is partially filled, and the market moves up, sometimes the buys don't move up with it. Today, the market was up to $9650, but the buys stuck' with a partial fill at 9408, and didn't move. "R"e-reading the config doesn't solve it, exiting and restarting does.
Example:
"min_price": 7000.00
"max_price": 7030.00
Buys that take place at 7029.xx will never post up as a sell, since the sell price is over the max price. Instead they get "orphaned" and are never sold.
Suggestion, ignore that logic, post the sell at the offset price, regardless of the buy price, or at least use the same logic to test ( gdax.midmarket_price.current + 1*settings.bucket_width ) as you do to post the sell.
I originally posted on another tread, but the more I look at this issue, the more I think it's unique, so I'll open a new ticket, and try to edit my comments on the other thread.
So the API returns a "NotFound" - which does appear in the JSON. The GDAX console log shows:
23:35:20 {"response":{"statusCode":404,"body":"{"message":"NotFound"}","headers":{
However, when I try to echo out the contents of data.message to the log, it comes back empty.
let data
try {
data = await gdax.get_order_by_id( order_id )
} catch( e ) {
ui.logger('gdax_log', JSON.stringify(e))
// TODO: analyze failure modes
}
//my new lines
ui.logger('sys_log',
Trade ${trade.trade_id} Parsing )
ui.logger('sys_log',
Message ${data.message} )
23:35:19 Trade 00c46bca-d0ae-4458-8f50-39fa4a694372 Parsing
23:35:19 {}
My current theory, gdax.js isn't handling "NotFound" correctly. I think the matching code is here:
/**
* Get information about an order from GDAX by it's ID
*/
const get_order_by_id = exports.get_order_by_id = ( order_id ) => {
return new Promise( (resolve, reject) => {
gdax_private.getOrder( order_id, (error, response, data) => {
if( error ) {
reject( error )
return
}
resolve( data )
} )
})
}
gdax-node API says:
If the order is canceled the response may have status code 404 if the order had no matches.
Hey,
Thanks for putting together this awesome tool! It's been a real treat!
I'm not sure if something is off with my database or if I'm losing money, so I'd just like to make sure:
-14806.12
but I don't even have anywhere near there-10359.17
, but same idea. Is this the value from GDAX.com?When I pull down my FILLED orders as a CSV and add them up, I'm assuming I'm getting the total amount of money that was bought vs. sold and not the profiit right?
Sorry for these noob-ish questions but hopefully you can provide some insight!
I'd be happy to help adjust these values if they're right / wrong.
Perhaps I'm just reading them wrong?
Thanks again!
Sometimes (especially when the market is extremely active) a buy or sell is filled, but the bot misses the websocket message.
Two double-checks should be implemented:
full
, sync it.complete
, sync it.A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.