jamesmcmurran / gdaxmarketmakertrader Goto Github PK
View Code? Open in Web Editor NEWThe Goal of this project is to make it so that you can just focus on your buy down and profit logic and not have to handle anything else.
The Goal of this project is to make it so that you can just focus on your buy down and profit logic and not have to handle anything else.
Copyright 2017 James McMurran This is not a finished product so please be carefull. I have stoped developing on this due to the crash once LiteCoin hits over $200 I will start this back up as I have most of my money wraped up at that price point. Licence:Creative Commons Attribution-ShareAlike CC BY-SA THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. If you don't have a Gdax account please consider using my link to get $10 free when you deposit $100 as I will also get $10. https://www.coinbase.com/join/5938cf1e9c87bc060c61c9cc Install Install nodeJS from the site not the repo the ubuntu one is old. # from npm npm install gdax npm install nodemailer # from GitHub npm install coinbase/gdax-node use command ts-node ./run.ts to run ts scripts Trader.ts is used for running the maker bot and is the meat of the bot. Watcher.ts is used to Watch your account for trades and let you know when trades happen. Listen.py is used for dumping all the stream into a mongodb. This is useful if you would like to use market data to set your buy down and profit intervals The Goal of this project is to make it so that you can link in your buy down and profit logic and not have to handle anything else. This project is still in beta as it some times fails to place an order in a response to an event. But it will notify you of this. Please keep in mind that this is a simple market maker and is used just to place and respond to the trades. I highly recommend finding a better way of setting the buydown and profit interval. To run you need to set env vars like so in the console be for running the scripts. Trader.ts is running then you place a limit trade on the web interface and sit back and let it run. ```bash #Gdax settings export GDAX_KEY=""; export GDAX_SECRET=""; export GDAX_PASSPHRASE=""; #You can put the email for email2txt so get txt's on your phone #noice email settings export Email_User=""; export Email_Password=""; export Email_From=""; export Email_To=""; #profit email settings I like to have a different sound effect for this one as this is the fun one. export Email_Profit_User=""; export Email_Profit_Password=""; export Email_Profit_From=""; export Email_Profit_To=""; #the max sell orders that it can have open export MAX_SELL_ORDERS=3; #this was for an experiment where the more open sells it had the bigger the buy down would get export EXP_BUYDOWN_SLOWDOWN=1; export tradeSize=0.01; export buyDownValue=.05; export profitValue=.05; ```
is not 100% but will stop it eventually
I got this after weeks of running.
How to fix?
/lib/node_modules/ts-node/src/index.ts:329
throw new TSError(formatDiagnostics(diagnosticList, cwd, ts, lineOffset))
^
TSError: ⨯ Unable to compile TypeScript
Trader.ts (30,5): Type 'string' is not assignable to type 'number'. (2322)
at getOutput (/lib/node_modules/ts-node/src/index.ts:329:15)
at Object.compile (/lib/node_modules/ts-node/src/index.ts:515:11)
at Module.m._compile (/lib/node_modules/ts-node/src/index.ts:402:43)
at Module._extensions..js (module.js:654:10)
at Object.require.extensions.(anonymous function) [as .ts] (/lib/node_modules/ts-node/src/index.ts:405:12)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
at Function.Module.runMain (module.js:684:10)
at Object.<anonymous> (/lib/node_modules/ts-node/src/bin.ts:145:12)
For some reason, fully valid orders will sometimes fail.
Error: A GDAX API request failed. Bad Request.
-------Order-------
type:order
Time:null
ProductId:LTC-USD
OrderType:limit
Side:buy
Size:1
Price:60.14
More than one buy order can happen as the cancel sometimes fails when trading gets heavy.
Hi,
First I must thank you for posting your code. My winter project was to write something similar, and I found your project in the comments for the gdax-tt project in which someone else was looking for a tutorial.
Now for the other reason I'm here..I am trying to use your code for ETH-USD and after my buy order finalized, I expected the automatic buy/sell orders to go through, but I didn't see any pop up and looking at the output, the result was "undefined" for both. Wondering if you have seen this before in my output below.
Thanks
Rod
Order Finalized
Calc profit price:935.00000000 + 0.25 = 935.25
Calc Buydown price:935.00000000 - 0.25 = 934.75
Cleared Buy order
I just bought 1 at 935.00000000
{}
side:buy Amount:1 Price:934.75
side:sell Amount:1 Price:935.25
Buy Limit placed for 1 at 934.75 and a sell limit for 1 at 935.25
Order to buy 1 'ETH-USD' for934.75. Result: undefined
-------Order-------
type:order
Time:null
ProductId:ETH-USD
OrderType:limit
Side:buy
Size:1
Price:934.75
Order to sell 1 'ETH-USD' for935.25. Result: undefined
-------Order-------
type:order
Time:null
ProductId:ETH-USD
OrderType:limit
Side:sell
Size:1
Price:935.25
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.