Bitcoin Forum
November 12, 2024, 05:03:37 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   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)
woutie70
Newbie
*
Offline Offline

Activity: 5
Merit: 0


View Profile
January 07, 2014, 04:56:30 PM
 #61

intrd, thank you for your quick reply Smiley

I have one more question (which I like to illustrate).

http://postimg.org/image/j785rn5wf/

This is while using Live Trading (with paper) with the following config:

Code:
	/* Custom trading algoritm parameters */
$percentual=0.6; //Minimum percentage of profit on the purchase (Use the current fee applied by MtGox);
$bidfee=0.6; //Just for simulation purposes (Use the current fee applied by MtGox);
$up_diff=5; //(sell) profit points (in USD) above the purchase price;
$up_diff_inv=0; //(sell) stop loss (in USD) below the purchase price;
$down_diff=2; //(buy) profit points (in USD) below the selling price;
$down_diff_inv=0; //(buy) stop loss (in USD) above the selling price;
$secure_ticker=300.99500; //Security value that prevents the bot to make sales below a certain value;
$emacross=true; //Turn on EMA crossover method (if emacross=true, Simple Market Direction Method automatically is turned off);
$emaShort=10; //EMA short period(in minutes because you are using $interval=60;) for EMA crossover method;
$emaLong=21; //EMA long period(in minutes because you are using $interval=60;) for EMA crossover method;
$emaDiff=0; //EMA difference between short and long crossover;
$last_two_orders=false; //Base next move on the last two transactions value;
$interval=10; //Bot loop interval (in seconds);
$timeout=80; //Timeout in seconds for completion of the bid/ask;
$sudden_mode=0; //When active, the bot makes a purchase at the sale price, or a sale at the purchase price. Used only when there is a need for immediate order processing. It will be disabled after the order is processed;
$reverse_prices=0; //Same as Sudden, but definite. It will never turned off;
$manualstoploss=0; //When active, in every action stop-loss requests remote confirmation of the bot operator;
$dire=6; //Amount of past intervals used in the identification of Simple Market Direction Method;
$dire_limbo=13; //Minimum variation (in USD) to define whether the direction is out of limbo or not (limbo: when the bot still trying to set the direction of the market);
$vol_limbo=450.78526468; //Minimum volume (in USD) to consider an abnormal change at the volume of an interval to another;

/* Backtesting and Paper trading */
$fake=true; //Turns on/off simulation (backtesting);
$paper=true; //Paper trading is simulation with Real Live Tickers but w/ fake money balance. (If Paper trading is true, $fake needs to be defined to "true");
$fake_btc_balance="2"; //Initial amount of BTC for the simulation;
$fake_btc_usd_buyedprice="990.80000"; //Initial purchase price of BTC (ATENTION: you need to set this value for Backtesting and Paper trading);
$fake_datetime_of_firstbid="2014-01-07 00:00:00"; //Initial datetime (same as first line of $fakegox_tickers file below)
$fakegox_tickers=$datadir."fakegox_tickers(test3).txt"; //Access http://bitcoincharts.com/charts/mtgoxUSD, set the period (must be a period that supports interval 1min), click Raw Data, copy/paste the contents of the table in a TXT file and replaces tabulations by "," comma);

In the middle, there is a lot of fluctation in the price, and the bot buys and sells constantly at the perfect price.

My question: Is this possible when you trade with real money? Because when that's the case, this config is very profitable  Shocked
intrd (OP)
Member
**
Offline Offline

Activity: 75
Merit: 10

HAL10K developer


View Profile WWW
January 07, 2014, 05:07:52 PM
 #62

At the moment, to start with USD instead of BTC is only possible manually.. by turning off the $reset_data; editing the file: fakegox.txt USD balance and setting an "ask" on file last.txt, (now placed in the todolist the $fake_usd_balance, this feature will be available soon)

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?

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, 05:19:16 PM
 #63

At the moment, to start with USD instead of BTC is only possible manually.. by turning off the $reset_data; editing the file: fakegox.txt USD balance and setting an "ask" on file last.txt, (now placed in the todolist the $fake_usd_balance, this feature will be available soon)

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?

I bought a small btc sample, but still no action with the bot:

Start time is: 07/01/2014 13:45:20,94

*** HAL_10K v2.2 beta 1 (by intrd)
$ Logged: xxxxxxx( BTC: 0.02946935 / USD: xxxxxx )
# Trading - fee: 0.45 - ( USD range down: 1 / up: 1 ) Interval secs: 60
# Ticker 24h -> High: 1044.20000 / Low: 956.00000 / Avg: 1006.35190 )
# Loop starting..
*** EMAShort / EMALong
*** High volume detected! 16133.65412521
*** Checking for open orders...  no orders.
$ 973.57000 <limbo/down> ask @ 975 stoploss: 969 (last: bid @ 974 [loss])
*** EMAShort / EMALong
*** Checking for open orders...  no orders.
$ 973.76792 <limbo/down> ask @ 975 stoploss: 969 (last: bid @ 974 [loss])
*** EMAShort / EMALong
*** Checking for open orders...  no orders.
$ 975.00279 <limbo/down> ask @ 975 stoploss: 969 (last: bid @ 974 [loss])
*** EMAShort / EMALong
*** Checking for open orders...  no orders.
$ 974.99279 <limbo/down> ask @ 975 stoploss: 969 (last: bid @ 974 [loss])
*** EMAShort / EMALong
*** Checking for open orders...  no orders.
$ 973.00000 <limbo/down> ask @ 975 stoploss: 969 (last: bid @ 974 [loss])
*** EMAShort / EMALong
*** Checking for open orders...  no orders.
$ 973.00000 <limbo/down> ask @ 975 stoploss: 969 (last: bid @ 974 [loss])
*** EMAShort / EMALong
*** Checking for open orders...  no orders.
$ 973.00000 <limbo/down> ask @ 975 stoploss: 969 (last: bid @ 974 [loss])
*** EMAShort / EMALong
*** Checking for open orders...  no orders.
$ 975.00000 <limbo/down> ask @ 975 stoploss: 969 (last: bid @ 974 [loss])
*** EMAShort / EMALong
*** Checking for open orders...  no orders.
$ 977.44255 <limbo/down> ask @ 975 stoploss: 969 (last: bid @ 974 [loss])
*** EMAShort / EMALong
*** Checking for open orders...  no orders.
$ 975.99000 <limbo/down> ask @ 975 stoploss: 969 (last: bid @ 974 [loss])
*** EMAShort / EMALong
*** Checking for open orders...  no orders.
$ 974.00000 <limbo/down> ask @ 975 stoploss: 969 (last: bid @ 974 [loss])
*** EMAShort / EMALong
*** Checking for open orders...  no orders.
$ 974.00000 <limbo/down> ask @ 975 stoploss: 969 (last: bid @ 974 [loss])
*** EMAShort / EMALong
*** Checking for open orders...  no orders.
$ 974.00000 <limbo/down> ask @ 975 stoploss: 969 (last: bid @ 974 [loss])
*** EMAShort / EMALong
*** Checking for open orders...  no orders.
$ 974.00000 <limbo/down> ask @ 975 stoploss: 969 (last: bid @ 974 [loss])
*** EMAShort / EMALong
*** Checking for open orders...  no orders.
$ 974.00000 <limbo/down> ask @ 975 stoploss: 969 (last: bid @ 974 [loss])
*** EMAShort / EMALong
*** Checking for open orders...  no orders.
$ 974.00000 <limbo/down> ask @ 975 stoploss: 969 (last: bid @ 974 [loss])
*** EMAShort / EMALong
*** Checking for open orders...  no orders.
$ 977.25000 <limbo/down> ask @ 975 stoploss: 969 (last: bid @ 974 [loss])
*** EMAShort / EMALong
*** Checking for open orders...  no orders.
$ 977.25000 <limbo/down> ask @ 975 stoploss: 969 (last: bid @ 974 [loss])
*** EMAShort / EMALong
*** Checking for open orders...  no orders.
$ 977.25000 <limbo/down> ask @ 975 stoploss: 969 (last: bid @ 974 [loss])
*** EMAShort / EMALong
*** Checking for open orders...  no orders.
$ 975.50000 <limbo/down> ask @ 975 stoploss: 969 (last: bid @ 974 [loss])
*** EMAShort / EMALong
*** Checking for open orders...  no orders.
$ 975.50000 <limbo/down> ask @ 975 stoploss: 969 (last: bid @ 974 [loss])
*** EMAShort / EMALong
*** Checking for open orders...  no orders.
$ 986.89900 <limbo/down> ask @ 975 stoploss: 969 (last: bid @ 974 [loss])
*** EMAShort / EMALong
*** Checking for open orders...  no orders.
$ 979.90231 <limbo/down> ask @ 975 stoploss: 969 (last: bid @ 974 [loss])
*** EMAShort / EMALong
*** Checking for open orders...  no orders.
$ 979.90231 <limbo/down> ask @ 975 stoploss: 969 (last: bid @ 974 [loss])
*** EMAShort / EMALong
*** Checking for open orders...  no orders.
$ 979.90231 <limbo/down> ask @ 975 stoploss: 969 (last: bid @ 974 [loss])
*** EMAShort / EMALong
*** Checking for open orders...  no orders.
$ 979.90231 <limbo/down> ask @ 975 stoploss: 969 (last: bid @ 974 [loss])
*** EMAShort / EMALong
*** Checking for open orders...  no orders.
$ 979.90231 <limbo/down> ask @ 975 stoploss: 969 (last: bid @ 974 [loss])
*** EMAShort / EMALong
*** Checking for open orders...  no orders.
$ 982.35206 <limbo/down> ask @ 975 stoploss: 969 (last: bid @ 974 [loss])
*** EMAShort / EMALong
*** Checking for open orders...  no orders.
$ 982.00000 <limbo/down> ask @ 975 stoploss: 969 (last: bid @ 974 [loss])
*** EMAShort / EMALong
*** Checking for open orders...  no orders.
$ 982.00000 <limbo/down> ask @ 975 stoploss: 969 (last: bid @ 974 [loss])
*** EMAShort / EMALong
*** Checking for open orders...  no orders.
$ 982.35206 <limbo/down> ask @ 975 stoploss: 969 (last: bid @ 974 [loss])

these are my settings:

   $percentual=0.45;
   $bidfee=0.45;
   $up_diff=1;
   $up_diff_inv=5;
   $down_diff=1;
   $down_diff_inv=5;
   $secure_ticker=300.99500;
   $emacross=true;
   $emaShort=20;
   $emaLong=44;
   $emaDiff=5;
   $last_two_orders=false;
   $interval=60;
   $timeout=80;
   $sudden_mode=0;
   $reverse_prices=0;
   $manualstoploss=0;
   $dire=6;
   $dire_limbo=13;
   $vol_limbo=450.78526468;

seems stuck in a loop, and I believe it should have made a few sells already ?
intrd (OP)
Member
**
Offline Offline

Activity: 75
Merit: 10

HAL10K developer


View Profile WWW
January 07, 2014, 05:21:13 PM
 #64

theoretically all it is possible in simulation Paper is possible IRL,
but you have to consider that your exchange will hardly be able to process quickly an order at ask/bid price, MtGox takes too long to process this type of order and many times the price moves and the order remains in gox queue, so I created the variable $timeout and Sudden Mode(which makes a bid at the current ask price or vice versa.)

intrd, thank you for your quick reply Smiley
I have one more question (which I like to illustrate).
This is while using Live Trading (with paper) with the following config:

In the middle, there is a lot of fluctation in the price, and the bot buys and sells constantly at the perfect price.
My question: Is this possible when you trade with real money? Because when that's the case, this config is very profitable  Shocked

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, 05:31:27 PM
 #65

You are on Paper trading, right?
$ 982.35206 <limbo/down> ask @ 975 stoploss: 969 (last: bid @ 974 [loss])
Its on "Limbo", the bot will ask at 975 when the market direction is <down/down>.
Limbo = means that the bot has not garnered sufficient data to render the EMALong, in your case is set to 44, and you will have to wait 44min(if $interval=60(1min)) for the bot do the first movement, from there it will operate normally.
(this problem will end when the bot able to automatically grab information from the past before starting from scratch).

I bought a small btc sample, but still no action with the bot:

Start time is: 07/01/2014 13:45:20,94
*** HAL_10K v2.2 beta 1 (by intrd)
$ Logged: xxxxxxx( BTC: 0.02946935 / USD: xxxxxx )
# Trading - fee: 0.45 - ( USD range down: 1 / up: 1 ) Interval secs: 60
# Ticker 24h -> High: 1044.20000 / Low: 956.00000 / Avg: 1006.35190 )
# Loop starting..
*** EMAShort / EMALong
*** High volume detected! 16133.65412521
*** Checking for open orders...  no orders.
$ 973.57000 <limbo/down> ask @ 975 stoploss: 969 (last: bid @ 974 [loss])

seems stuck in a loop, and I believe it should have made a few sells already ?

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, 05:34:10 PM
 #66

I feel dumb, sorry. I ll report back in 40 mins when I start earning billions thanks to your bot.
morp17
Member
**
Offline Offline

Activity: 87
Merit: 10



View Profile
January 08, 2014, 01:24:01 AM
 #67

Great job, I would take a doubt, apparently the bot is configured to obtain profit in U.S. dollars, how do I flip and make a profit in bitcoin?  Huh

฿itcoin: 36tHHEBp7QwePa76dMsN4KVbN3VhvK3rbu
intrd (OP)
Member
**
Offline Offline

Activity: 75
Merit: 10

HAL10K developer


View Profile WWW
January 08, 2014, 02:12:17 AM
 #68

I created the bot to profit starting w/ btc, but like many requested here, next version will be able to start w/ USD or any fiat..

Great job, I would take a doubt, apparently the bot is configured to obtain profit in U.S. dollars, how do I flip and make a profit in bitcoin?  Huh

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 08, 2014, 10:28:04 AM
 #69

I left the bot running all night with default settings and I've lost almost 20% of the amount I had. Apparently it's selling low and buying high, always:

https://i.imgur.com/0SKCo7m.jpg

What should I change in the settings to stop this behaviour? Is there any reason for this?
intrd (OP)
Member
**
Offline Offline

Activity: 75
Merit: 10

HAL10K developer


View Profile WWW
January 08, 2014, 01:03:26 PM
 #70

New version released!
found a critical mistake at code, please update..

* v2.3 beta 1
   * - Fixed critical error at Market Direction decision (always returning MA, not EMA)

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 08, 2014, 01:52:34 PM
 #71

will that fix the behaviour i exposed?
intrd (OP)
Member
**
Offline Offline

Activity: 75
Merit: 10

HAL10K developer


View Profile WWW
January 08, 2014, 02:50:02 PM
 #72

Yes,
download the new version and simulate yesterday data (fakegox_tickers(1.6-1.8 ).txt) on Backtesting mode w/ your config..

Code:
Starting HAL10K with 0.04161308 BTC buyd @ 1015.00000

$ask [btc:0/usd:43.07] @ $1035 (profit) #transaction
$bid [btc:0.0456/usd:0] @ $940.77778 (profit) #transaction



will that fix the behaviour i exposed?

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 08, 2014, 03:27:56 PM
 #73

I started it again, I ll report back in 45 minutes as before to see what happens. I want to recover the 20% i lost Tongue
facundop
Newbie
*
Offline Offline

Activity: 27
Merit: 0


View Profile
January 08, 2014, 04:55:59 PM
 #74

Not sure if working as intended, I just lost a big chunk of money. It sold at $900 what I bought at $935:

https://i.imgur.com/LJzxaT6.jpg
michelDiz
Newbie
*
Offline Offline

Activity: 17
Merit: 0


View Profile
January 08, 2014, 07:59:54 PM
 #75

How to config others API? I want to test in an other market différent (no just MTgox).

Thanks
morp17
Member
**
Offline Offline

Activity: 87
Merit: 10



View Profile
January 08, 2014, 10:06:33 PM
 #76

Very good Smiley I think most people prefer profit in BTC is where it has more advantages. Cool


I created the bot to profit starting w/ btc, but like many requested here, next version will be able to start w/ USD or any fiat..

Great job, I would take a doubt, apparently the bot is configured to obtain profit in U.S. dollars, how do I flip and make a profit in bitcoin?  Huh

฿itcoin: 36tHHEBp7QwePa76dMsN4KVbN3VhvK3rbu
facundop
Newbie
*
Offline Offline

Activity: 27
Merit: 0


View Profile
January 09, 2014, 01:37:56 AM
 #77

Well I gave it many many tries, but it doesn't work me. I've lost too much money already.
Sephera
Member
**
Offline Offline

Activity: 112
Merit: 10



View Profile WWW
January 09, 2014, 03:56:40 AM
 #78

Has anyone made money running this bot?
joesmoe2012
Hero Member
*****
Offline Offline

Activity: 882
Merit: 501


Ching-Chang;Ding-Dong


View Profile WWW
January 10, 2014, 12:19:41 PM
 #79

I think it's more a matter of getting everyting tweaked correctly to make money. No bot is simply plug and play.

Check out BitcoinATMTalk - https://bitcoinatmtalk.com
yahma
Newbie
*
Offline Offline

Activity: 43
Merit: 0


View Profile
January 10, 2014, 05:36:44 PM
 #80

Nice project! I would like to help out if I can.  What is the current status of BTC-e and Vircurex api?

p.s. I've done much bot programming before, and unless the paper-trading simulates all the nuances of a real market, its VERY unlikely the bot will act the same IRL vs. papertrading
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!