Bitcoin Forum
November 16, 2024, 01:04:01 AM *
News: Check out the artwork 1Dq created to commemorate this forum's 15th anniversary
 
   Home   Help Search Login Register More  
Pages: « 1 2 [3] 4 5 6 »  All
  Print  
Author Topic: HAL 10K - Bitcoin PHP trading bot  (Read 24350 times)
Kakoon
Newbie
*
Offline Offline

Activity: 6
Merit: 0


View Profile
January 06, 2014, 10:49:16 AM
 #41

Nice work so far.

Since I'm European, I am more interested in EUR prices. How much impact, do you think, would changing the currency in MtGoxClient.php have?

Code:
$this->pair = 'BTCUSD';

to

Code:
$this->pair = 'BTCEUR';

Besides showing a dollar sign next to each price of course, would that mess up things?
intrd (OP)
Member
**
Offline Offline

Activity: 75
Merit: 10

HAL10K developer


View Profile WWW
January 06, 2014, 11:15:26 AM
 #42

I believe that works! take the test in Paper trading.. (i've put EUR in todolist also, thank you for remembering)

Nice work so far.
Since I'm European, I am more interested in EUR prices. How much impact, do you think, would changing the currency in MtGoxClient.php have?
Code:
$this->pair = 'BTCUSD';
to
Code:
$this->pair = 'BTCEUR';
Besides showing a dollar sign next to each price of course, would that mess up things?

HAL 10K @ Bitcoin PHP trading & helper bot featuring EMA Short/Long crossover | Paper trading | Backtesting w/ BitcoinCharts raw data | Twitter notifications and much more: http://dann.com.br/hal-10k-php-trading-helper-bot/
malen63
Newbie
*
Offline Offline

Activity: 15
Merit: 0


View Profile
January 06, 2014, 01:49:15 PM
 #43

Hi Inrd,

Could you give us your todolist by priority ?

Other question, I heard you had to wait a long time with Mtgox for money on his bank account. And that it is better to use Bitstamp or Bitcoincentral.
omio
Newbie
*
Offline Offline

Activity: 46
Merit: 0


View Profile
January 06, 2014, 02:03:10 PM
 #44

Very nice thank you for this. Does this need also need an SQL server to run?
intrd (OP)
Member
**
Offline Offline

Activity: 75
Merit: 10

HAL10K developer


View Profile WWW
January 06, 2014, 02:54:23 PM
 #45

Nop. i've made a simple text database.. Smiley
Very nice thank you for this. Does this need also need an SQL server to run?

HAL 10K @ Bitcoin PHP trading & helper bot featuring EMA Short/Long crossover | Paper trading | Backtesting w/ BitcoinCharts raw data | Twitter notifications and much more: http://dann.com.br/hal-10k-php-trading-helper-bot/
intrd (OP)
Member
**
Offline Offline

Activity: 75
Merit: 10

HAL10K developer


View Profile WWW
January 06, 2014, 03:00:45 PM
 #46

Todolist is on github: https://github.com/intrd/bitcoin/tree/master/hal10k (at the end of readme)
would be grateful if they can assist in this project, even small fixes/improvements in code! so far I'm still alone..

Hi Intrd,
Could you give us your todolist by priority ?
Other question, I heard you had to wait a long time with Mtgox for money on his bank account. And that it is better to use Bitstamp or Bitcoincentral.

HAL 10K @ Bitcoin PHP trading & helper bot featuring EMA Short/Long crossover | Paper trading | Backtesting w/ BitcoinCharts raw data | Twitter notifications and much more: http://dann.com.br/hal-10k-php-trading-helper-bot/
bitcoin.newsfeed
Sr. Member
****
Offline Offline

Activity: 378
Merit: 250


View Profile
January 06, 2014, 03:16:12 PM
 #47

He he bought at 1089, will ask at 1090 when market direction is <down/down> (<limbo/down> means that the bot does not have enough data to generate the EMA <down.limbo/down> means that the EMA has not crossed yet)

Code:
*** Checking for open orders...  no orders.
$ 1090.54999 <limbo/down> ask @ 1090 stoploss: 589 (last: bid @ 1089 [loss])

Oh I see Smiley So why HAL is trying to sell @ 1090 (when he bought on 1089), when "$percentual" value is set to "1.45" and 1089*1.0145 = 1104.7905  <<< he should want to sell it on 1104.7905, no 1090(with loss because of fees), right?

... Question Everything, Believe Nothing ...
intrd (OP)
Member
**
Offline Offline

Activity: 75
Merit: 10

HAL10K developer


View Profile WWW
January 06, 2014, 03:24:33 PM
 #48

Yes, take a look at $bidfee value too!
Quote
Oh I see Smiley So why HAL is trying to sell @ 1090 (when he bought on 1089), when "$percentual" value is set to "1.45" and 1089*1.0145 = 1104.7905  <<< he should want to sell it on 1104.7905, no 1090(with loss because of fees), right?

HAL 10K @ Bitcoin PHP trading & helper bot featuring EMA Short/Long crossover | Paper trading | Backtesting w/ BitcoinCharts raw data | Twitter notifications and much more: http://dann.com.br/hal-10k-php-trading-helper-bot/
bitcoin.newsfeed
Sr. Member
****
Offline Offline

Activity: 378
Merit: 250


View Profile
January 06, 2014, 03:40:21 PM
 #49

Yes, take a look at $bidfee value too!
Quote
Oh I see Smiley So why HAL is trying to sell @ 1090 (when he bought on 1089), when "$percentual" value is set to "1.45" and 1089*1.0145 = 1104.7905  <<< he should want to sell it on 1104.7905, no 1090(with loss because of fees), right?

config
Code:
$percentual=1.45; //Minimum percentage of profit on the purchase (Use the current fee applied by MtGox);
$bidfee=1.45; //Just for simulation purposes (Use the current fee applied by MtGox);
$up_diff=10; //(sell) profit points (in USD) above the purchase price;
$up_diff_inv=500; //(sell) stop loss (in USD) below the purchase price;
$down_diff=1; //(buy) profit points (in USD) below the selling price;
$down_diff_inv=1; //(buy) stop loss (in USD) above the selling price;
$secure_ticker=1; //Security value that prevents the bot to make sales below a certain value;
$fake_btc_usd_buyedprice="1000.00000";

output
Code:
*** Checking for open orders...  no orders.
$ 1012.77664 <limbo/down> ask @ 1010 stoploss: 500 (last: bid @ 1000 [loss])

Its configured, but i think the bot is ignoring the $percentual value and instead of it is using $up_diff value, what you think?

... Question Everything, Believe Nothing ...
woutie70
Newbie
*
Offline Offline

Activity: 5
Merit: 0


View Profile
January 07, 2014, 09:15:44 AM
 #50

First of all, thanks for making this amazing opensource tradingbot! Cheesy
The graph works like a charm (but sometimes the 'buy' and the 'sell' points are not on the yellow USD/BTC line)

There is however one problem I come across everytime I run the code.

Code:
$ 1035.015 <up/up> bid @ 1014 stoploss: 1040 (last: ask @ 1020 [profit])
*** EMAShort1032.44 / EMALong1028.07
*** High volume detected! 146994.68
*** Checking for open orders...  no orders.
$ 1042 <up/up> bid @ 1014 stoploss: 1040 (last: ask @ 1020 [profit])
*** #Hit wall!
*** #SUDDEN MODE on!
$ bid 2.0119309811464 @ $1044.1 (prev: 1020) - 2014-01-07 09:13:10
array(2) {
  ["result"]=>
  string(7) "success"
  ["data"]=>
  string(26) "98374829984767289039847839"
}
*** Processing order... done!array(8) {
  ["type"]=>
  string(3) "bid"
  ["amount"]=>
  float(2.0119309811464)
  ["price"]=>
  string(6) "1044.1"
  ["datetime"]=>
  string(19) "2014-01-07 09:13:10"
  ["success"]=>
  string(26) "98374829984767289039847839"
  ["status"]=>
  string(9) "processed"
  ["prem"]=>
  string(4) "loss"
  ["sudden_mode"]=>
  int(0)
}

*** EMAShort1036.99 / EMALong1030.62
*** Checking for open orders...  no orders.

After 'Processing...Done! He gives some weird code lines what seems to be code that need to be executed. Does anyone know how to solve this?

Also, (newbie question) where can you see the profit you made?

Thanks in advance!
intrd (OP)
Member
**
Offline Offline

Activity: 75
Merit: 10

HAL10K developer


View Profile WWW
January 07, 2014, 12:24:31 PM
 #51

He BID at 1000 and will ASK at 1010 (because $percentual and $bidfee not applies at ASK, only BID), if you want to configure profit margin at next ASK uses $up_diff.
I know, its confusing.., will improve it to let more intuitive.

Its configured, but i think the bot is ignoring the $percentual value and instead of it is using $up_diff value, what you think?

HAL 10K @ Bitcoin PHP trading & helper bot featuring EMA Short/Long crossover | Paper trading | Backtesting w/ BitcoinCharts raw data | Twitter notifications and much more: http://dann.com.br/hal-10k-php-trading-helper-bot/
intrd (OP)
Member
**
Offline Offline

Activity: 75
Merit: 10

HAL10K developer


View Profile WWW
January 07, 2014, 12:44:56 PM
 #52

1 - When bots buy/sell at "Sudden mode(loss)", its off the current price, so he scores off the chart, is correct ..
2- Sorry about that weird code lines after processing, its because I forgot to turn off debug Smiley (its not an error..)

First of all, thanks for making this amazing opensource tradingbot! Cheesy
The graph works like a charm (but sometimes the 'buy' and the 'sell' points are not on the yellow USD/BTC line)
There is however one problem I come across everytime I run the code.
Code:
*** Processing order... done!array(8) {
  ["type"]=>
  string(3) "bid"
  ["amount"]=>
  float(2.0119309811464)
  ["price"]=>
  string(6) "1044.1"
  ["datetime"]=>
  string(19) "2014-01-07 09:13:10"
  ["success"]=>
  string(26) "98374829984767289039847839"
  ["status"]=>
  string(9) "processed"
  ["prem"]=>
  string(4) "loss"
  ["sudden_mode"]=>
  int(0)
}
After 'Processing...Done! He gives some weird code lines what seems to be code that need to be executed. Does anyone know how to solve this?
Also, (newbie question) where can you see the profit you made? Thanks in advance!

HAL 10K @ Bitcoin PHP trading & helper bot featuring EMA Short/Long crossover | Paper trading | Backtesting w/ BitcoinCharts raw data | Twitter notifications and much more: http://dann.com.br/hal-10k-php-trading-helper-bot/
armodilloben
Member
**
Offline Offline

Activity: 95
Merit: 10


View Profile WWW
January 07, 2014, 12:56:28 PM
 #53

open source trading bots are a great idea, although only live environment testing will show results. We are working on an API in our Bitcoin exchgange game, so you will have a nice training ground for the trading bots.

facundop
Newbie
*
Offline Offline

Activity: 27
Merit: 0


View Profile
January 07, 2014, 02:56:27 PM
 #54

I'm testing it, but it handles weird values. As of now, mtgox high/low are at 1,044 - 956, but HAL 10k is bidding at 703. ¿?
intrd (OP)
Member
**
Offline Offline

Activity: 75
Merit: 10

HAL10K developer


View Profile WWW
January 07, 2014, 03:22:42 PM
 #55

No, this will only happen if you set a very high profit on $down_diff
I'm testing it, but it handles weird values. As of now, mtgox high/low are at 1,044 - 956, but HAL 10k is bidding at 703. ¿?

HAL 10K @ Bitcoin PHP trading & helper bot featuring EMA Short/Long crossover | Paper trading | Backtesting w/ BitcoinCharts raw data | Twitter notifications and much more: http://dann.com.br/hal-10k-php-trading-helper-bot/
facundop
Newbie
*
Offline Offline

Activity: 27
Merit: 0


View Profile
January 07, 2014, 04:17:52 PM
 #56

I'm using everything by default, I haven't changed any value
intrd (OP)
Member
**
Offline Offline

Activity: 75
Merit: 10

HAL10K developer


View Profile WWW
January 07, 2014, 04:20:02 PM
 #57

Strange, copynpaste here last lines of output..
I'm using everything by default, I haven't changed any value

HAL 10K @ Bitcoin PHP trading & helper bot featuring EMA Short/Long crossover | Paper trading | Backtesting w/ BitcoinCharts raw data | Twitter notifications and much more: http://dann.com.br/hal-10k-php-trading-helper-bot/
facundop
Newbie
*
Offline Offline

Activity: 27
Merit: 0


View Profile
January 07, 2014, 04:24:15 PM
 #58

Strange, copynpaste here last lines of output..
I'm using everything by default, I haven't changed any value

Here we go, I only changed logged in, btc amount and usd amount:

Start time is: 07/01/2014 13:16:05,20

*** HAL_10K v2.2 beta 1 (by intrd)
$ Logged: xxxxx ( BTC: xxxxx / USD: xxxxx )
# Trading - fee: 0.45 - ( USD range down: 1 / up: 1 ) Interval secs: 60
# Ticker 24h -> High: 1044.20000 / Low: 956.00000 / Avg: 1006.53471 )
# Loop starting..
*** EMAShort / EMALong
*** High volume detected! 16302.40557269
*** Checking for open orders...  no orders.
$ 985.00000 <limbo/up> bid @ 703 stoploss: 715 (last: bid @ 707 [loss])
*** EMAShort / EMALong
*** Checking for open orders...  no orders.
$ 977.00001 <limbo/up> bid @ 703 stoploss: 715 (last: bid @ 707 [loss])
*** EMAShort / EMALong
*** Checking for open orders...  no orders.
$ 977.00001 <limbo/up> bid @ 703 stoploss: 715 (last: bid @ 707 [loss])
*** EMAShort / EMALong
*** Checking for open orders...  no orders.
$ 986.50000 <limbo/up> bid @ 703 stoploss: 715 (last: bid @ 707 [loss])
*** EMAShort / EMALong
*** Checking for open orders...  no orders.
$ 978.00000 <limbo/up> bid @ 703 stoploss: 715 (last: bid @ 707 [loss])
*** EMAShort / EMALong
*** Checking for open orders...  no orders.
$ 978.00000 <limbo/up> bid @ 703 stoploss: 715 (last: bid @ 707 [loss])
*** EMAShort / EMALong
*** Checking for open orders...  no orders.
$ 979.00000 <limbo/up> bid @ 703 stoploss: 715 (last: bid @ 707 [loss])
intrd (OP)
Member
**
Offline Offline

Activity: 75
Merit: 10

HAL10K developer


View Profile WWW
January 07, 2014, 04:32:03 PM
 #59

Ah ok,
this happens because you specified that purchased your amount of btc at 707, so it will sell when UP (707+$up_diff value) when the market is going <up/up>.

you can set the value that was FIRST BTC bought in this variable: $fake_btc_usd_buyedprice="707.00000";

Here we go, I only changed logged in, btc amount and usd amount:

HAL 10K @ Bitcoin PHP trading & helper bot featuring EMA Short/Long crossover | Paper trading | Backtesting w/ BitcoinCharts raw data | Twitter notifications and much more: http://dann.com.br/hal-10k-php-trading-helper-bot/
facundop
Newbie
*
Offline Offline

Activity: 27
Merit: 0


View Profile
January 07, 2014, 04:40:46 PM
 #60

Currently, in my mtgox there isnt any btc, I only own several USD. Does it mean it will loop forever like this unless I buy BTC and change the value you mentioned to the value I spent?
Pages: « 1 2 [3] 4 5 6 »  All
  Print  
 
Jump to:  

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