Bitcoin Forum
December 16, 2024, 12:20:14 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Making a real time automated trading system  (Read 1707 times)
Dirk83 (OP)
Newbie
*
Offline Offline

Activity: 33
Merit: 0


View Profile
April 25, 2013, 06:01:22 AM
 #1

Hi,

I want to make a real time automated trading system that makes trading decisions based on the real-time data-feed (on the order book and possibly on the time and sales data coming through). In what environment is it best to do this? The problem with PHP is that it is a one time request where the connections don't stay open to process real-time data; but the other problem is that when I want to make a trading decision (update, insert, cancel) I need to send a static HTTP request.

Any ideas?

Thanks, Dirk
artgoodluck
Newbie
*
Offline Offline

Activity: 17
Merit: 0



View Profile
April 25, 2013, 06:04:58 AM
 #2

Get a job with some real algo-traders to get some ideas. Learn a language other than PHP.   What you are describing sounds cool but you will discover just how hard it is pretty soon.
Dirk83 (OP)
Newbie
*
Offline Offline

Activity: 33
Merit: 0


View Profile
April 25, 2013, 06:13:53 AM
 #3

Get a job with some real algo-traders to get some ideas. Learn a language other than PHP.   What you are describing sounds cool but you will discover just how hard it is pretty soon.

In what environment can I do what I described? That is, make calculations based on a real time order book data feed and possibly time and sales data and then have the ability to do order management on a real-time connection as well?
Dirk83 (OP)
Newbie
*
Offline Offline

Activity: 33
Merit: 0


View Profile
April 25, 2013, 09:28:06 AM
 #4

Get a job with some real algo-traders to get some ideas.

I have such a background btw, only IT and trading were separated in the firm I worked for, so I am a bit stuck on the IT side, though I do have programming experience and I should be able to do that part myself. And yes, I know it´s hard and you need to know really well what you are doing.
s2
Full Member
***
Offline Offline

Activity: 198
Merit: 123


View Profile
April 25, 2013, 09:30:22 AM
 #5

Not done this myself but would like to take a peek and a programmer myself too.  I think you need to look at NodeJS, C/Java server or something else that handles websockets well for the live connection.  You can do it in PHP with a websocket library if necessary I believe but may have sociability issues if you're going to make this a service for others to use too.  

These would be the three steps I'd do...
First step -  get a websocket system that follows share price via mtgox or other API that supports this websocket system.
Second - Test your algorithm on buy/sell requests based on test data
Third - Call into the buy/sell API such as Mtgox, Bitstamp, bitcoin24 etc..

Probably not that difficult but will take a lot of time and a lot of testing especially for scenarios when DOS attacks causing panic selling happens.  At the end of the day it's still gambling on random odds, you'll probably find you'll lose money via an automated system unless you have options for short selling, market influencing, using someone else's money or other tricks the bigboys use in the city's trades.

You may find it's easier however to just use something like bitcoin-bot.com that's already out there for safer and smaller scale automated trading though Wink
Dirk83 (OP)
Newbie
*
Offline Offline

Activity: 33
Merit: 0


View Profile
April 25, 2013, 09:37:16 AM
 #6

Not done this myself but would like to take a peek and a programmer myself too.  I think you need to look at NodeJS, C/Java server or something else that handles websockets well for the live connection.  You can do it in PHP with a websocket library if necessary I believe but may have sociability issues if you're going to make this a service for others to use too.  

These would be the three steps I'd do...
First step -  get a websocket system that follows share price via mtgox or other API that supports this websocket system.
Second - Test your algorithm on buy/sell requests based on test data
Third - Call into the buy/sell API such as Mtgox, Bitstamp, bitcoin24 etc..

Probably not that difficult but will take a lot of time and a lot of testing especially for scenarios when DOS attacks causing panic selling happens.  At the end of the day it's still gambling on random odds, you'll probably find you'll lose money via an automated system unless you have options for short selling, market influencing, using someone else's money or other tricks the bigboys use in the city's trades.

You may find it's easier however to just use something like bitcoin-bot.com that's already out there for safer and smaller scale automated trading though Wink


Thanks, yes, I have been looking into already available trading software, but so far they don't offer the functionality that I'd like to have.
Dirk83 (OP)
Newbie
*
Offline Offline

Activity: 33
Merit: 0


View Profile
April 25, 2013, 09:39:01 AM
 #7

Java or python are the best for this project. I have built a trading bot. It is a great experience and a lot of hard work.

How long did it take you? Did you publish the software?
Dirk83 (OP)
Newbie
*
Offline Offline

Activity: 33
Merit: 0


View Profile
April 25, 2013, 09:46:43 AM
 #8

Basically, what I'd like, is to be able to calculate a fair value of the bitcoin price based on

a.) real-time order book data
b.) recent time and sales data
c.) manual adjustments or additional algorithms based on historic data or future projections

Then, I would like to be able to put orders into the system in an efficient manner.

Preferably I also would like to have a graphical representation of the order book as well a graphical way to show which orders are mine. I'd also like to put orders in or cancel orders just by clicking on the graphical user interface.

If there is open source software available that does exactly that, or that I can relatively easily adjust to do just that, that would be best of course.
Dirk83 (OP)
Newbie
*
Offline Offline

Activity: 33
Merit: 0


View Profile
April 25, 2013, 10:09:14 AM
 #9

Thanks, had an initital peak into Goxtool, looks like I should be able to configure it in a the right way. Was it hard for you to make a program that works on multiple exchanges? Are you also able to adjust your price based on real time data of multiple exchanges?
Dirk83 (OP)
Newbie
*
Offline Offline

Activity: 33
Merit: 0


View Profile
April 25, 2013, 12:02:10 PM
 #10

What about using AJAX, could that do the trick?
jones
Newbie
*
Offline Offline

Activity: 44
Merit: 0


View Profile WWW
April 25, 2013, 01:38:00 PM
 #11

I would rather point you into the direction of using java or python. I would recommend to make it dependent on the language you are comfortable with and which libraries you want to use.

I love PHP for web-applications but for a trading bot I think you would have to take care of lots of workarounds.

For example in Java you might use XChange (http://xeiam.com/xchange_examplecode.jsp) which connects to many major tradeplaces in just a few lines of code.


I am currently starting a bot project myself (most likely in java) and set up a german forum on that topic.
Dirk83 (OP)
Newbie
*
Offline Offline

Activity: 33
Merit: 0


View Profile
April 29, 2013, 08:53:19 AM
 #12

What's a more reliable way to insert/cancel/update orders, through HTTP or through the websocket?
daybyter
Legendary
*
Offline Offline

Activity: 965
Merit: 1000


View Profile
April 29, 2013, 11:08:01 PM
 #13

Look for cryptocoin-tradelib in java. I will release more code soon and I always look for contributors.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!