Pages:
Author

Topic: Open source trading bot? - page 2. (Read 12490 times)

member
Activity: 98
Merit: 10
Tutorials, guidelines, optimizations for all!
July 14, 2011, 01:58:54 PM
#44
Still getting the same error Sad


MtGox down. Waiting...
sh: /usr/local/phpchroot/wget: No such file or directory


Are you sure that you changed BOTH occurences of the wget call? ;-)
Also if you chrooted the script it maybe doesnt have access to the wget tool.

Yep:


  $a = exec ('/usr/bin/wget -qO- --no-check-certificate https://mtgox.com/code/data/getDepth.php');

 $a = exec ('/usr/bin/wget -qO- --no-check-certificate --post-data "name=' . $username . '&pass=' . $password . $post_data . '" https://mtgox.com/code/' . $scriptname);

and im logged in as root

newbie
Activity: 36
Merit: 0
July 14, 2011, 01:44:13 PM
#43
Still getting the same error Sad


MtGox down. Waiting...
sh: /usr/local/phpchroot/wget: No such file or directory


Are you sure that you changed BOTH occurences of the wget call? ;-)
Also if you chrooted the script it maybe doesnt have access to the wget tool.
member
Activity: 98
Merit: 10
Tutorials, guidelines, optimizations for all!
July 14, 2011, 01:38:55 PM
#42
Still getting the same error Sad


MtGox down. Waiting...
sh: /usr/local/phpchroot/wget: No such file or directory
newbie
Activity: 36
Merit: 0
July 14, 2011, 01:00:40 PM
#41
  $a = exec ('/usr/bin/wget -qO- --no-check-certificate https://mtgox.com/code/data/getDepth.php');


does that look right? after i did whereis wget is gave me /usr/bin/wget

Also, do I need to put in my user/pass anywhere?

Yes, perfect but notice that there are 2 occurences you have to change.

>Also, do I need to put in my user/pass anywhere?
Yes, check the header of the script. Do a "nano ./ob.php" and put your id/pw in the corresponding area.
member
Activity: 98
Merit: 10
Tutorials, guidelines, optimizations for all!
July 14, 2011, 12:58:39 PM
#40
  $a = exec ('/usr/bin/wget -qO- --no-check-certificate https://mtgox.com/code/data/getDepth.php');


does that look right? after i did whereis wget is gave me /usr/bin/wget

Also, do I need to put in my user/pass anywhere?
member
Activity: 98
Merit: 10
Tutorials, guidelines, optimizations for all!
July 14, 2011, 12:51:55 PM
#39
Yea running CENTOS. let me try that
newbie
Activity: 36
Merit: 0
July 14, 2011, 12:44:41 PM
#38
Im getting this:


MtGox down. Waiting...
sh: /usr/local/phpchroot/wget: No such file or directory


any idea?

Do you have wget installed? Its used by the bot for establishing the ssl connection to mt. gox.
Try "whereis wget" - if it cannot be found you need to install it using your package manager. ("yum install wget" or "apt-get install wget")

Also your OS maybe prefers an absolute path Smiley

If wget *is* installed and it still doesn't work try changing the lines

   $a = exec ('wget -qO- --no-check-certificate https://mtgox.com/code/data/getDepth.php');

   $a = exec ('wget -qO- --no-check-certificate --post-data "name=' . $username . '&pass=' . $password . $post_data . '" https://mtgox.com/code/' . $scriptname);


to

   $a = exec ('/path/to/your/wget -qO- --no-check-certificate https://mtgox.com/code/data/getDepth.php');

   $a = exec ('/path/to/your/wget -qO- --no-check-certificate --post-data "name=' . $username . '&pass=' . $password . $post_data . '" https://mtgox.com/code/' . $scriptname);

member
Activity: 98
Merit: 10
Tutorials, guidelines, optimizations for all!
July 14, 2011, 12:36:23 PM
#37
Im getting this:


MtGox down. Waiting...
sh: /usr/local/phpchroot/wget: No such file or directory


any idea?
member
Activity: 84
Merit: 10
July 14, 2011, 11:05:57 AM
#36
Actually I didn't test your bot, I have already mine which is working pretty well. But it's still very interesting to compare with how you did things. And as I don't share mine I am happy to tip lol.
newbie
Activity: 36
Merit: 0
July 14, 2011, 11:03:00 AM
#35
Thanks for this r4ain. I just tipped you 0.5 because you learned me how to use JSON in php  Wink

You guys should all tip as well it's really generous from him.

Oh wow thanks, I wasn't expecting any positive comments/donations so soon Smiley

Actually the bot itself is just a proof of concept. But it works already, however some error messages are still not implemented yet.

Basically in all time series analysis problems the implementation is least problematic.  I'd focus discussion more on strategies rather than implementation problems.

Since bitcoin is a highly inefficient market at present, the possibility of arbitraging it should be there. Also, if there was a market offering reasonable liquitity with a better cost structure for short term traders, alot more strategies would suddenly make sense to be implemented.
member
Activity: 84
Merit: 10
July 14, 2011, 10:42:58 AM
#34
Thanks for this r4ain. I just tipped you 0.5 because you learned me how to use JSON in php  Wink

You guys should all tip as well it's really generous from him.
newbie
Activity: 36
Merit: 0
July 14, 2011, 09:50:06 AM
#33
Hey Guys,

I was thinking about open sourcing my trading bot too. Actually I already wrote quite a few.

I have attached you the source of a promising raw model that actually works. You can fine tune its variables (login/pw for MtGox) in the header of this code. Below that you dont have to change anything at all. It was written in PHP and you can just launch it from console. (just type "php ./ob.php" in the same path as the script resides on your linux shell)

What it does is the following:

It reads the market depth at mtgox and weights open bids/asks by their amount and distance to current market price (The closer they are to the market price the less likely they will be changed shortly - why? Because the person having placed those orders is at a high risk of getting filled, so its unlikely that its actually bogus order). After weighting the open orders it decides if there is much higher supply than demand (or vice versa), opens a position and holds it until market conditions have changed. So far so good.

Now for the bad part:

The fees at Mt. Gox are too high for very short term trading strategies like "scalping". The fee structure of 0.3% per trade sounds fair but what would be more attractive is a fee that is charged on actual profits. This would enable us to use many short term trading strategies that actually just dont work yet. In real trading you can make a fortune of a strategy that beats the market by just 1%. You don't need to have a high "edge" as many people commonly believe. The problem is this: MtGox eats 0.6% of each buy and sell (= round) which makes the odds much worse for us. In professional trading you normally have a broker with a more attractive fee structure OR you focus on long term trading, what is much harder in bitcoin. Why? Because a reliable history of quotes for professional time series analysis does not exist and conducting a long term prognosis for the whole bitcoin project is very hard at present. Since I dont have a 0% account I cannot investigate more on the short term possiblities.

If anyone is willing to let me test my more advanced scalping strategies on his 0% account I would be willing to share any profits with this person.

If you liked my code and want me to release more please consider a donation:
14o557CreqAimfskDyMwKZMfe2U6Pi3i9q

Download version 0.1:
http://www.megaupload.com/?d=EMI6H946

Notice: The script is designed to be run from the console of a *NIX system, it will output its status messages while working. It cannot simply be uploaded to a webhost running php and opened from a web browser. You have to use the console (ssh login) to start the script or run it from a local *NIX box.

Please let me know your results,

Thanks Smiley
member
Activity: 84
Merit: 10
July 14, 2011, 02:26:12 AM
#32
would it ever be profitable to rent a box with lower latency to and from the trade server?

This is what they name collocation and it's very frequent at wall street where you can rent a slot in the same data center as the exchange's ones. Regarding bitcoin, it's not really that necessary as mtgox for example is very slow to answer to queries...
sr. member
Activity: 350
Merit: 251
July 14, 2011, 02:18:56 AM
#31
would it ever be profitable to rent a box with lower latency to and from the trade server?
member
Activity: 84
Merit: 10
July 14, 2011, 02:17:23 AM
#30
A bot can easily be exploited, all you need to do is emulate conditions to where it will sell and buy, if you had enough btc you could probably just take their coins in under 5 min, assuming no safeguards were in place like a max BTCn/hr max out.

No, no, no!  You can trick a bot with a convex strategy (chasing momentum, for example).  You can't trick a bot with a concave strategy (rebalancing, for example).


You are right. We can certainly exploit some bots, because they all have flaws (which are tactical choices) but there is not a "one way for all" in doing this. So a lot of bot on the market would probably have an effect on the market, increasing the activity (whether good or not) and the better bots could take advantage of the weakest. Not in an intended manner, but just because they would be quickest to react etc. 
newbie
Activity: 18
Merit: 0
July 14, 2011, 01:46:14 AM
#29
A bot can easily be exploited, all you need to do is emulate conditions to where it will sell and buy, if you had enough btc you could probably just take their coins in under 5 min, assuming no safeguards were in place like a max BTCn/hr max out.

No, no, no!  You can trick a bot with a convex strategy (chasing momentum, for example).  You can't trick a bot with a concave strategy (rebalancing, for example).
sr. member
Activity: 350
Merit: 251
July 13, 2011, 11:49:38 PM
#28
A bot can easily be exploited, all you need to do is emulate conditions to where it will sell and buy, if you had enough btc you could probably just take their coins in under 5 min, assuming no safeguards were in place like a max BTCn/hr max out.
member
Activity: 116
Merit: 10
July 12, 2011, 11:29:49 AM
#27
i would tip anyone for a good bot, best with gui..
newbie
Activity: 13
Merit: 0
July 12, 2011, 07:13:53 AM
#26
Look at this :

The next version is already finished so if you interested just pm me.

http://forum.bitcoin.org/index.php?topic=25658.0
member
Activity: 84
Merit: 10
July 12, 2011, 06:05:17 AM
#25
Actually the algo IS the hardest past in a bot. It took me three hours to code the bot and 2 months to create the algo.

I suggest that you are making this way more complicated than it needs to be.  You've put 100 times as much effort into the algorithm as I did.  No doubt your algorithm is better than mine, but I rather doubt it's 100 times better. 


This is probably why quants are paid +£100K in London ;-)
Pages:
Jump to: