Pages:
Author

Topic: BTC-E + GOX Rolling bot, Rocking bot, Trading bot, Full-Code (Read 22531 times)

donator
Activity: 686
Merit: 519
It's for the children!
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

I still can't believe this code is still being looked at and used!

I have no idea on a simple way to run it, I'd call a PHP developer to get it running at this point.
newbie
Activity: 19
Merit: 0
I unzipped all files, edited config file for set BTC-e APIs but when I run arbor.php still loading.... I'm using MAMP

Thanks
sr. member
Activity: 472
Merit: 254
Anlik Coin Fiyatlari BTCkur.com
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
newbie
Activity: 2
Merit: 0
I don't know what you did there.  It's like you activated all of the engine's running code without activating an engines variables?
I'm sorry to say that, but I'm totally noob in programming and coding, so I'll put here as much info as I can.
-I've put to bot as many "patches" as I could. In fact - messed this thing up. So today I've downloaded fresh zip file from github and I'm working on it now.
-Config.php filled with my API data, arbot.php set to run EMA engine.
-Fixed nonce bug
Code:
Array
(
    [success] => 0
    [error] => invalid nonce parameter; on key:1399375681, you sent:5
)

Error pulling data.  Error #: 2

Code:
//Create nonce
$mt = explode(' ', microtime());
$nonce = $mt[1];
Despite of this I get still the same errors:
Code:
PHP Notice:  Undefined variable: EMA in /home/roko/Pobrane/bitcoin-rolling-bot-php-master/engine_ema.php on line 9
PHP Notice:  Undefined variable: BALANCE in /home/roko/Pobrane/bitcoin-rolling-bot-php-master/engine_balance.php on line 14
PHP Notice:  Undefined variable: JOSH in /home/roko/Pobrane/bitcoin-rolling-bot-php-master/engine_josh.php on line 9
PHP Notice:  Undefined variable: microSellDivisor in /home/roko/Pobrane/bitcoin-rolling-bot-php-master/arbot.php on line 177
PHP Notice:  Undefined variable: microAmount in /home/roko/Pobrane/bitcoin-rolling-bot-php-master/arbot.php on line 177
PHP Warning:  Division by zero in /home/roko/Pobrane/bitcoin-rolling-bot-php-master/arbot.php on line 177
PHP Notice:  Undefined variable: microBuyDivisor in /home/roko/Pobrane/bitcoin-rolling-bot-php-master/arbot.php on line 177
PHP Notice:  Undefined variable: microAmount in /home/roko/Pobrane/bitcoin-rolling-bot-php-master/arbot.php on line 177
PHP Warning:  Division by zero in /home/roko/Pobrane/bitcoin-rolling-bot-php-master/arbot.php on line 177
Building EMA1 - Waiting for 5 more tickers
 ........
Building EMA1 - Waiting for 4 more tickers
 ........
Building EMA1 - Waiting for 3 more tickers
 ...................................
Building EMA1 - Waiting for 2 more tickers
 ....
Building EMA1 - Waiting for 1 more tickers
 ....
...
Building EMA2 - Waiting for 6 more tickers
 ......
Building EMA2 - Waiting for 5 more tickers
 ....
Building EMA2 - Waiting for 4 more tickers
 ........
Building EMA2 - Waiting for 3 more tickers
 ...........
Building EMA2 - Waiting for 2 more tickers
 ..
Building EMA2 - Waiting for 1 more tickers
 ....
Building EMA3 - Waiting for 11 more tickers
 .......
Building EMA3 - Waiting for 10 more tickers
 ..............
..................
Building EMA3 - Waiting for 9 more tickers
 ........................
Building EMA3 - Waiting for 8 more tickers
 .................
.........
Building EMA3 - Waiting for 7 more tickers
 .........
Building EMA3 - Waiting for 6 more tickers
 ....
Building EMA3 - Waiting for 5 more tickers
 .....
Building EMA3 - Waiting for 4 more tickers
 ..
Building EMA3 - Waiting for 3 more tickers
 ........
Building EMA3 - Waiting for 2 more tickers
 .......
Building EMA3 - Waiting for 1 more tickers
 ..PHP Notice:  Undefined variable: microProfit in /home/roko/Pobrane/bitcoin-rolling-bot-php-master/arbot.php on line 429
PHP Notice:  Undefined index: return in /home/roko/Pobrane/bitcoin-rolling-bot-php-master/arbot.php on line 513
PHP Warning:  Invalid argument supplied for foreach() in /home/roko/Pobrane/bitcoin-rolling-bot-php-master/arbot.php on line 513

**********************************************************
----------------------------------------------------------
**********************************************************
  Started:20140921 11:32:30
  Current:20140921 11:36:01
  Runtime: 0:Days 0:H 3:M 31:S
----------------------------------------------------------
Iteration: 2 Ticker:$383 *****StopLoss:NO INVESTMENT*****
----------------------------------------------------------
---------------- Trade Target Information ----------------
Threshold: Fees:0.2% Trades:101.82 Micro:95.75
PHP Notice:  Undefined variable: MICRO in /home/roko/Pobrane/bitcoin-rolling-bot-php-master/arbot.php on line 599
----------------------------------------------------------
------------------- Funds  Information -------------------
 Cash Out: BTC:0.01 USD:$2.6
  Balance: BTC:0.01 USD:$0
 Maximums: BTC:1 USD:$500
PHP Notice:  Undefined variable: microAmount in /home/roko/Pobrane/bitcoin-rolling-bot-php-master/arbot.php on line 611
PHP Notice:  Undefined variable: engineSellDivisor in /home/roko/Pobrane/bitcoin-rolling-bot-php-master/arbot.php on line 617
PHP Notice:  Undefined variable: engineBuyDivisor in /home/roko/Pobrane/bitcoin-rolling-bot-php-master/arbot.php on line 617
PHP Notice:  Undefined variable: engineProfit in /home/roko/Pobrane/bitcoin-rolling-bot-php-master/arbot.php on line 617
 EngineAmount:0 Sells: Buys: Profit:
  Tradable: BTC:0.01 USD:$0
----------------------------------------------------------
------------------- Order Information  -------------------
     Open: Buys:0 Sells:0
   Placed:Valid:0 Invalid:0 Cancelled:0
Completed: Buys:0 Total:0 Sells:0
 Last Run: Buys:0 Total:0 Sells:0
----------------------------------------------------------
------------------- Cost Information  -------------------
Order Costs: Not holding any BTC!
----------------------------------------------------------
------------------- Profit Information  -------------------
Initial Balance: BTC:0.01 USD:0 Rate:383  
Current Balance: BTC:0.01 USD:0 Rate:383
     Difference: BTC:0 USD:0 Rate:0
     Profit From Trading:0  
        Unrealized Gains:0  
 BTC Appreciation: Start:2.6 Current:2.6 Difference:0
  Program Value:0
----------------------------------------------------------
PHP Notice:  Undefined variable: MICRO in /home/roko/Pobrane/bitcoin-rolling-bot-php-master/arbot.php on line 749
.PHP Notice:  Undefined variable: microProfit in /home/roko/Pobrane/bitcoin-rolling-bot-php-master/arbot.php on line 429
PHP Notice:  Undefined index: return in /home/roko/Pobrane/bitcoin-rolling-bot-php-master/arbot.php on line 513
PHP Warning:  Invalid argument supplied for foreach() in /home/roko/Pobrane/bitcoin-rolling-bot-php-master/arbot.php on line 513
I really don't know if something is missing or wrong in my system. I'm glad you want to help me Smiley
edit: I've decided to install another Linux distro, maybe it will help Tongue
donator
Activity: 686
Merit: 519
It's for the children!
I don't know what you did there.  It's like you activated all of the engine's running code without activating an engines variables?
newbie
Activity: 2
Merit: 0
Hi, I'm new user here and I need your help with this bot. It gives me a lot of error outputs. How can I solve that?
Code:
roko@roko-Aspire-5830TG:~/Pobrane/bitcoin_bot$ php arbot.php
PHP Notice:  Undefined variable: EMA in /home/roko/Pobrane/bitcoin_bot/engine_ema.php on line 9
PHP Notice:  Undefined variable: BALANCE in /home/roko/Pobrane/bitcoin_bot/engine_balance.php on line 14
PHP Notice:  Undefined variable: JOSH in /home/roko/Pobrane/bitcoin_bot/engine_josh.php on line 9
PHP Notice:  Undefined variable: microSellDivisor in /home/roko/Pobrane/bitcoin_bot/arbot.php on line 145
PHP Notice:  Undefined variable: microAmount in /home/roko/Pobrane/bitcoin_bot/arbot.php on line 145
PHP Warning:  Division by zero in /home/roko/Pobrane/bitcoin_bot/arbot.php on line 145
PHP Notice:  Undefined variable: microBuyDivisor in /home/roko/Pobrane/bitcoin_bot/arbot.php on line 145
PHP Notice:  Undefined variable: microAmount in /home/roko/Pobrane/bitcoin_bot/arbot.php on line 145
PHP Warning:  Division by zero in /home/roko/Pobrane/bitcoin_bot/arbot.php on line 145
PHP Notice:  Undefined variable: microProfit in /home/roko/Pobrane/bitcoin_bot/arbot.php on line 397
PHP Notice:  Undefined variable: reBalanceBTC in /home/roko/Pobrane/bitcoin_bot/arbot.php on line 480
PHP Notice:  Undefined variable: currentBalanceBTC in /home/roko/Pobrane/bitcoin_bot/arbot.php on line 480
PHP Notice:  Undefined index: return in /home/roko/Pobrane/bitcoin_bot/arbot.php on line 481
PHP Warning:  Invalid argument supplied for foreach() in /home/roko/Pobrane/bitcoin_bot/arbot.php on line 481





**********************************************************
----------------------------------------------------------
**********************************************************
  Started:20140920 20:01:02
  Current:20140920 20:01:05
  Runtime: 0:Days 0:H 0:M 3:S
----------------------------------------------------------
Iteration: 2 Ticker:$399.05 *****StopLoss:NO INVESTMENT*****
----------------------------------------------------------
---------------- Trade Target Information ----------------
Threshold: Fees:0.02% Trades:13.3 Micro:8.15
PHP Notice:  Undefined variable: MICRO in /home/roko/Pobrane/bitcoin_bot/arbot.php on line 567
----------------------------------------------------------
------------------- Funds  Information -------------------
 Cash Out: BTC:0.01 USD:$2.71
  Balance: BTC:0.01 USD:$0
 Maximums: BTC:1 USD:$500
PHP Notice:  Undefined variable: microAmount in /home/roko/Pobrane/bitcoin_bot/arbot.php on line 579
PHP Notice:  Undefined variable: engineSellDivisor in /home/roko/Pobrane/bitcoin_bot/arbot.php on line 585
PHP Notice:  Undefined variable: engineBuyDivisor in /home/roko/Pobrane/bitcoin_bot/arbot.php on line 585
PHP Notice:  Undefined variable: engineProfit in /home/roko/Pobrane/bitcoin_bot/arbot.php on line 585
 EngineAmount:0 Sells: Buys: Profit:
  Tradable: BTC:0.01 USD:$0
----------------------------------------------------------
------------------- Order Information  -------------------
     Open: Buys:0 Sells:0
   Placed:Valid:0 Invalid:0 Cancelled:0
Completed: Buys:0 Total:0 Sells:0
 Last Run: Buys:0 Total:0 Sells:0
----------------------------------------------------------
------------------- Cost Information  -------------------
Order Costs: Not holding any BTC!
----------------------------------------------------------
------------------- Profit Information  -------------------
Initial Balance: BTC:0.01 USD:0 Rate:399.05  
Current Balance: BTC:0.01 USD:0 Rate:399.05
     Difference: BTC:0 USD:0 Rate:0
     Profit From Trading:0  
        Unrealized Gains:0  
 BTC Appreciation: Start:2.71 Current:2.71 Difference:0
  Program Value:0
----------------------------------------------------------
PHP Notice:  Undefined variable: MICRO in /home/roko/Pobrane/bitcoin_bot/arbot.php on line 717
........^C
roko@roko-Aspire-5830TG:~/Pobrane/bitcoin_bot$ cd ..
Thanks a lot! Smiley
edit: I'm running Xubuntu 14.04 with PHP 5.5.9
hero member
Activity: 574
Merit: 500
Whats the theoretical basis for this bot? I'm familiar with margin bots, how does this one make it's profit?

I almost hope it doesn't now days!

When btce first got USD/BTC/LTC there were some interesting discrepancies in the order book.  Normally in an HFT market these are handled by the exchange or a close third party.

Basically the bot was designed to exploit differences in the USD/BTC BTC/LTC LTC/USD trade books.  Using the following paths:

BULB -> Trade BTC for USD, Trade USD for LTC, Trade LTC for BTC
You would end up with more btc than you started with!

BLUB -> Trade BTC for LTC, Trade LTC for USD, Trade USD for BTC.

You could also start and end in USD with the bot.

The difference between this code and most other bot codes was the recursive order sizing.

The bot would parse the order book from B to U to L to B or any other direction, find the MAXIMUM trade size for the entire trade leg, then execute the trade leg.  

The practice of currency arbitrage especially for BTC was a lot more solid back then.  You used to be able to snail mail a money order to CampBX, exchange it for BTC, move the BTC to another exchange, trade the BTC for USD, withdraw the USD and repeat and make 2-8% profit per trade route!
Oh, so it's really just an ordinary triangular trade bot with optimised trade size? Whats all the micro trading then?
I gave it BTC0.5 to play with for 48 hours and can certainly confirm it doesn't do much of anything now! down $5

Worth adding I have a very fast c++ triangular arb bot running on btc-e and it never see's an opportunity. This leads me to believe BTC-e have internalised the arbitrage opportunity (ie are running their own or a partners bot internally with much faster access).

Need a ratio of better than 1.006 to be worth trading, these are typical values at btc-e:
no profit 0.995522
ltc/usd+btc/ltc+usd/btc
no profit 1.001279
nmc/usd+btc/nmc+usd/btc
no profit 0.995022
nvc/usd+btc/nvc+usd/btc
no profit 0.980696
btc/eur+ltc/btc+eur/ltc
no profit 0.989050
ltc/eur+btc/ltc+eur/btc
no profit 0.990046
btc/cnh+ltc/btc+cnh/ltc
no profit 0.989207
ltc/cnh+btc/ltc+cnh/btc
no profit 0.986928
btc/rur+ltc/btc+rur/ltc
no profit 0.977465
ltc/rur+btc/ltc+rur/btc
no profit 0.993305
ltc/btc+usd/ltc+btc/usd
no profit 0.995522
ppc/usd+btc/ppc+usd/btc
no profit 0.997972
 
Also, the very fact that the ratio is usually just below 1 is further proof of internalisation, as only an arb bot that did not have trade costs could keep the ratio's at that level.
donator
Activity: 686
Merit: 519
It's for the children!
Whats the theoretical basis for this bot? I'm familiar with margin bots, how does this one make it's profit?

I almost hope it doesn't now days!

When btce first got USD/BTC/LTC there were some interesting discrepancies in the order book.  Normally in an HFT market these are handled by the exchange or a close third party.

Basically the bot was designed to exploit differences in the USD/BTC BTC/LTC LTC/USD trade books.  Using the following paths:

BULB -> Trade BTC for USD, Trade USD for LTC, Trade LTC for BTC
You would end up with more btc than you started with!

BLUB -> Trade BTC for LTC, Trade LTC for USD, Trade USD for BTC.

You could also start and end in USD with the bot.

The difference between this code and most other bot codes was the recursive order sizing.

The bot would parse the order book from B to U to L to B or any other direction, find the MAXIMUM trade size for the entire trade leg, then execute the trade leg. 

The practice of currency arbitrage especially for BTC was a lot more solid back then.  You used to be able to snail mail a money order to CampBX, exchange it for BTC, move the BTC to another exchange, trade the BTC for USD, withdraw the USD and repeat and make 2-8% profit per trade route!
hero member
Activity: 574
Merit: 500
Whats the theoretical basis for this bot? I'm familiar with margin bots, how does this one make it's profit?
newbie
Activity: 10
Merit: 0
Maybe someone has modified version Which Logs data into Mysql? So the bot can be turned as cronjob? lets say each minute, with 1-many iterations depends on sleep between iterations. Smiley
donator
Activity: 686
Merit: 519
It's for the children!
What are the references to the Programs at the top of the Bot for?

i cant find anything to do with them in the Configuration.




I had developed several engines and releases of this project for different customers.   Most of the notes and comment blocks related to that.

When I released the base engine publicly I had to remove any code blocks which were sold or custom designed for buyers.
newbie
Activity: 1
Merit: 0
When i run this bot, I keep getting the error
Code:
PHP Notice:  Undefined index: return in /root/bitcoin-rolling-bot-php-master/arbot.php on line 513
PHP Warning:  Invalid argument supplied for foreach() in /root/bitcoin-rolling-bot-php-master/arbot.php on line 513

the line of code it indicates is the second line in this block.

Code:
               if ($BALANCE) $BTCremaining = $BTC*($currentBalanceBTC-$reBalanceBTC);
                foreach ( $TradeHistory['return'] as $key => $value){
                //DEBUG use this information to calculate trades/costs/profits
                        if ( $value['type'] == $exchangeBuySell[0] && $BTCremaining >= $minBidBTC  ) {
                                $costBalance['total'] = $costBalance['total'] + $value['rate']*$value['amount'];
                                $costBalance['shares'] = $costBalance['shares'] + $value['amount'];//$amountTrade[0]; Total shares analysed not / spread
                                $BTCremaining = $BTCremaining - $value['amount'];
                                $countBuys++;
                        }
                        /*
                        {
        "success":1,
        "return":{
                "166830":{
                        "pair":"btc_usd",
                        "type":"sell",
                        "amount":1,
                        "rate":1,
                        "order_id":343148,
                        "is_your_order":1,
                        "timestamp":1342445793
                }
        }
}*/

I don't know php at all so I was hoping someone might be able to help me with this... it doesn't seem to want to make any trades and simply reiterates when it reaches this line.  can someone please help me out with debugging this?

upon asking a code ninja I know about the issue, he says that $TradeHistory doesnt have the 'return' key populated
so the foreach gets a null (or whatever php uses), and promptly goes 'wtf?' but i'm still clueless about how to repair it.
hero member
Activity: 938
Merit: 1001
Hi there,

I changed the microamount for the micro roll engine,
but it keeps trading only 0.1 LTC
Any suggestions?

keep trying

What are the references to the Programs at the top of the Bot for?

i cant find anything to do with them in the Configuration.

The code was miaviator's personal project and he was nice enough to share. Comments may be missing or just plain wrong.
full member
Activity: 156
Merit: 100
What are the references to the Programs at the top of the Bot for?

i cant find anything to do with them in the Configuration.

newbie
Activity: 4
Merit: 0
Hi there,

I changed the microamount for the micro roll engine,
but it keeps trading only 0.1 LTC
Any suggestions?
full member
Activity: 156
Merit: 100
Cheers,

That worked a charm.

hero member
Activity: 938
Merit: 1001
Hi,

I'm getting this error:

Code:
Array
(
    [success] => 0
    [error] => invalid nonce parameter; on key:1399375681, you sent:5
)

Error pulling data.  Error #: 2

can you point me in the direction of fixing it?

i have looked at the code and the nonce should be updating from the Nonce file, but i dont get where its getting the key from.

I didn't use this version much but had nonce problems on other code form miaviator.

I did this and it worked

Code:
//Create nonce
$mt = explode(' ', microtime());
$nonce = $mt[1];
full member
Activity: 156
Merit: 100
Hi,

I'm getting this error:

Code:
Array
(
    [success] => 0
    [error] => invalid nonce parameter; on key:1399375681, you sent:5
)

Error pulling data.  Error #: 2

can you point me in the direction of fixing it?

i have looked at the code and the nonce should be updating from the Nonce file, but i dont get where its getting the key from.

newbie
Activity: 2
Merit: 0
Ive Removed MTGox from the Bot.

Code is available on Github:

https://github.com/pikespeak/bitcoin-rolling-bot-php
newbie
Activity: 4
Merit: 0
Actually the bot works really fine on linux, it makes some profit,

but do you have any idea then how to change the php settings?
and eventually which settings?

Thanks
Pages:
Jump to: