blankia (OP)
Newbie
Offline
Activity: 27
Merit: 0
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
March 24, 2014, 08:33:42 AM |
|
Hi,
I got kind of inspired by all the trading bots offered on this site and now I want to build my own bot. Most of the bots that I have seen here are more user friendly, with a nice interface ect. I think the best way to build my own bot is just some plain script that does the trading and nothing more. I just want to do it myself to get to know the inside outs of trading bots and that I am not reliable to someone else for further improvements. I need some pointers in the right direction and am willing to learn some new skills to do this. At the moment it needs to update and search for trading opportunities every 1 to 5 seconds, but maybe in 1 year time this needs to be considerably faster. So im looking to build something that is scalable on speed, as it becomes harder and harder to beat other players.
At the moment I was thinking to write the code in Node js and javascript. How does this sound? I am collecting trading data in a mysql database and can do the computations for trading opportunities there. The reason for this is, that I think that this method is less prone to errors. For example, exchange sites api lag sometimes and I need to collect data for when a trade is confirmed ect. Is it better?
Are there any other languages that I could best write my code in?
Thanks and help will be appreciated.
|
|
|
|
00ph8al
Newbie
Offline
Activity: 30
Merit: 0
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
March 24, 2014, 09:13:19 AM |
|
No need to reinvent the wheel. Take an existing bot and modify for your needs. I wasted several months on my own code until I dug deeper into what is out there. My code was usable,but still just the basics. With existing, you get the basics for free and you get to build something advanced more quickly.
For nodejs I run Gekko. Search for it here or Github.
|
|
|
|
daybyter
Legendary
Offline
Activity: 965
Merit: 1000
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
March 24, 2014, 11:58:49 AM |
|
I guess most exchanges will ban you, if you fetch prices every second?
I work on java trading code btw and released a lib to fetch prices from some exchanges btw.
|
|
|
|
minzie
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
March 25, 2014, 04:04:09 PM |
|
I guess most exchanges will ban you, if you fetch prices every second? Bitstamp will ban you if hit their server more than once a second, unless you can convince them to whitelist your IP.
|
|
|
|
blankia (OP)
Newbie
Offline
Activity: 27
Merit: 0
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
March 25, 2014, 06:27:46 PM |
|
No need to reinvent the wheel. Take an existing bot and modify for your needs. I wasted several months on my own code until I dug deeper into what is out there. My code was usable,but still just the basics. With existing, you get the basics for free and you get to build something advanced more quickly.
For nodejs I run Gekko. Search for it here or Github.
Yess thats a good idea. Thanks for the pointer, I will take a first look at Gekko. So I was wondering.. What happens when you see a trading opportunity? Do you place a limit order at one of the open bid-ask prices or do you come in with a market order? How do you check if the trade was really executed?
|
|
|
|
daybyter
Legendary
Offline
Activity: 965
Merit: 1000
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
March 25, 2014, 08:19:31 PM |
|
Some exchanges have methods to check the status of an order. The most simple way is usually to check your funds. If you bought 1 btc and your btc funds are 1 btc higher than before => order filled.
|
|
|
|
blankia (OP)
Newbie
Offline
Activity: 27
Merit: 0
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
March 25, 2014, 08:36:54 PM Last edit: March 25, 2014, 09:01:51 PM by blankia |
|
Some exchanges have methods to check the status of an order. The most simple way is usually to check your funds. If you bought 1 btc and your btc funds are 1 btc higher than before => order filled.
Like you said, you cant hit the api continuously?, so how to work around this. For example: You usually check for the opportunity and one round trip (buy USD to BTC and immediately sell BTC to XXX) would look like this: Make one side of the trade Wait one sec Check balance if trade went through Wait one sec Make other side of the trade Wait one sec Check balance if trade went through Wait one sec
|
|
|
|
minzie
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
March 25, 2014, 09:12:37 PM |
|
Something like that.
|
|
|
|
blankia (OP)
Newbie
Offline
Activity: 27
Merit: 0
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
March 25, 2014, 09:23:57 PM |
|
Ok nice. Do traders sometimes end up with excess inventories/balances :p How big would that risk be? ![Smiley](https://bitcointalk.org/Smileys/default/smiley.gif)
|
|
|
|
daybyter
Legendary
Offline
Activity: 965
Merit: 1000
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
March 25, 2014, 09:24:09 PM |
|
That might be too slow already. Better hold funds in all the traded currencies and fire all the orders at once.
|
|
|
|
blankia (OP)
Newbie
Offline
Activity: 27
Merit: 0
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
March 25, 2014, 09:30:38 PM |
|
One more question What are the rules for hitting an API. So basically if i hit an API for 1 minutes 200 times and then don't do it for 3.5 hours. Averaging once a second. Is that even allowed? Ím just trying to come up with ways to work around it.
|
|
|
|
daybyter
Legendary
Offline
Activity: 965
Merit: 1000
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
March 25, 2014, 09:42:38 PM |
|
I guess you are banned then. I wrote some code to fetch prices via proxies, but it's hard to get a list of reliable free proxies.
|
|
|
|
minzie
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
March 25, 2014, 10:12:14 PM |
|
It is not cumulative... if you hit more than one time a second, you can be banned at any point. Exchanges have to limit traffic or they will get DOSed out of business.
|
|
|
|
|
olsn
Newbie
Offline
Activity: 55
Merit: 0
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
March 26, 2014, 09:09:00 AM |
|
On Bitstamp you can request more than once a second, just don't exceed 600 per 10minutes -> so averaging 1/s in 10 minutes. For querying realtime-prices you should use their websocket API: https://www.bitstamp.net/websocket/
|
|
|
|
daybyter
Legendary
Offline
Activity: 965
Merit: 1000
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
March 26, 2014, 04:35:35 PM |
|
I think that's actually a good combination, although I prefer Scheme these days. I thought about using scheme to implement my own rule-engine, but since drools is available these days, I went the easier route.
|
|
|
|
csupnig
Newbie
Offline
Activity: 21
Merit: 0
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
March 26, 2014, 08:05:23 PM |
|
Hi there... I am running a platform where you can code your rule engine in JavaScript then test it and use it for real trading on BTC-e. There are some strategies already implemented and you can get a hang of how things work pretty fast. You can then use this knowledge to build your own bot ![Wink](https://bitcointalk.org/Smileys/default/wink.gif) You can find the platform here: http://www.cointelligence.netHave fun coding your own strategies and rules!
|
|
|
|
blankia (OP)
Newbie
Offline
Activity: 27
Merit: 0
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
March 28, 2014, 09:53:27 AM |
|
Hi there... I am running a platform where you can code your rule engine in JavaScript then test it and use it for real trading on BTC-e. There are some strategies already implemented and you can get a hang of how things work pretty fast. You can then use this knowledge to build your own bot ![Wink](https://bitcointalk.org/Smileys/default/wink.gif) You can find the platform here: http://www.cointelligence.netHave fun coding your own strategies and rules! Thnx!
|
|
|
|
blankia (OP)
Newbie
Offline
Activity: 27
Merit: 0
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
March 28, 2014, 10:11:05 AM |
|
When writing your bot in LISP or Scheme, can you connect to the websockets?
|
|
|
|
olsn
Newbie
Offline
Activity: 55
Merit: 0
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
March 28, 2014, 11:42:10 AM |
|
There are Websocket-Libraries for LISP, however you would have to write the listener-implementation yourself, I doubt that any exchange would offer that for lisp ![Wink](https://bitcointalk.org/Smileys/default/wink.gif)
|
|
|
|
|