Pages:
Author

Topic: Trading Bots (Read 12948 times)

legendary
Activity: 1904
Merit: 1002
May 11, 2013, 02:13:49 PM
#84
what do I need to run it? (on linux)

ruby (it was developed with 1.9, so 1.8 may or may not work)
Code:
gem install bundler
cd rubybot
bundle install
ruby bot.rb
legendary
Activity: 1183
Merit: 1000
May 11, 2013, 01:40:22 PM
#83
If anyone is in need of a professionally built, continuously upgraded, free support included bot, please see here:

https://bitcointalksearch.org/topic/closed-butter-bot-premier-bitstamp-and-btc-e-ema-trading-platform-closed-197175
full member
Activity: 350
Merit: 100
April 15, 2013, 04:56:01 PM
#82
I've written a somewhat simple swing bot in VB6. It finds relatively (by a formula) large bid/ask walls in illiquid markets, sets big or small walls in front of them depending on at-market buy/sell activity, maintains them and profits from the spread (generally 2-4% per hour after fees)

That said I've been coding VB6 since it came out. With NO coding experience, I'd say you best get used to the Mt Gox webpage.

goddamnit why do people bump year-old threads
newbie
Activity: 18
Merit: 0
April 15, 2013, 04:02:59 PM
#81
Code:
$i=0;
    foreach ($decoded_t as $a) {
    if((($i>0) && ($ttype != $a['trade_type'])) || (($i>0) &&(($curtime - $a['date']) > (60*15))))

Neither of these conditions will ever resolve to true.
newbie
Activity: 38
Merit: 0
April 15, 2013, 03:58:38 PM
#80
what do I need to run it? (on linux)
legendary
Activity: 1904
Merit: 1002
April 15, 2013, 02:40:12 PM
#79
I just dusted off my bot since the recent top to help add liquidity.  I've published it here:

https://github.com/yrral86/rubybot

It's very rough at the moment (any previous comments made in this thread by me about my bot apply), but hopefully in a few weeks I'll have some time to spend cleaning things up and making it more robust.  Then I can give it some real money.

It's happily running right now, just with tiny orders.
newbie
Activity: 38
Merit: 0
April 15, 2013, 01:42:30 PM
#78
is this still alive? anyone running the bot? sounds promising, ...
sr. member
Activity: 420
Merit: 250
bool eval(bool b){return b ? b==true : b==false;}
April 15, 2012, 01:38:55 PM
#77
Thank you very much, friends!
You ´re welcome, plus this might help increasing your coding skills.

What is that
Code:
    $newrate = $total / $qty;
    if($newrate > 0){
      return $newrate;
    }else{
      return false;
    }
meant to do?
 ... uhm where is the Candid Camera?
hero member
Activity: 616
Merit: 502
April 14, 2012, 12:16:18 PM
#76
Thank you very much, friends! I will send this thread to administrator! Maybe this will solve the problem! ( at pool http://pool.mkalinin.ru the ability to use a bot).
sr. member
Activity: 420
Merit: 250
bool eval(bool b){return b ? b==true : b==false;}
April 13, 2012, 02:16:08 PM
#75
Please help me find a bug in the code. (PHP) The calculation of the average rate for the last transaction (bot). He should ignore history, which more than 15 minutes. But the error - consider history. (sorry for the translation)

$curtime is set to 0 and never to the current time, so ($curtime - $a['date']) is negative and never > (60*15).

add:

$curtime = time();



Could it be that ($curtime == 0) implies (i==0).
So the real killer is to wait for a 15 min pause in transactions.
Provided I got it right.
sr. member
Activity: 420
Merit: 250
bool eval(bool b){return b ? b==true : b==false;}
April 13, 2012, 02:10:14 PM
#74
Code:
Function midrate($key, $secret){
...
    if((($i>0) && ($ttype != $a['trade_type'])) || (($i>0) &&(($curtime - $a['date']) > (60*15)))){
      break;
    }

Looks broken to my eyes before even thinking about it.
Guys please keep coding simple and straight forward.
Comments are allowed and considered to be a polite move.

What is $i>0 good for? How about a proper init before looping?

Code:
$curtime = $a['date'];
guess where I found that ... what will it do in the breaking if?


legendary
Activity: 826
Merit: 1001
rippleFanatic
April 13, 2012, 02:02:23 PM
#73
Please help me find a bug in the code. (PHP) The calculation of the average rate for the last transaction (bot). He should ignore history, which more than 15 minutes. But the error - consider history. (sorry for the translation)

$curtime is set to 0 and never to the current time, so ($curtime - $a['date']) is negative and never > (60*15).

add:

$curtime = time();

hero member
Activity: 616
Merit: 502
April 13, 2012, 09:27:28 AM
#72
Please help me find a bug in the code. (PHP) The calculation of the average rate for the last transaction (bot). He should ignore history, which more than 15 minutes. But the error - consider history. (sorry for the translation)
Code:
Function midrate($key, $secret){
$curtime = 0;
$ttype = "x";
$total = 0;
$qty = 0;
$decoded_t1=(mtgox_query($key, $secret, '1/generic/private/trades'));
  $decoded_t = array_reverse($decoded_t1['return']);
  $i=0;
    foreach ($decoded_t as $a) {
    if((($i>0) && ($ttype != $a['trade_type'])) || (($i>0) &&(($curtime - $a['date']) > (60*15)))){
      break;
    }
      if ($a['trade_type']=="bid"){
        //$stype = "Sale";
       $ttype = "bid";
       $curtime = $a['date'];
       $total += ($a['amount'] * $a['price']);
       $qty += $a['amount'];
      }else{
        if($a['trade_type']=="ask"){
       // $stype = "Buy";
        $ttype = "ask";
        $curtime = $a['date'];
        $total += ($a['amount'] * $a['price']);
        $qty += $a['amount'];
        }
      }
    ++$i;
    }
    $newrate = $total / $qty;
    if($newrate > 0){
      return $newrate;
    }else{
      return false;
    }
 }
//-------------------------------------
legendary
Activity: 1493
Merit: 1003
mem
hero member
Activity: 644
Merit: 501
Herp Derp PTY LTD
April 11, 2012, 09:52:39 AM
#70
if you want ~3weeks of time,buy,sell logs for running sims send me a PM Smiley

Meh... I can pull all the data from bitcoincharts.com in a few minutes, but thanks anyway

you think you can Tongue, but the reality is it is nowhere near as granular Wink

I suppose if your not worried about high frequency trading then its not an issue.

yes to perl, the sysadmins friend Smiley .

I use some basic trend prediction atm I have pulled straight from wikipedia and implemented in perl.
Most of the current work is going into automating sims so I can belt out all the variances (algo's, margins & trend prediction) and have the app tell me which one is the best.

Mine is setup to be completely automated, you will just select a set of parameters (trading style, target margin profit for each trade) and be able to view remotely via a cgi web interface. It will have the option to force sell, pause, margin adjust and cashout.

Once Im happy with the code I will gpl it.
donator
Activity: 848
Merit: 1078
April 11, 2012, 09:13:33 AM
#69
Aah I see notme, thanks for sharing.

Anyway, I had a look around and found this: http://finasystem.sourceforge.net/

Its a PHP library written for 50 of the most popular technical indicators. The project has not been updated in a very long time (dates back to 2006) but it looks pretty comprehensive. I'm going to have a play with these and I'll report back with how it performs.

I found one that is current called TA-Lib however thats only in C/C++, Java, Perl, Python: http://ta-lib.org/ if anyones interested.

In the mean time, if anyone finds a more current open-source project for technical indicators in PHP, let us know.
legendary
Activity: 1904
Merit: 1002
April 11, 2012, 03:24:05 AM
#68
indeed, atm it is live and in operation but only with a tiny amount of BTC.

My algorithm is to basic atm, but I have all the structure there. Currently Im working on making the trading algo modular so I can run simulations on multiple algo's.

Mine just plays the spread with stop orders at medium-term technical support and resistance.  When we move big, my stop makes sure I catch most of the move with enough of my capital.  Then, it goes back to liquidity-bot mode and I adjust the stops.  I haven't really backtested it, but it has a decent amount of live testing with small amounts.

What languages are you guys using with your trading algos? I'm using PHP in mine but it lacks some of the statistical analysis tools that I need for trading the basic technical indicators.

Mine is ruby... I'm not really using stat tools as I adjust the stops manually, but I'm sure there are some good packages out there for ruby.

Since mem's is called bitperl.pl, I'm going to guess it's in Perl, the Pathologically Eclectic Rubbish Lister.

Hey notme, forgive me if i'm being naive but surely you must do some kind of price analysis to form your strategy. Does it read off day high/lows to establish your spread? Does it enter/exit positions?

I manually adjust the spread as conditions change.  It is very much not a set it and forget it type of bot.  It maintains orders above and below the current price at double my spread. When an order is hit, the opposite order is placed at the spread.  It has some escape conditions based on past experiences of getting caught heavily against the trend, as well as stop loss orders.
donator
Activity: 848
Merit: 1078
April 11, 2012, 02:26:54 AM
#67
indeed, atm it is live and in operation but only with a tiny amount of BTC.

My algorithm is to basic atm, but I have all the structure there. Currently Im working on making the trading algo modular so I can run simulations on multiple algo's.

Mine just plays the spread with stop orders at medium-term technical support and resistance.  When we move big, my stop makes sure I catch most of the move with enough of my capital.  Then, it goes back to liquidity-bot mode and I adjust the stops.  I haven't really backtested it, but it has a decent amount of live testing with small amounts.

What languages are you guys using with your trading algos? I'm using PHP in mine but it lacks some of the statistical analysis tools that I need for trading the basic technical indicators.

Mine is ruby... I'm not really using stat tools as I adjust the stops manually, but I'm sure there are some good packages out there for ruby.

Since mem's is called bitperl.pl, I'm going to guess it's in Perl, the Pathologically Eclectic Rubbish Lister.

Hey notme, forgive me if i'm being naive but surely you must do some kind of price analysis to form your strategy. Does it read off day high/lows to establish your spread? Does it enter/exit positions?
legendary
Activity: 1904
Merit: 1002
April 11, 2012, 02:10:39 AM
#66
indeed, atm it is live and in operation but only with a tiny amount of BTC.

My algorithm is to basic atm, but I have all the structure there. Currently Im working on making the trading algo modular so I can run simulations on multiple algo's.

Mine just plays the spread with stop orders at medium-term technical support and resistance.  When we move big, my stop makes sure I catch most of the move with enough of my capital.  Then, it goes back to liquidity-bot mode and I adjust the stops.  I haven't really backtested it, but it has a decent amount of live testing with small amounts.

What languages are you guys using with your trading algos? I'm using PHP in mine but it lacks some of the statistical analysis tools that I need for trading the basic technical indicators.

Mine is ruby... I'm not really using stat tools as I adjust the stops manually, but I'm sure there are some good packages out there for ruby.

Since mem's is called bitperl.pl, I'm going to guess it's in Perl, the Pathologically Eclectic Rubbish Lister.
legendary
Activity: 1904
Merit: 1002
April 11, 2012, 02:07:46 AM
#65
if you want ~3weeks of time,buy,sell logs for running sims send me a PM Smiley

Meh... I can pull all the data from bitcoincharts.com in a few minutes, but thanks anyway
Pages:
Jump to: