Bitcoin Forum
November 13, 2024, 04:24:47 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] 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 »
  Print  
Author Topic: Isis ATP [Automated Trading Platform] - Discussion  (Read 45225 times)
Raoul Duke
aka psy
Legendary
*
Offline Offline

Activity: 1358
Merit: 1002



View Profile
September 18, 2012, 02:51:01 AM
 #101

I get the impression it's hard to teach java how to math
Code:
INFO: Current ask price os USD 11.9 is below the VWAP of USD 11.89912

That's not a java math problem, just a matter of not using below/above when it's selling/buying
isis (OP)
Full Member
***
Offline Offline

Activity: 154
Merit: 102


View Profile
September 18, 2012, 02:52:32 AM
 #102

Are there any unit tests associated with this trading agent?

Based on the number of defects identified so far, the software engineer in me is kicking in and going "you really shouldn't be playing with this until it has better test coverage"

Sorry guys I was AFK.  If something like this is uncovered in the future and I haven't responded in 10 minutes or less, text me 801-477-7150 and I'll respond as soon as possible.

As far as unit test, the code base is too influx for unit test to be of much use.  So much changes from commit to commit that by the time I would write a unit test it would be effectively invalid and trying to fix it would delay releasing a critical fix such as this even further.

Yes this is a >< transposition, according to the commit logs I screwed this up in the last commit.

Fortunately it's in the buy section and it's making it so the buy threshold is never reached.  According to the algorithm you've missed some bargains, but it looks like it hasn't cost anything yet.  The bad part is that if that threshold were to somehow become positive (a market crash) you would end up lots of buying lots of bitcoins at WAY above market rates.

I'm going to swap the comparators and commit.  I apologize for the bug.

Interested in OpenPay?
https://github.com/openpay
Donate to show your appreciation and support the effort!

1LMDCSAwjhT2Vp1sSf62dybEYW3MYpsoZj

Pyramining Links - Help OpenPay and get a 10% bonus on your funds.
http://pyramining.com/referral/zre9ysgqt
http://pyramining.com/referral/ans9km72g
http://pyramining.com/referral/f3k4xebzp
http://pyramining.com/referral/nc3ag2sdb
Raoul Duke
aka psy
Legendary
*
Offline Offline

Activity: 1358
Merit: 1002



View Profile
September 18, 2012, 02:56:42 AM
 #103

Are there any unit tests associated with this trading agent?

Based on the number of defects identified so far, the software engineer in me is kicking in and going "you really shouldn't be playing with this until it has better test coverage"

Who cares. After playing with pirate it can't get any worse lol
Raoul Duke
aka psy
Legendary
*
Offline Offline

Activity: 1358
Merit: 1002



View Profile
September 18, 2012, 02:59:55 AM
 #104

BTW, my bot crashed because of connectivity issues. It should probably just wait instead of crashing.
isis (OP)
Full Member
***
Offline Offline

Activity: 154
Merit: 102


View Profile
September 18, 2012, 03:04:37 AM
 #105

Thats what I mentioned in the other thread, the EMA wont work very well if you are not selling at opposite ends of the swings. From what I have seen the bots everyone running are doing they are doing .01 whenever the price swings either way and damn the fees.

It's not supposed to do that.  Earlier we had a bug where weight was coming in at 0 so it was trading the whole trendline.
In this bug the weight was negative so I had to abs the weight to get the right value since we can't trade a negative amount.

It should be executing a buy or sell at the peaks or valleys.  In this case it was executing sells at the peaks but not buying at the valleys.

Interested in OpenPay?
https://github.com/openpay
Donate to show your appreciation and support the effort!

1LMDCSAwjhT2Vp1sSf62dybEYW3MYpsoZj

Pyramining Links - Help OpenPay and get a 10% bonus on your funds.
http://pyramining.com/referral/zre9ysgqt
http://pyramining.com/referral/ans9km72g
http://pyramining.com/referral/f3k4xebzp
http://pyramining.com/referral/nc3ag2sdb
isis (OP)
Full Member
***
Offline Offline

Activity: 154
Merit: 102


View Profile
September 18, 2012, 03:06:05 AM
 #106

I stared at this
Code:
if(qtyToBuy.compareTo(minLocal) < 0){
for 10 full minutes without realizing the issue. Fixed and built.


Close, but what actually needed to happen is the weight needed to be absoluted before being applied.

Interested in OpenPay?
https://github.com/openpay
Donate to show your appreciation and support the effort!

1LMDCSAwjhT2Vp1sSf62dybEYW3MYpsoZj

Pyramining Links - Help OpenPay and get a 10% bonus on your funds.
http://pyramining.com/referral/zre9ysgqt
http://pyramining.com/referral/ans9km72g
http://pyramining.com/referral/f3k4xebzp
http://pyramining.com/referral/nc3ag2sdb
isis (OP)
Full Member
***
Offline Offline

Activity: 154
Merit: 102


View Profile
September 18, 2012, 03:13:32 AM
 #107

I stared at this
Code:
if(qtyToBuy.compareTo(minLocal) < 0){
for 10 full minutes without realizing the issue. Fixed and built.


Close, but what actually needed to happen is the weight needed to be absoluted before being applied.


I'm the king of getting this wrong. I will wait for the commit then.
edit: another 5 bitcents your way for being awesome.

Don't feel bad, my gut instinct originally told me that was it too.  But then I put the code into the debugger, set a break point and stepped through it, double checking the math the whole way.

We can't buy or sell a negative number.  The weight if negative multiplied by a balance (which by defintion is positive or 0 (local or BTC)) is going to yield a negative.  Ergo, the weight needs to be absolute.

Interested in OpenPay?
https://github.com/openpay
Donate to show your appreciation and support the effort!

1LMDCSAwjhT2Vp1sSf62dybEYW3MYpsoZj

Pyramining Links - Help OpenPay and get a 10% bonus on your funds.
http://pyramining.com/referral/zre9ysgqt
http://pyramining.com/referral/ans9km72g
http://pyramining.com/referral/f3k4xebzp
http://pyramining.com/referral/nc3ag2sdb
isis (OP)
Full Member
***
Offline Offline

Activity: 154
Merit: 102


View Profile
September 18, 2012, 03:25:09 AM
 #108

Fix has been comitted.
Please upgrade immediately.

This also fixes part of the Overall PL by normalizing the BTC component to local currency before computing the PL.  Overall PL % is still broken but the currency amount is correct.


Interested in OpenPay?
https://github.com/openpay
Donate to show your appreciation and support the effort!

1LMDCSAwjhT2Vp1sSf62dybEYW3MYpsoZj

Pyramining Links - Help OpenPay and get a 10% bonus on your funds.
http://pyramining.com/referral/zre9ysgqt
http://pyramining.com/referral/ans9km72g
http://pyramining.com/referral/f3k4xebzp
http://pyramining.com/referral/nc3ag2sdb
isis (OP)
Full Member
***
Offline Offline

Activity: 154
Merit: 102


View Profile
September 18, 2012, 03:40:47 AM
Last edit: September 18, 2012, 05:41:34 AM by isis
 #109

I'm going to eventually have to refactor both the evalAsk & evalBid.

Half the problem is that significant sections of code are duplicated between the two functions.  Honestly it doesn't need to be that way, it's just rushed and sloppy.

Anyways it seems to be working now so I'll clean it up, write some unit tests and then leave this part the heck alone.

Thanks for your patience everyone!

Interested in OpenPay?
https://github.com/openpay
Donate to show your appreciation and support the effort!

1LMDCSAwjhT2Vp1sSf62dybEYW3MYpsoZj

Pyramining Links - Help OpenPay and get a 10% bonus on your funds.
http://pyramining.com/referral/zre9ysgqt
http://pyramining.com/referral/ans9km72g
http://pyramining.com/referral/f3k4xebzp
http://pyramining.com/referral/nc3ag2sdb
Ignatius
Sr. Member
****
Offline Offline

Activity: 409
Merit: 250


View Profile
September 18, 2012, 03:41:55 AM
 #110

BTW, my bot crashed because of connectivity issues. It should probably just wait instead of crashing.

Same issue here.

Fix has been comitted.
Please upgrade immediately.

This also fixes part of the Overall PL by normalizing the BTC component to local currency before computing the PL.  Overall PL % is still broken but the currency amount is correct.

I don't see the commit yet, but I will keep an eye on it. Thanks isis
isis (OP)
Full Member
***
Offline Offline

Activity: 154
Merit: 102


View Profile
September 18, 2012, 04:15:22 AM
 #111

BTW, my bot crashed because of connectivity issues. It should probably just wait instead of crashing.

Same issue here.

Fix has been comitted.
Please upgrade immediately.

This also fixes part of the Overall PL by normalizing the BTC component to local currency before computing the PL.  Overall PL % is still broken but the currency amount is correct.

I don't see the commit yet, but I will keep an eye on it. Thanks isis

I'm just having one of those days ending in Y (why).

Just pushed the commit to the central repo on the master branch.

Interested in OpenPay?
https://github.com/openpay
Donate to show your appreciation and support the effort!

1LMDCSAwjhT2Vp1sSf62dybEYW3MYpsoZj

Pyramining Links - Help OpenPay and get a 10% bonus on your funds.
http://pyramining.com/referral/zre9ysgqt
http://pyramining.com/referral/ans9km72g
http://pyramining.com/referral/f3k4xebzp
http://pyramining.com/referral/nc3ag2sdb
isis (OP)
Full Member
***
Offline Offline

Activity: 154
Merit: 102


View Profile
September 18, 2012, 05:39:26 AM
 #112

Up and building market profile.

I'll skip the fine details for today's P/L - it's a lot of sell, down about BTC0.11 overall, if I bought back to BTC. This should not be counted against the current build, for anyone reading into it.

Here's to actually trading!

I ran out of bitcoins, likely because of the no-buying bug.
I do have $59.15 USD now that I get to hold onto until the market corrects *sigh*

Morning balance $53.91
Current balance  $59.15

Profit= $5.24
%PL = 9.71%

Market Change for the day

Market Open = $11.81
Market Close = $11.93

Market Profit = 0.12USD/BTC
%change = 1.01%

Even with all the issues encountered today the application managed to beat the market a little bit.

Interested in OpenPay?
https://github.com/openpay
Donate to show your appreciation and support the effort!

1LMDCSAwjhT2Vp1sSf62dybEYW3MYpsoZj

Pyramining Links - Help OpenPay and get a 10% bonus on your funds.
http://pyramining.com/referral/zre9ysgqt
http://pyramining.com/referral/ans9km72g
http://pyramining.com/referral/f3k4xebzp
http://pyramining.com/referral/nc3ag2sdb
isis (OP)
Full Member
***
Offline Offline

Activity: 154
Merit: 102


View Profile
September 18, 2012, 08:09:24 AM
 #113

I cleaned up some of the messages a bit and tidied up some sections of code so it doesn't jump down any unnessecary rabbit holes anymore.
This will be my last release for a bit unless something major is uncovered.

I've decided to take a bit more time with the multi-currency arbitrage version.  This experience has shown me that it would be best if when I write financial apps that I take a "test first" approach instead of the agile rapid iteration process that I've been using.

All in all with it's latest release, the bot seems pretty stable now.

Interested in OpenPay?
https://github.com/openpay
Donate to show your appreciation and support the effort!

1LMDCSAwjhT2Vp1sSf62dybEYW3MYpsoZj

Pyramining Links - Help OpenPay and get a 10% bonus on your funds.
http://pyramining.com/referral/zre9ysgqt
http://pyramining.com/referral/ans9km72g
http://pyramining.com/referral/f3k4xebzp
http://pyramining.com/referral/nc3ag2sdb
Raoul Duke
aka psy
Legendary
*
Offline Offline

Activity: 1358
Merit: 1002



View Profile
September 18, 2012, 11:31:22 AM
 #114

It sold almost all my BTC yesterday. I stopped it when it wasn't buying and only upgraded this morning because it was getting late yesterday.
It's working for 1 hour now, let's wait and see what it does. I hope losing all the market data isn't a big problem.
BCB
CTG
VIP
Legendary
*
Offline Offline

Activity: 1078
Merit: 1002


BCJ


View Profile
September 18, 2012, 04:42:19 PM
 #115

me too.  I updated with the latest commit last night and this morning it had sold almost all of my [edit]USD for[/edit] bitcoin.

isis (OP)
Full Member
***
Offline Offline

Activity: 154
Merit: 102


View Profile
September 18, 2012, 08:07:42 PM
 #116

It sold almost all my BTC yesterday. I stopped it when it wasn't buying and only upgraded this morning because it was getting late yesterday.
It's working for 1 hour now, let's wait and see what it does. I hope losing all the market data isn't a big problem.

It only considers the last hour of data so that's not a problem.

We've had a huge surge in the market this morning.  The algorithm is doing what it was designed to do, sell as the price is going up in proportion to the amount of pressure pushing the market up.  When the market pressure goes down it will start buying again in proportion to the amount of pressure pushing it down.

I do think that I could improve the algorithm a bit.

We need to institute water marks against each of the arrows so that it does a better job of capturing only the high and low points on a given curve.

It could do that by looking for a sustained upswing followed by indications of a down turn, then sell at the start of that downturn in proportion to the distance between the last buy and the current sell (profit proportional).

If we did this it would mean more profitability during huge surges like this, but might destabilize the price by triggering a rapid "race to the bottom" as everyone seeks to close out their positions as quickly as possible. 

Imagine a market with an hourly volume of 1000 suddenly being hit with 10,000 all at once and all seeking to sell at the market price.




Interested in OpenPay?
https://github.com/openpay
Donate to show your appreciation and support the effort!

1LMDCSAwjhT2Vp1sSf62dybEYW3MYpsoZj

Pyramining Links - Help OpenPay and get a 10% bonus on your funds.
http://pyramining.com/referral/zre9ysgqt
http://pyramining.com/referral/ans9km72g
http://pyramining.com/referral/f3k4xebzp
http://pyramining.com/referral/nc3ag2sdb
isis (OP)
Full Member
***
Offline Offline

Activity: 154
Merit: 102


View Profile
September 18, 2012, 08:14:48 PM
 #117

To continue my thought from above.

I've realized that the algorithm as it currently stands actually seeks to stabilize the price.
Thus if enough folks were running it the market would be less volatile.
However the algorithm only makes money from volatility (price volatility /hr = profit).

I'm going to run mine for a week and see how it compares with the market before tinkering with it again.

Interested in OpenPay?
https://github.com/openpay
Donate to show your appreciation and support the effort!

1LMDCSAwjhT2Vp1sSf62dybEYW3MYpsoZj

Pyramining Links - Help OpenPay and get a 10% bonus on your funds.
http://pyramining.com/referral/zre9ysgqt
http://pyramining.com/referral/ans9km72g
http://pyramining.com/referral/f3k4xebzp
http://pyramining.com/referral/nc3ag2sdb
isis (OP)
Full Member
***
Offline Offline

Activity: 154
Merit: 102


View Profile
September 18, 2012, 09:33:53 PM
 #118

Code:
Sep 18, 2012 9:01:48 PM org.open.payment.alliance.isis.atp.TradingAgent run
INFO: Ticker Size: 191 | Trend Arrow: 3.0 | Bid Arrow: 13.0 | Ask Arrow: 0.0 | VWAP: USD 12.11436
Sep 18, 2012 9:01:48 PM org.open.payment.alliance.isis.atp.TradingAgent evalAsk
INFO: Weight is 0.08376963350785341
Sep 18, 2012 9:01:48 PM org.open.payment.alliance.isis.atp.TradingAgent evalAsk
INFO: Attempting to sell 0.006257293403141361636458084305445481732022017240524291992187500 of 0.07469644 BTC available
Sep 18, 2012 9:01:49 PM org.open.payment.alliance.isis.atp.TradingAgent marketOrder
SEVERE: Failed to sell 0.006257293403141361636458084305445481732022017240524291992187500 at current market price.
Please investigate

down about ~0.18btc

Everyone who has suffered a loss in the current market please shutdown your bot for a little bit.
I'm working on refining the algorithm to ensure that it requires a profit on each trade and won't trade into a loss.

A loss is possible if there is an extended up trend with several upward bumps in market pressure and a large bid/ask spread.
What happens is that it runs out of bitcoins too quickly at what it believes will be the peak, but it turns out the sale actually occured someplace in the middle of the curve.

After about an hour that old volume drops out of the equation, the bot sees this as a change to vwap and it buys again, but ends up doing so at or above the price it previously sold at.

The change I'm going to make is to move from market orders to limit orders and set the price so that it splits the spread.
This will ensure that money isn't being left on the table.

In addition to those changes I'm going to modify the trading pathways to use cross currency arbitrage if there aren't sufficient funds to execute a trade at market prices.

This will have the effect of pulling in bitcoins from markets where the price is a bargain and selling them on the market that is currently generating profit.  It will also help to close the huge spreads we're currently seeing and ensure cross market liquidity.

If you've taken a loss and you've been running more than 6 hours with the latest version, please stop the bot until further notice and post your beginning and ending balances, in BTC & Local, along with the total runtime for the bot.

This will help me vet my numbers.


Interested in OpenPay?
https://github.com/openpay
Donate to show your appreciation and support the effort!

1LMDCSAwjhT2Vp1sSf62dybEYW3MYpsoZj

Pyramining Links - Help OpenPay and get a 10% bonus on your funds.
http://pyramining.com/referral/zre9ysgqt
http://pyramining.com/referral/ans9km72g
http://pyramining.com/referral/f3k4xebzp
http://pyramining.com/referral/nc3ag2sdb
isis (OP)
Full Member
***
Offline Offline

Activity: 154
Merit: 102


View Profile
September 18, 2012, 09:37:27 PM
 #119

Code:
Sep 18, 2012 9:01:48 PM org.open.payment.alliance.isis.atp.TradingAgent run
INFO: Ticker Size: 191 | Trend Arrow: 3.0 | Bid Arrow: 13.0 | Ask Arrow: 0.0 | VWAP: USD 12.11436
Sep 18, 2012 9:01:48 PM org.open.payment.alliance.isis.atp.TradingAgent evalAsk
INFO: Weight is 0.08376963350785341
Sep 18, 2012 9:01:48 PM org.open.payment.alliance.isis.atp.TradingAgent evalAsk
INFO: Attempting to sell 0.006257293403141361636458084305445481732022017240524291992187500 of 0.07469644 BTC available
Sep 18, 2012 9:01:49 PM org.open.payment.alliance.isis.atp.TradingAgent marketOrder
SEVERE: Failed to sell 0.006257293403141361636458084305445481732022017240524291992187500 at current market price.
Please investigate

down about ~0.18btc

Judging from the messages you might be running an version a little bit before the current version or you have minBTC set below the MtGox minimum trade amount 0.01BTC

Interested in OpenPay?
https://github.com/openpay
Donate to show your appreciation and support the effort!

1LMDCSAwjhT2Vp1sSf62dybEYW3MYpsoZj

Pyramining Links - Help OpenPay and get a 10% bonus on your funds.
http://pyramining.com/referral/zre9ysgqt
http://pyramining.com/referral/ans9km72g
http://pyramining.com/referral/f3k4xebzp
http://pyramining.com/referral/nc3ag2sdb
Ignatius
Sr. Member
****
Offline Offline

Activity: 409
Merit: 250


View Profile
September 18, 2012, 10:06:35 PM
 #120

Code:
Sep 18, 2012 3:49:20 PM org.open.payment.alliance.isis.atp.TradingAgent marketOrder
INFO: Current P/L: BTC -0.03346634 | -19.42325300%
Sep 18, 2012 3:49:20 PM org.open.payment.alliance.isis.atp.TradingAgent marketOrder
INFO: Current P/L: USD -10.48401 | -2.40800%
Sep 18, 2012 3:49:20 PM org.open.payment.alliance.isis.atp.TradingAgent marketOrder
INFO: Overall P/L: -10.889290724034 USD

Bought $500 worth of BTC. Sold off all BTC. 12 hrs, -$11.
Pages: « 1 2 3 4 5 [6] 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 »
  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!