Title: BTC-E PHP Currency Arbitrage Bot Full Code Post by: miaviator on May 05, 2013, 10:53:51 PM EDIT: Rolling Bot code posted: https://bitcointalk.org/index.php?topic=366546.0 (https://bitcointalk.org/index.php?topic=366546.0) This project took a while to write up. It made several BTC then several USD though it acted way to slow for my needs. I've changed over to a price rolling bot and no longer need to run this. This is not a .01B to L to U bot. You can run from B to B or U to U, it analyses two paths each way (BULB,BLUB) (UBLU,ULBU) and chooses the most profitable path (In B or U) as an amount NOT AS A PERCENTAGE my goal was to the most money not the highest percent and since this is dynamic that feature was required. You can still set a minimum % profit for each trade and I recommend setting it to at least the exchange fee of .2% as you will frequently get stuck in LTC. There is a currency flush used on trade leg three that trades out all L for $currency. This uses a recursive dynamic depth calculation and can perform circular trades of any amount. If you tell it to trade 1B it will sort the order book and find out what the max B,L,U available is before executing a trade (So if you try with 1B it might trade .01, .2, 1, .98, .023 etc.) depending on the size of each leg of the order book. There are a lot of configurable variables. There is also an unfinished currency change function which would allow you to swap from B to U when the price of B is falling and U to B when it is rising. This actually works really well, you can take advantage of arbitrage in either currency while holding funds in the most profitable currency. Output is very minimal because output costs time, the goal was sub 1ms per trade analysis. When a trade is kicked off there is often several opportunities back to back or a large order book on all legs so the code prints no output after a trade, it simply runs the paths again and keeps trading until no profit opportunity is found. - = duplicate orderbook . = trade path analysed a number = number of trades completed E# = error getting the order book (The current code was written to run on a round robbin set of servers and will exit after two errors) o = orders placed C = orders cancelled you'll have to enter your key and secret be careful setting min & max to the same number as this will use a different trading mechanism. I'm not responsible for any N00B losing money or making money (Though I'll gladly accept donations! 18DBdwc6JkCGrz2svV6mCPeURbZM8La5TN) Code: #screen -dmS arbot -h 1024 -L ./roundrobin.sh Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: miaviator on May 05, 2013, 10:54:35 PM Reserved.
Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: johnblaze on May 05, 2013, 10:58:47 PM what does the first line do with the shell script call?
Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: miaviator on May 05, 2013, 11:02:51 PM That (is a reminder) to kick off my roundrobbin program inside a screen session -> if Btc-e errors a lot their ddos tends to block IP's so I swap IP's on the second error, here is the roundrobin.sh script.
Code: #!/bin/bash Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: Jude Austin on May 11, 2013, 12:06:10 PM Any recommended settings?
Been messing with it for awhile now. I decided not to use the roundrobin.sh and I set the error sleep time to 15 seconds and to terminate after 100 errors. This let's it time out but continue to still run. Here is some output from it: Code: BULB Amount: -0.026001930645792 BULB Percent: -2.6001930645792 I assume that when these amounts become positive it will begin to trade them accordingly? Thanks for your time and script! Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: Stunna on May 11, 2013, 06:59:16 PM Is arbitrage still profitable? and how has your experience been so far running this?
Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: grabble on May 12, 2013, 12:31:56 AM I've been having a hell of a time getting this thing to work at all. I think my curl is all screwed up. I just keep getting 301 moved permanently ... Anyone else having this issue?
Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: miaviator on May 12, 2013, 02:28:32 AM Any recommended settings? I assume that when these amounts become positive it will begin to trade them accordingly? Thanks for your time and script! You are correct, it should trade as soon as you see a positive result. Keep in mind it takes a profit amount in B and a profit threshold as a percentage so it has to meet both criteria before trading. Code: //Using dynamic depth we can execute the most profitable trade in $currency with a minimum % profit Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: miaviator on May 12, 2013, 02:32:15 AM Is arbitrage still profitable? and how has your experience been so far running this? Arbitrage is less profitable now that a lot of bots exist. As I said I have abandoned this for a rolling buy sell bot which is proving more profitable. I did make several B over the course of a few weeks using this bot. I would think that other exchanges and auto transfers could be added in order to take advantage of the dozen or so alts out there with different prices and faster transaction times than B. All of that said. I'm not one to turn down making even $.01 a day while I sleep, eat and work. Free money is free money. Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: miaviator on May 12, 2013, 02:36:09 AM I've been having a hell of a time getting this thing to work at all. I think my curl is all screwed up. I just keep getting 301 moved permanently ... Anyone else having this issue? Yes. I have seen this. 99% of the time this means that Cloudflare is either asking you to verify you are human (using browser javascript) or they have banned your IP. This was a huge Issue for me since I run everything on headless linux server boxes. I would normally setup a quick socks proxy via ssh and open btc-e via a browser to verify I was human via the javascript and then it would run. This was one of the reasons I instituted the round Robbin script. CloudFlare is horrible. It protects the company from DDOS by preventing valid users access which makes the DDOS successful. Let me know if your issue is different and look into it. Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: grabble on May 12, 2013, 01:59:46 PM I think I'm just doing something wrong, I got past the 301 error but now the only output I get is .E1-E2-E3 and then the process terminates. I think I must have configured something wrong with my php or I'm executing it wrong (I'm literally just putting php bot.php). PHP has never been my strong suit haha.
Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: miaviator on May 12, 2013, 02:46:25 PM EDIT: You can also remove the @ symbol before each of those three json_decode lines and it should spit out an error that will help find out what's wrong with the url.
I think I'm just doing something wrong, I got past the 301 error but now the only output I get is .E1-E2-E3 and then the process terminates. I think I must have configured something wrong with my php or I'm executing it wrong (I'm literally just putting php bot.php). PHP has never been my strong suit haha. Your getting hit by their DDOS protection still. Those errors show when you can't pull the ticker pages from E: Code: $BTCtoUSD = @json_decode( send( 'https://btc-e.com/api/2/btc_usd/depth' ), TRUE ); check those links from a browser using the same IP as the machine you are running the script from: https://btc-e.com/api/2/btc_usd/depth https://btc-e.com/api/2/ltc_btc/depth https://btc-e.com/api/2/ltc_usd/depth This is where swapping IP's comes in handy. You can also stop the program from exiting (so it will keep trying to pull the books until your IP is banned :) by removing this line: Code:
Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: grabble on May 12, 2013, 09:25:21 PM I can pull the data just fine with:
Code:
It prints this: <pre>{"asks":[[110.999,0.482],[111,0.08565512],[111.44,2.42373056],[111.45,0.95797641],[111.46,12.766699],[111.47,43.73969491],[111.499,0.02],[111.5,1.0 4798],[111.59,0.22061],[111.6,1.35216595],[111.608,0.01],[111.64,0.011],[111.65,0.2989164],[111.69,0.08],[111.698,0.010978],[111.7,0.6438],[111.769,0.01],[111 .829,5.282],[111.839,0.1825],[111.84,0.25],[111.93,0.25],[111.949,0.02],[111.95,0.2601796],[111.96,0.01],[111.98,0.14],[111.99,4.55689031],[111.999,0.21026026 ],[112,6.56381636],[112.01,0.01],[112.012,0.1117995],[112.06,0.01],[112.07,0.25],[112.1,24.371],[112.14,0.09123795],[112.198,0.010978],[112.2,0.3323],[112.28, 0.25],[112.298,0.01],[112.3,1.925859],[112.312,0.010976],[112.32,0.01],[112.373,0.05],[112.384,0.05],[112.394,0.05],[112.395,0.05],[112.4,3.2528],[112.406,0.1 ],[112.41,0.01],[112.417,0.05],[112.418,0.05],[112.428,0.05],[112.43,0.25],[112.44,1.05],[112.45,0.0101796],[112.46,0.01],[112.47,0.11079744],[112.479,0.01],[ 112.49,0.01],[112.5,6.79002662],[112.51,0.04998],[112.544,0.1996],[112.55,0.25691786],[112.555,0.01],[112.57,0.25],[112.578,0.05],[112.598,0.0101796],[112.6,0 .07858852],[112.63,0.0113],[112.634,0.01],[112.65,0.2685204],[112.69,10.01300269],[112.698,0.010978],[112.7,0.2994],[112.75,0.04882465],[112.77,0.1127627],[11 2.79,5],[112.8,2.20190831],[112.81,0.02104057],[112.86,0.25],[112.87,0.0109],[112.878,0.019],[112.89,0.30755],[112.9,5.80713602],[112.93,0.474],[112.94,0.2009 6176],[112.95,10.0101796],[112.967,0.01],[112.98,5.89170535],[112.988,0.02],[112.99,6.111],[113,34.99802712],[113.03,0.25],[113.05,0.15],[113.13,10.01996],[11 3.136,0.02062671],[113.16,3.961],[113.17,0.5],[113.171,0.03369487],[113.176,0.04990195],[113.177,0.2],[113.178,2.42799529],[113.179,0.2],[113.187,0.2],[113.18 8,0.2],[113.189,0.2],[113.19,0.6],[113.197,0.2],[113.198,0.010978],[113.199,1],[113.2,1.01400002],[113.22,0.27],[113.227,0.24837326],[113.228,0.05],[113.229,0 .05],[113.23,3.5325],[113.25,0.31757619],[113.3,1.33626884],[113.32,0.25],[113.33,0.2],[113.39,0.84166937],[113.4,10.05373585],[113.412,0.01],[113.421,0.03],[ 113.423,0.01],[113.45,0.0101796],[113.47,3.992],[113.471,0.022],[113.49,1.32405],[113.5,232.2819077],[113.58,0.1],[113.59,10],[113.6,1.87955804],[113.606,0.02 ],[113.61,0.25],[113.613,0.1996],[113.64,0.05],[113.65,0.05198778],[113.698,0.010978],[113.7,0.69915719],[113.71,0.1],[113.75,0.02],[113.751,0.02],[113.759,0. 0103152],[113.76,0.1],[113.8,1.91389155],[113.82,1],[113.83,0.02],[113.839,0.95492748],[113.84,0.01],[113.865,0.02]],"bids":[[110.9,0.13374988],[110.84,0.15], [110.83,1.91367751],[110.829,3.02409137],[110.82,0.25],[110.74,0.44115717],[110.71,4.4743],[110.7,8.68410389],[110.699,0.01],[110.69,0.15],[110.506,0.01002],[ 110.5,0.0399],[110.401,5.96690474],[110.4,0.743],[110.381,0.01795565],[110.38,0.25],[110.37,0.89],[110.347,0.017],[110.27,0.25],[110.179,0.02004008],[110.01,0 .0102],[110.002,0.011],[110.001,1.803123],[110,11.24350583],[109.981,0.1825],[109.98,0.25],[109.95,0.0102],[109.93,4.90219398],[109.793,0.017],[109.699,0.01], [109.698,0.03],[109.61,0.12729965],[109.55,0.25],[109.502,0.011],[109.42,0.0101],[109.4,5.17183642],[109.39,0.25],[109.27,0.25],[109.239,0.017],[109.18,0.8502 ],[109.176,2.583],[109.061,0.1],[109.02,0.01],[109.01,2.9652],[109.002,0.011],[109,2.48760606],[108.96,0.01],[108.834,0.0122],[108.685,0.017],[108.65,0.261211 22],[108.61,3.7799184],[108.6,22.45158424],[108.59,5.9299154],[108.56,0.25],[108.52,0.02],[108.51,0.7],[108.502,0.011],[108.5,6.47790337],[108.42,1.25680822], [108.352,0.030764],[108.3,0.55],[108.29,0.25],[108.25,1.05030486],[108.131,0.017],[108.13,1.453],[108.1,4.55772433],[108.085,0.011],[108.084,0.01],[108.07,0.0 5201],[108.06,0.2555],[108.02,9.794],[108.01,0.0202],[108.002,0.011],[108,35.30530543],[107.945,2.2234],[107.847,0.5563],[107.8,0.05],[107.75,0.05],[107.74,0. 25],[107.7,0.1],[107.685,11.972857],[107.66,0.0553],[107.6,0.35039174],[107.577,0.03704008],[107.539,0.2],[107.53,0.03],[107.52,5],[107.51,0.71513592],[107.50 2,0.011],[107.5,8.202],[107.47,0.01],[107.43,0.51262715],[107.4,0.4],[107.348,0.027],[107.337,0.2],[107.33,0.8],[107.32,0.2],[107.3,0.4],[107.28,0.09],[107.21 ,0.45],[107.18,0.02],[107.17,0.02],[107.12,1.59895495],[107.111,0.01],[107.1,3.10063865],[107.023,0.017],[107.01,1.16919169],[107.002,0.011],[107,24.92454336] ,[106.93,3],[106.9,1],[106.838,0.32819],[106.76,0.01683],[106.63,1.35803264],[106.614,0.0235],[106.6,0.2056],[106.54,0.04],[106.517,0.01],[106.502,0.011],[106 .5,24.31393613],[106.469,0.017],[106.44,0.01872844],[106.411,0.01],[106.41,0.011],[106.4,1],[106.305,0.01],[106.25,2.91808503],[106.21,10],[106.2,23.19],[106. 12,0.92432135],[106.1,40.05754467],[106.01,10.0617591],[106.002,0.011],[106,18.16052253],[105.99,499.22271165],[105.94,0.7],[105.915,0.017],[105.9,1.2525],[10 5.89,0.664],[105.72,4],[105.711,0.040504],[105.6,3.49097394],[105.56,0.4],[105.55,0.05],[105.502,0.011],[105.5,1.55],[105.45,0.304844],[105.42,1.10233139],[10 5.361,0.017],[105.36,0.011]]}</pre> C:\Apache24\htdocs>php bot.php .E1-E2-E3 C:\Apache24\htdocs> So I don't think I'm running up against the DDOS protection. I've been wracking my brain for 2 days and can't figure it out. What version of php do you run? Maybe that has something to do with it? Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: miaviator on May 12, 2013, 09:38:33 PM I'm running PHP 5.3.2-1ubuntu4.19 with Suhosin-Patch (cli)
Try changing this code block out with the changes below and past the output, this should show what's happening. Code: while( empty($BTCtoUSD) || empty($LTCtoBTC) || empty($LTCtoUSD) ){ TO: Code: while( empty($BTCtoUSD) || empty($LTCtoBTC) || empty($LTCtoUSD) ){ Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: grabble on May 12, 2013, 09:49:37 PM C:\Apache24\htdocs>php bot.php
.E1Array ( ) Array ( ) Array ( ) -E2Array ( ) Array ( ) Array ( ) -E3Array ( ) Array ( ) Array ( ) -E4Array ( ) Array ( ) Array ( ) -E5 I don't even know what to make of it, it's not returning anything it appears. I'm going to try downgrading my PHP as I'm running 5.4.15 maybe this will help? I don't really see why else it does not seem to work. Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: grabble on May 12, 2013, 10:40:11 PM Holy crap. Progress! (I think).
I started to understand php more and got suspicious of the send function. I modified the function's options to this: Code:
I seem to be getting this: Code: C:\Apache2\htdocs>php bot.php At least it's not getting errors anymore right? I think it had to do with SSL using HTTPS. It was giving curl an error that wasn't coming over to the php side for me to see but when I started messing with curl I realized it was getting a certificate error ... Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: miaviator on May 12, 2013, 11:15:28 PM Nice! I would assume it has something to do with the windows vs linux curl and ssl implementations?
That output shows it's searching for trades. If you change debug from NULL to TRUE it will spit out some more information. Keep in mind debug has to be off in order to complete any trades as it takes to much time for php to print messages between trades. Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: grabble on May 13, 2013, 09:35:26 AM It's officially working, I appreciate the help! It totally was the SSL.
My fix should work for anyone using Windows who wants to run the bot. Thanks again, I'll donate my first week of profit and a little extra next Sunday for taking the time to code this thing and help me out. Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: Eb0la on May 27, 2013, 03:43:52 AM It's officially working, I appreciate the help! It totally was the SSL. My fix should work for anyone using Windows who wants to run the bot. Thanks again, I'll donate my first week of profit and a little extra next Sunday for taking the time to code this thing and help me out. Hi! I am giving this a try to see how it performs. I tried out grabble's fix on windows here and can confirm it successfully fixed the issue for me as well. Loaded the account with a couple LTC and smaller amounts of BTC so its not a huge loss if I do lose :D I will donate some of my profits if I am successful aswell! Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: billotronic on May 27, 2013, 12:19:48 PM Tried running this to see what it would do and it's throwing me these errors:
Code: gdlinux@gdlinux:~/Desktop$ php phpbot.php and this is a little beyond me to figure out. I set debug to TRUE and the output did not give me any more hints. Thoughts? Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: Eb0la on May 27, 2013, 10:54:24 PM Tried running this to see what it would do and it's throwing me these errors: Code: gdlinux@gdlinux:~/Desktop$ php phpbot.php and this is a little beyond me to figure out. I set debug to TRUE and the output did not give me any more hints. Thoughts? My guess would be that you don't have the Curl extension installed for PHP Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: Seal on May 29, 2013, 11:29:21 AM Is arbitrage still profitable? and how has your experience been so far running this? I ran an arb bot for a long time and it was very profitable. I stopped it to pursue more profitable ventures, i monitor the prices a lot still (out of habit) and see a lot of arb opportunities. Good luck to those running the script. The more arbitrage there is, the more efficient the market will become. Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: miaviator on May 29, 2013, 12:57:58 PM Is arbitrage still profitable? and how has your experience been so far running this? I ran an arb bot for a long time and it was very profitable. I stopped it to pursue more profitable ventures, i monitor the prices a lot still (out of habit) and see a lot of arb opportunities. Good luck to those running the script. The more arbitrage there is, the more efficient the market will become. Thank you for pointing that out! Since exchanges are not internally arbitrating and there is no open cooperation to create an inter-exchange arbitration system the markets have strange gaps in prices and exchange rates. In an ideal system the prices and rates would automatically even out over all of the exchanges (which could also reduce BTC's price correlation to gox uptime). Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: miaviator on May 29, 2013, 01:00:03 PM Tried running this to see what it would do and it's throwing me these errors: Code: gdlinux@gdlinux:~/Desktop$ php phpbot.php and this is a little beyond me to figure out. I set debug to TRUE and the output did not give me any more hints. Thoughts? My guess would be that you don't have the Curl extension installed for PHP I would agree that curl_init() error would tell me you don't have the curl extension. Also this is odd "PHP Warning: fopen(nonce): failed to open stream: No such file or directory in /home/gdlinux/Desktop/phpbot.php on line 689" Try creating an empty file called nonce with no extension at /home/gdlinux/Desktop/nonce and see if that helps. Code: touch /home/gdlinux/Desktop/nonce Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: Seal on May 29, 2013, 01:02:41 PM Is arbitrage still profitable? and how has your experience been so far running this? I ran an arb bot for a long time and it was very profitable. I stopped it to pursue more profitable ventures, i monitor the prices a lot still (out of habit) and see a lot of arb opportunities. Good luck to those running the script. The more arbitrage there is, the more efficient the market will become. Thank you for pointing that out! Since exchanges are not internally arbitrating and there is no open cooperation to create an inter-exchange arbitration system the markets have strange gaps in prices and exchange rates. In an ideal system the prices and rates would automatically even out over all of the exchanges (which could also reduce BTC's price correlation to gox uptime). Thats the whole idea of people running arb bots, as well as giving them profits, it helps normalise the prices across each exchange. At the moment MtGox still leads price movements. As for internal arb, an exchange trading on its own books isn't good practise and is a severe conflict of interest as they would easily have the capability to both under cut everyone and perform 'front running'. Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: grabble on May 29, 2013, 06:26:46 PM I've been mining LTC and depositing directly to my btc-e account, running the arb bot to find the most profitable path to BTC on btc-e then sending the BTC to gox to cash out for USD and take advantage of the price difference. It's a rather round-a-bout way of going about things but it works out pretty well.
Also I figured out if you put in a support request with btc-e and ask them to white list your IP address it will stop your bot from getting blocked and eliminate the need for the round robin script. I would highly suggest anyone using their API to ask them to white list their IP address. Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: billotronic on May 29, 2013, 07:12:37 PM well shit, I didn't even spot the (obvious) curl call. Shame on me.
Curl alone did not sort it out. I had to create the nonce file and now the bot is spitting out what looks like morse code so I guess its working now. Thanks! [edit] ok, i will bite. this is what the output looks like Code: #screen -dmS arbot -h 1024 -L ./roundrobin.sh Reading the translation of this I ASSUME all is well and the script just does not see a profitable path? Reason I ask is becuase this looks nothing like Jude Austin's output he posted. Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: steganos on May 29, 2013, 10:10:24 PM Is arbitrage still profitable? and how has your experience been so far running this? Arbitrage is less profitable now that a lot of bots exist. As I said I have abandoned this for a rolling buy sell bot which is proving more profitable. I did make several B over the course of a few weeks using this bot. I would think that other exchanges and auto transfers could be added in order to take advantage of the dozen or so alts out there with different prices and faster transaction times than B. All of that said. I'm not one to turn down making even $.01 a day while I sleep, eat and work. Free money is free money. Can you point a noob to something that explains what the strategy is for a rolling buy sell bot? Thanks. Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: miaviator on May 30, 2013, 01:02:42 AM well shit, I didn't even spot the (obvious) curl call. Shame on me. Curl alone did not sort it out. I had to create the nonce file and now the bot is spitting out what looks like morse code so I guess its working now. Thanks! [edit] ok, i will bite. this is what the output looks like Code: #screen -dmS arbot -h 1024 -L ./roundrobin.sh Reading the translation of this I ASSUME all is well and the script just does not see a profitable path? Reason I ask is becuase this looks nothing like Jude Austin's output he posted. Lol, to all of the above. That output is really good. - = Duplicate order book pulled, (nothing has changed and there was no profit in the last pull) . = Order book analysed, (no profitable paths found) # = trade legs attempted (according to your output the bot attempted over a dozen profitable trade legs!) Check your order history and see if you completed any trade routes or if you only made it through the first one or two legs. The script does currency clearing back to BTC even if it's at a loss just to avoid staying in U or L. The issue with arbitrage is that after you execute trade 1 say B to U, someone could eat the U to L trade before you trade it or the L to B trade which often leaves you way into U or L. I installed currency clearing in leg 3 and non-repeat trading in leg two (originally I installed currency clearing in leg two, it caused the script to rotate between L and U, U and L losing commissions) Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: miaviator on May 30, 2013, 01:22:57 AM Is arbitrage still profitable? and how has your experience been so far running this? Arbitrage is less profitable now that a lot of bots exist. As I said I have abandoned this for a rolling buy sell bot which is proving more profitable. I did make several B over the course of a few weeks using this bot. I would think that other exchanges and auto transfers could be added in order to take advantage of the dozen or so alts out there with different prices and faster transaction times than B. All of that said. I'm not one to turn down making even $.01 a day while I sleep, eat and work. Free money is free money. Can you point a noob to something that explains what the strategy is for a rolling buy sell bot? Thanks. BTC to USD rolls, as in the value repeatedly crosses the same point or the same trailing/advancing points. In it's simplest form a lot of people roll BTC just by buying at 120,110,100,90,80 and selling at 100,110,120,130. In a more advanced form BTC experiences hundreds of micro spikes and dips (my trade engine V2) which lets you buy at 114.26 and sell at 114.84 etc. Code: Buy = Last*(1-.002)*((1-$profitThreshold/2)^(1+iteration)) In a more advanced form, BTC experiences macro-rolls of 2-10% on a daily/weekly/monthly basis allowing you to buy at almost any price and sell at an advancing price of +2.5/5/10% while at the same time experiencing micro-rolls mentioned above (my trade engine V3) Code: Sell = Dolar Cost Average /(1-.002)/(1-.002)/((1-$biggerProfitThreshold)^(1+iteration)) In an even more advanced form, BTC Appreciates and Depreciates to USD at different intervals (rolling price) and moves toward and away from a rolling 24 hour high and low. If you were always 100% in BTC as it approached and broke the high, and were always 100% in USD as BTC approached and broke the low, you would profit (a lot) from the resulting appreciation of BTC vs USD and USD vs BTC. Code: Omitted The n00b answer is "a rolling bot, automatically buys low and sells high using a very volatile vehicle" My trade history for the first three versions of the engine show low buys followed by high sells in each version. They also show an overall loss due to B appreciation beating the profit from rolling. If the price of B slowly declined I would have made a profit from the micro and macro rolls in addition to USD vs BTC appreciation. Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: billotronic on May 30, 2013, 02:10:05 AM Well hello mr fancy pants...
Thank you for the technical answer and the fun code to play with. Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: steganos on May 30, 2013, 02:29:09 AM Thank you for the excellent explanation.
Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: billotronic on May 30, 2013, 02:56:54 PM Question about this:
Code: //Programs Is this just informative? Glancing through the code I did not see a place to set this. Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: miaviator on May 30, 2013, 05:02:37 PM Question about this: Code: //Programs Is this just informative? Glancing through the code I did not see a place to set this. I try to keep a changelog and bug log inside my code, this was just the rewrite log for ARBOT which is now: Code: //////////////////////////////////////////////////////////////////// Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: billotronic on May 30, 2013, 06:56:11 PM Groovy... I'm glad I did not miss something (again) when going through the code. Fun stuff.
Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: snowcrashed on May 30, 2013, 07:00:07 PM Hmm tried to get this running in windows with XAMPP. I applied grabble's fix and when that was still giving E1.E2.E3 error I tried miaviator's code change for outputting more info. This is what I get:
Code: C:\xampp\php>php test.php It does this 5 times then exits. I thought maybe I copy/pasted something wrong but repeated the process twice and still get the same error. Not sure why it thinks postData and headers are undefined, I see them being defined right before this function. Edit: Ah nevermind looks like I messed something up when I entered my api key/secret. I'm use to programming languages that don't mind if you take a space out. Ran it for a bit, got a bunch of - and . then E1E2E3. I checked the btc-e.com/api links and get data returned so I don't think the IP was banned. Ran it a second time and got ".E1-E2-E3". When I apply miaviator's change to the Code: while( empty($BTCtoUSD) || empty($LTCtoBTC) || empty($LTCtoUSD) ){ Edit Again: Well it appeared to be working and it executed some trades (created an order/cancelled it/sold LTC for USD) but then it ended with an E1E2E3 again. Tried running it again and now I'm back to ".E1-E2-E3" then terminates. Any idea what could be causing this? And the btc-e.com/api links are all still accessible and return data so my IP isn't blocked. Just to be thorough I connected to a VPN and tried running the bot again, still no luck. It seems like there is some sort of "timeout". After running the bot successfully for ~10 minutes it returns E1E2E3 then becomes unusable for about 15-20 minutes. After that timeout it will work again, but this process just repeats itself. Tried changing the api key/secret to a new one just to see if it was being tracked by that, but no luck. Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: miaviator on May 30, 2013, 09:16:42 PM Edit Again: Well it appeared to be working and it executed some trades (created an order/cancelled it/sold LTC for USD) but then it ended with an E1E2E3 again. Tried running it again and now I'm back to ".E1-E2-E3" then terminates. Any idea what could be causing this? And the btc-e.com/api links are all still accessible and return data so my IP isn't blocked. Just to be thorough I connected to a VPN and tried running the bot again, still no luck. It seems like there is some sort of "timeout". After running the bot successfully for ~10 minutes it returns E1E2E3 then becomes unusable for about 15-20 minutes. After that timeout it will work again, but this process just repeats itself. Tried changing the api key/secret to a new one just to see if it was being tracked by that, but no luck. You may need to space out your API requests a little more, or remove the Code: exit; Try upping the nano-sleep variable to something like 500000000 if it works you can reduce it by a few million every hour or so. Code: //100,001-999,999,999 max wait between non-trade & book duplications reduced 1.2.3.4. Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: snowcrashed on May 30, 2013, 11:22:48 PM That seems to have done it, thanks. Though now the activity level is way down. I was getting at least a couple of trades per 10-15 mins, now I just ran for an hour and only 1. Forgive my ignorance if the lack of trades is just a product of current market prices, but are there other settings that are tweakable to increase activity?
Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: billotronic on May 30, 2013, 11:44:33 PM That seems to have done it, thanks. Though now the activity level is way down. I was getting at least a couple of trades per 10-15 mins, now I just ran for an hour and only 1. Forgive my ignorance if the lack of trades is just a product of current market prices, but are there other settings that are tweakable to increase activity? That is what I assumed but I never posted any trades. I tried dropping the %'s and starting B U L and no noticeable effect. Very curious. Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: alexxy on May 31, 2013, 07:57:45 AM Any updates to code? BTW why dont put it on github?
Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: miaviator on May 31, 2013, 12:19:11 PM Any updates to code? BTW why dont put it on github? I moved on from the project so no updates, if you request something here I might be able to modify it. I don't know anything about github. Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: miaviator on May 31, 2013, 12:31:03 PM That seems to have done it, thanks. Though now the activity level is way down. I was getting at least a couple of trades per 10-15 mins, now I just ran for an hour and only 1. Forgive my ignorance if the lack of trades is just a product of current market prices, but are there other settings that are tweakable to increase activity? Ideally to make the most trades: (when I was running this my account had at least 100 trades per day) 1. You need a low latency to cloudflare and btc-e (fast connection or tier 1 network, or server in russia?) 2. The script needs to be able to run with no timers firing. 3. The script needs to print no output or only print output if a trade path was analyzed and no profit was found. 4. fastTrade should be enabled! - This again ideally will cause the script to fire all three trades with no error checking and no currency clearing. The best chance to complete three trade legs is to complete them sequentially as soon as they are found. The issue is that this method will leave your funds stuck in whatever the last currency leg that filled was. Since I normally run bots to make the exchange a higher profit (.2%-.6% to exchange vs .1% to me) there can be a loss when converting back to the original currency. In the crypto currency world it is dangerous to sit in anything other than 50%Crypto 50%USD continuously balanced since the prices are extremely volatile. To make the most profit, the script should detect price trends in BTC and trade B to B while the price is rising and U to U while the price is falling. Or swap from B to U to ensure a 50% balance in the portfolio. Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: alexxy on May 31, 2013, 01:20:00 PM Can you share your latest version of this script?
Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: miaviator on May 31, 2013, 02:01:54 PM Can you share your latest version of this script? This is the latest version of the arbitrage script, I can't share any of the rolling engines yet. Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: snowcrashed on May 31, 2013, 08:12:07 PM That seems to have done it, thanks. Though now the activity level is way down. I was getting at least a couple of trades per 10-15 mins, now I just ran for an hour and only 1. Forgive my ignorance if the lack of trades is just a product of current market prices, but are there other settings that are tweakable to increase activity? Ideally to make the most trades: (when I was running this my account had at least 100 trades per day) 1. You need a low latency to cloudflare and btc-e (fast connection or tier 1 network, or server in russia?) 2. The script needs to be able to run with no timers firing. 3. The script needs to print no output or only print output if a trade path was analyzed and no profit was found. 4. fastTrade should be enabled! - This again ideally will cause the script to fire all three trades with no error checking and no currency clearing. The best chance to complete three trade legs is to complete them sequentially as soon as they are found. The issue is that this method will leave your funds stuck in whatever the last currency leg that filled was. Since I normally run bots to make the exchange a higher profit (.2%-.6% to exchange vs .1% to me) there can be a loss when converting back to the original currency. In the crypto currency world it is dangerous to sit in anything other than 50%Crypto 50%USD continuously balanced since the prices are extremely volatile. To make the most profit, the script should detect price trends in BTC and trade B to B while the price is rising and U to U while the price is falling. Or swap from B to U to ensure a 50% balance in the portfolio. Hmm tried running it in fastTrade mode and every trade path it finds, it cancels the order immediately afterwards. I set minbidusd/maxbidusd to = $5, in my account I have more than that so I figured that was a good place to start unless I'm not understanding what those variables stand for. Also, how can I optimize the settings for minbid/maxbid related to me account? And thanks for releasing this code to the public as well as helping us get it running. If I see some profits from this I will definitely be sending some your way. Edit: Left it running for about 24 hours and seems like every O is followed by a C soon after, running fasttrade or not. Is this normal behavior? Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: billotronic on June 01, 2013, 04:27:36 AM That seems to have done it, thanks. Though now the activity level is way down. I was getting at least a couple of trades per 10-15 mins, now I just ran for an hour and only 1. Forgive my ignorance if the lack of trades is just a product of current market prices, but are there other settings that are tweakable to increase activity? Ideally to make the most trades: (when I was running this my account had at least 100 trades per day) 1. You need a low latency to cloudflare and btc-e (fast connection or tier 1 network, or server in russia?) 2. The script needs to be able to run with no timers firing. 3. The script needs to print no output or only print output if a trade path was analyzed and no profit was found. 4. fastTrade should be enabled! - This again ideally will cause the script to fire all three trades with no error checking and no currency clearing. The best chance to complete three trade legs is to complete them sequentially as soon as they are found. The issue is that this method will leave your funds stuck in whatever the last currency leg that filled was. Since I normally run bots to make the exchange a higher profit (.2%-.6% to exchange vs .1% to me) there can be a loss when converting back to the original currency. In the crypto currency world it is dangerous to sit in anything other than 50%Crypto 50%USD continuously balanced since the prices are extremely volatile. To make the most profit, the script should detect price trends in BTC and trade B to B while the price is rising and U to U while the price is falling. Or swap from B to U to ensure a 50% balance in the portfolio. Even if you are on to better things, we the people, greatly appreciate you sharing your work. I've rekindled an interest in coding due to looking at and tinkering with the bots on here for btc-e. Good times. Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: bbulker on June 01, 2013, 06:06:58 AM I probably won't be using this, but I like your code and found it interesting to see a trading bot's source code. Thanks.
Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: Seal on June 01, 2013, 12:50:31 PM That seems to have done it, thanks. Though now the activity level is way down. I was getting at least a couple of trades per 10-15 mins, now I just ran for an hour and only 1. Forgive my ignorance if the lack of trades is just a product of current market prices, but are there other settings that are tweakable to increase activity? Ideally to make the most trades: (when I was running this my account had at least 100 trades per day) 1. You need a low latency to cloudflare and btc-e (fast connection or tier 1 network, or server in russia?) 2. The script needs to be able to run with no timers firing. 3. The script needs to print no output or only print output if a trade path was analyzed and no profit was found. 4. fastTrade should be enabled! - This again ideally will cause the script to fire all three trades with no error checking and no currency clearing. The best chance to complete three trade legs is to complete them sequentially as soon as they are found. The issue is that this method will leave your funds stuck in whatever the last currency leg that filled was. Since I normally run bots to make the exchange a higher profit (.2%-.6% to exchange vs .1% to me) there can be a loss when converting back to the original currency. In the crypto currency world it is dangerous to sit in anything other than 50%Crypto 50%USD continuously balanced since the prices are extremely volatile. To make the most profit, the script should detect price trends in BTC and trade B to B while the price is rising and U to U while the price is falling. Or swap from B to U to ensure a 50% balance in the portfolio. Even if you are on to better things, we the people, greatly appreciate you sharing your work. I've rekindled an interest in coding due to looking at and tinkering with the bots on here for btc-e. Good times. I've found that latency mostly isn't relevant for bitcoin exchanges. As long as your server is in europe it will make very little difference. What I have found is that establishing the connection for a http trade call (from php) will take anywhere between 0.5 and 1.0 second regardless of where your location is. This in relative terms is massive. Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: miaviator on June 02, 2013, 02:07:05 AM That seems to have done it, thanks. Though now the activity level is way down. I was getting at least a couple of trades per 10-15 mins, now I just ran for an hour and only 1. Forgive my ignorance if the lack of trades is just a product of current market prices, but are there other settings that are tweakable to increase activity? Ideally to make the most trades: (when I was running this my account had at least 100 trades per day) 1. You need a low latency to cloudflare and btc-e (fast connection or tier 1 network, or server in russia?) 2. The script needs to be able to run with no timers firing. 3. The script needs to print no output or only print output if a trade path was analyzed and no profit was found. 4. fastTrade should be enabled! - This again ideally will cause the script to fire all three trades with no error checking and no currency clearing. The best chance to complete three trade legs is to complete them sequentially as soon as they are found. The issue is that this method will leave your funds stuck in whatever the last currency leg that filled was. Since I normally run bots to make the exchange a higher profit (.2%-.6% to exchange vs .1% to me) there can be a loss when converting back to the original currency. In the crypto currency world it is dangerous to sit in anything other than 50%Crypto 50%USD continuously balanced since the prices are extremely volatile. To make the most profit, the script should detect price trends in BTC and trade B to B while the price is rising and U to U while the price is falling. Or swap from B to U to ensure a 50% balance in the portfolio. Even if you are on to better things, we the people, greatly appreciate you sharing your work. I've rekindled an interest in coding due to looking at and tinkering with the bots on here for btc-e. Good times. I've found that latency mostly isn't relevant for bitcoin exchanges. As long as your server is in europe it will make very little difference. What I have found is that establishing the connection for a http trade call (from php) will take anywhere between 0.5 and 1.0 second regardless of where your location is. This in relative terms is massive. That is an excellent point! It would be good to open a connection with curl (or websocket) and feed things through it vs opening a new session every time. I don't have any servers in europe? can I borrow one? Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: miaviator on June 02, 2013, 02:12:00 AM That seems to have done it, thanks. Though now the activity level is way down. I was getting at least a couple of trades per 10-15 mins, now I just ran for an hour and only 1. Forgive my ignorance if the lack of trades is just a product of current market prices, but are there other settings that are tweakable to increase activity? Ideally to make the most trades: (when I was running this my account had at least 100 trades per day) 1. You need a low latency to cloudflare and btc-e (fast connection or tier 1 network, or server in russia?) 2. The script needs to be able to run with no timers firing. 3. The script needs to print no output or only print output if a trade path was analyzed and no profit was found. 4. fastTrade should be enabled! - This again ideally will cause the script to fire all three trades with no error checking and no currency clearing. The best chance to complete three trade legs is to complete them sequentially as soon as they are found. The issue is that this method will leave your funds stuck in whatever the last currency leg that filled was. Since I normally run bots to make the exchange a higher profit (.2%-.6% to exchange vs .1% to me) there can be a loss when converting back to the original currency. In the crypto currency world it is dangerous to sit in anything other than 50%Crypto 50%USD continuously balanced since the prices are extremely volatile. To make the most profit, the script should detect price trends in BTC and trade B to B while the price is rising and U to U while the price is falling. Or swap from B to U to ensure a 50% balance in the portfolio. Hmm tried running it in fastTrade mode and every trade path it finds, it cancels the order immediately afterwards. I set minbidusd/maxbidusd to = $5, in my account I have more than that so I figured that was a good place to start unless I'm not understanding what those variables stand for. Also, how can I optimize the settings for minbid/maxbid related to me account? And thanks for releasing this code to the public as well as helping us get it running. If I see some profits from this I will definitely be sending some your way. Edit: Left it running for about 24 hours and seems like every O is followed by a C soon after, running fasttrade or not. Is this normal behavior? The difference between fastrade and standard is that in standard the bot polls your balance after every trade. In fast mode it doesn't care if the orders place fill fail. it just attempts to set the orders and then immediately cancels anything that doesn't fill. Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: snowcrashed on June 06, 2013, 06:23:36 PM Well I spent a few more days running this/playing around with settings and I simply can't get it to trade consistently, let alone for a profit. Thanks for releasing this to the public anyhow, maybe I'm just not using it properly.
Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: Lgetty17 on June 12, 2013, 04:10:36 PM How exactly do I make this work??? What do I do with the script? paste it into DOS or Python or something? I hate not knowing anything about coding, since everything surrounding bitcoin is so coding-intensive
Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: Eb0la on June 12, 2013, 05:05:04 PM How exactly do I make this work??? What do I do with the script? paste it into DOS or Python or something? I hate not knowing anything about coding, since everything surrounding bitcoin is so coding-intensive upload to webserver -> Go to address :) As long as all dependancies are setup you should be good to go. Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: Queezy on June 14, 2013, 08:57:45 PM How exactly do I make this work??? What do I do with the script? paste it into DOS or Python or something? I hate not knowing anything about coding, since everything surrounding bitcoin is so coding-intensive upload to webserver -> Go to address :) As long as all dependancies are setup you should be good to go. Webserver? So does this mean it won't run on a desktop pc? If anyone feel's like giving an oversimplified explanation (or a link) of how to run a script/program like this it would be very much appreciated. :) I've looked at some very simple java stuff before (should I admit it was minecraft or hide that in shame? lol.) And I have worked on a website or two, but only through a control panel and UI with alot of drag n drop, so I really know almost nothing about what it takes to code or run these types of bots. Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: Eb0la on June 14, 2013, 10:13:52 PM Install WAMP
Edit PHP.INI and make sure CURL is enabled copy script to WAMP PHP directory (call the file bot.php) open command prompt change directory to the WAMP instead PHP version run "php.exe bot.php" it starts scanning / trading *********DON'T FORGET TO EDIT SETTINGS IN SCRIPT!!!* If you can't get it running I would suggest to just leave it alone then as it has the potential to lose your BTC / LTC / USD if not configured correctly. Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: smscotten on June 21, 2013, 07:54:25 PM What does it mean if I'm getting numbers in my output but trades aren't actually happening?
------.---------.----------------------------------.-----------------------------------.-.--------------------------------.--.-.-.3.-..-.--.-.-.----.-.--.----.---.----.----.----.-.----.------.-..-------..------.-.--.----.-.----.--.--------------------------------..------.7-.----.1-----..-.-.--.-.-.1.-----..-.-.-.--.1.----------.-...--.-------------.----.-.--.------.3.--.-.----.---.------.---------------------.2--.-.-----------.----.1------.--.-------------.----.-----------.---------.----.-----------------------------------------.----.------------------------------------------.--.------.--.-.-----------.----.---------.----.------.-----------.-.--.------------.--------.--------------.----.------.--.----------------.----.------.-.--.------.--------.1.------.----.----.----.-.--------.1.-.----.2-----.---------.------------.------.-----------.1--.---.------.----------------.----..---.--------- Have I done something wrong? The script is running and it did trigger one transaction when I started running it, but since then no. Thanks! Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: ForumAcc on June 21, 2013, 07:57:14 PM That output is good but the arbitrage opportunities are too small now, it would take a revamp of the fee system to allow them to arb bots properly, i ran this bot on 2 Triples BTC/LTC/RUR and USD for a week for little value.
Im pretty sure that btc-e has its own feeless arb bots running. Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: smscotten on June 21, 2013, 09:12:03 PM Well, I'm not too worried about losing the vast US$5.38 total of all my currencies combined in an experiment that doesn't go anywhere. I'm mining on CPU and a crappy Nvidia GPU so you have to know it's about figuring out how all this works not about making money. Later perhaps I'll get serious about making money but right now it's like model rocketry—I expect it to teach me about the right shape of a nose cone, not take me to the moon.
In other words, let me make mistakes on small numbers before I try to screw myself up with big ones. Looks like I'm not getting anywhere without being on Fast Trade. When I'm on Fast Trade it made me about two cents in an hour. So I'm calling this a successful experiment. Thanks! Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: JstnPwll on July 05, 2013, 09:02:20 PM Is the currency change function usable in its current state? Where would I put the call if I wanted to use it?
Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: JstnPwll on July 07, 2013, 02:18:50 PM Well, after tinkering with this for a while, I've come to the conclusion that either a.) I don't know how to configure it, or b.) It no longer works properly and needs updates. I've let it run for a while with a small amount of funds to play with...it hardly ever makes trades, and I have yet to see a profitable one. I always end up with less than I had before trading.
Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: Financisto on November 20, 2013, 04:27:44 AM Greetings!
Nice script. Thanks for sharing it. It's been a while since BTC-e, Vircurex and Cryptsy added some more altcoins. BTW, is it possible to add automated (triangular and 2-currency) arbitrage for altcoins pairs (LTC/BTC; NMC/BTC; PPC/BTC; XPM/BTC etc.)? Keep up the good work! Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: miaviator on November 20, 2013, 05:42:57 AM Greetings! Nice script. Thanks for sharing it. It's been a while since BTC-e, Vircurex and Cryptsy added some more altcoins. BTW, is it possible to add automated (triangular and 2-currency) arbitrage for altcoins pairs (LTC/BTC; NMC/BTC; PPC/BTC; XPM/BTC etc.)? Keep up the good work! I did try to implement multi currency legs using 3-6 hops vs the current system. The issue was speed and getting an open socket on e proved unreliable. If someone can build a php socket allowing data to pass without opening a new curl session each request this would be possible. The math on dynamic arbitrage is strange though it can be created for this many legs. I'll be testing some new price rolling engines with EMA soon and will post any working code here so someone better than me can work with it. Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: Timmieman on November 29, 2013, 04:12:39 PM I`ve fixed the bot with help of the 2 fixes and it's currently running.
Though after 24 hours the only thing it has traded is converted all BTC to USD, though in the code it states that it should 50/50 the amount in BTC and USD? What could be the reason behind this? My total finances where 6 times the minimum trading amount With best regards, Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: aideed on November 29, 2013, 07:49:18 PM thanks for posting this here, really fun to look through and play with.
Quote There is also an unfinished currency change function which would allow you to swap from B to U when the price of B is falling and U to B when it is rising. This actually works really well, you can take advantage of arbitrage in either currency while holding funds in the most profitable currency. what needs finishing to make this active? Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: Timmieman on November 30, 2013, 04:26:46 PM This might be quite a silly question:
In the case of a Bitcoin -> Litecoin > Dollar > Bitcoin transaction, does there have to be finances in all valuta? So does the arbitrage bot trade Bitcoin to litecoin, then litecoin to dollar and dollar to bitcoin, or all at the same time? With best regards, Tim Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: adamnyc on December 03, 2013, 02:59:03 PM Greetings! Nice script. Thanks for sharing it. It's been a while since BTC-e, Vircurex and Cryptsy added some more altcoins. BTW, is it possible to add automated (triangular and 2-currency) arbitrage for altcoins pairs (LTC/BTC; NMC/BTC; PPC/BTC; XPM/BTC etc.)? Keep up the good work! I did try to implement multi currency legs using 3-6 hops vs the current system. The issue was speed and getting an open socket on e proved unreliable. If someone can build a php socket allowing data to pass without opening a new curl session each request this would be possible. The math on dynamic arbitrage is strange though it can be created for this many legs. I'll be testing some new price rolling engines with EMA soon and will post any working code here so someone better than me can work with it. Greetings! Nice script. Thanks for sharing it. It's been a while since BTC-e, Vircurex and Cryptsy added some more altcoins. BTW, is it possible to add automated (triangular and 2-currency) arbitrage for altcoins pairs (LTC/BTC; NMC/BTC; PPC/BTC; XPM/BTC etc.)? Keep up the good work! I did try to implement multi currency legs using 3-6 hops vs the current system. The issue was speed and getting an open socket on e proved unreliable. If someone can build a php socket allowing data to pass without opening a new curl session each request this would be possible. The math on dynamic arbitrage is strange though it can be created for this many legs. I'll be testing some new price rolling engines with EMA soon and will post any working code here so someone better than me can work with it. Hey - just sent you a PM. I have my own code going - not clean enough to post here yet. I have the techniques for the sockets, I do not know enough about the techniques for what to do when quite yet. I agree the math gets strange ... Fun stuff. The rolling bots I find fascinating when playing with the orderbooks as well. The arb bots seem OK to a point ... Have you seen this implemented at cryptsy or others yet? Thanks for this thread, its refreshing! Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: daybyter on December 03, 2013, 06:29:31 PM Does this strategy still work? I wrote a similar bot, but gave up on it, because all those bots at btc-e made it impossible to be proftiable, if you respect the request limits.
Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: Financisto on December 04, 2013, 01:19:29 AM It seems that High-frequency trading is getting too popular in cryptocoin world nowadays...
Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: daybyter on December 04, 2013, 03:26:52 PM I'd like to do HFT, but since you can only fetch the prices every 15s, or so, it's practically impossible. Maybe with a network of servers, or so. But I only have 1 server atm, so I gave up on this for now...
Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: miaviator on December 11, 2013, 02:10:53 AM Rolling Bot code posted: https://bitcointalk.org/index.php?topic=366546.0 (https://bitcointalk.org/index.php?topic=366546.0)
Title: Re: BTC-E PHP Currency Arbitrage Bot Full Code Post by: BTC Turkiye on November 04, 2014, 06:50:33 PM 1- Does this still work?
2- Which areas we need to change to make it work? Right now If I just save the code as index.php and view it in a browser, it shows me a blank screen. 3- What is the easiest and most simple way to run this? Thanks for your help |