Author

Topic: Automated Trading Platform - Any Interest? (Read 4351 times)

full member
Activity: 179
Merit: 100
September 16, 2012, 10:49:11 AM
#43
Awesome Isis, I must I say think your awesome for putting this up and the work you are doing on open-pay, I like the idea of the project and will be following it in the future Smiley
full member
Activity: 154
Merit: 102
full member
Activity: 154
Merit: 102
September 15, 2012, 06:25:43 PM
#41
do i donate to you signature address or there is another donation for this java software ?



Signature address is fine.  Its the address for the Open Payment Alliance, but at the moment that's just me.

Once we get some more members then I will deep freeze that key.
full member
Activity: 154
Merit: 102
September 15, 2012, 06:18:22 PM
#40
It's up!
https://github.com/openpay/OpenPay/blob/master/Isis-ATP/bin/isis.jar
If someone would please compile a 32 bit version and get it to me I'll put that one up too.

Please consider donating if you find this application useful especially if it makes you a profit Wink
USE AT YOUR OWN RISK!

DO NOT USE THIS TO TRADE MONEY YOU CANNOT AFFORD TO LOSE!
ALSO THE STOP LOSS FUNCTION HAS BEEN REMOVED UNTIL FURTHER NOTICE, SO BE CAREFUL.

I'll be creating a new thread with information on configuration, setup etc.
member
Activity: 112
Merit: 10
September 14, 2012, 08:18:48 PM
#39
I've decided that I don't have the time or resources to commercialize it.
I need to get back to openpay as soon as possible and this bot is turning into a huge time sink.

I don't want to dink around with licensing enforcement, drm and other bs, so I'm going to gpl it and put it up on github.  If it makes you some money please consider donating something to openpay because I'm between contracts right now and really want to see that come to life before I go back to fulltime work
.

You sir are a gentleman and a scholar. Also, it will be fun hacking this thing apart! Cheesy
full member
Activity: 154
Merit: 102
September 14, 2012, 07:59:14 PM
#38
I've decided that I don't have the time or resources to commercialize it.
I need to get back to openpay as soon as possible and this bot is turning into a huge time sink.

I don't want to dink around with licensing enforcement, drm and other bs, so I'm going to gpl it and put it up on github.  If it makes you some money please consider donating something to openpay because I'm between contracts right now and really want to see that come to life before I go back to fulltime work
.
legendary
Activity: 1358
Merit: 1002
September 14, 2012, 07:51:47 PM
#37
I can test it if you'd like. With the money I lost to pirate I don't mind losing 100 BTC more testing your bot. 
Go big or go bust. Fuck it. lol

Ya know it's both funny and sad.  I generated an address back when Pirate was considered at least somewhat legit. 
1M8nRjt4XGVrd7cnwn1V....

First mate anyone?
Wasn't a vanity thing, just sorta happened that way. I'm considering removing it from my wallet.

Back to the topic at hand though.  I've got one more show stopper to track down and then I'm posting jars.


OK.  Pm me the bot with instructions to set it up if they're needed and I'll let it burn 100 BTC.  Let's hope not lol
full member
Activity: 154
Merit: 102
September 14, 2012, 07:44:55 PM
#36
I can test it if you'd like. With the money I lost to pirate I don't mind losing 100 BTC more testing your bot. 
Go big or go bust. Fuck it. lol

Ya know it's both funny and sad.  I generated an address back when Pirate was considered at least somewhat legit. 
1M8nRjt4XGVrd7cnwn1V....

First mate anyone?
Wasn't a vanity thing, just sorta happened that way. I'm considering removing it from my wallet.

Back to the topic at hand though.  I've got one more show stopper to track down and then I'm posting jars.
BCB
vip
Activity: 1078
Merit: 1002
BCJ
September 14, 2012, 05:12:14 PM
#35
That's the attitude psy. Bitcoin (any) speculation is not for the faint of heart
legendary
Activity: 1358
Merit: 1002
September 14, 2012, 04:50:44 PM
#34
I can test it if you'd like. With the money I lost to pirate I don't mind losing 100 BTC more testing your bot. 
Go big or go bust. Fuck it. lol
zaj
member
Activity: 103
Merit: 10
September 14, 2012, 03:18:24 PM
#33
does the volume matter for a trading bot? since the eu volume is in the single digits at times ... wouldnt it be better to trade on gox usd since its more active?
full member
Activity: 154
Merit: 102
September 14, 2012, 02:15:31 PM
#32
As of a couple minutes ago my bot crashed.  Evidently it tried to divide by zero during an Ask and I just didn't think to trap for it there.

Since it crashed I'm going to have to calculate my Profit & Loss by hand.

0.00000000BTC  &  51.2989USD

I started this with 2 BTC and 0 USD.
I sold 1 BTC for 10.92 USD

Thus my original 2 BTC were worth $21.84 at the time
Now if I had just held onto my 2 until now the strike price currently being $11.79, I would have had $23.58.

$23.58 - $21.84 = $1.74

$51.29 - $23.58 = $27.71

That's a 145% increase! (assuming I did the math correctly)  
Although now the algorithm has to wait for the market to come back down for me to keep in the game, or I have to find some way to fund my mtgox account with more money Wink






member
Activity: 112
Merit: 10
September 14, 2012, 02:11:42 PM
#31
This is interesting. I am in if a spot opens up for further testing.
member
Activity: 70
Merit: 10
Who shot who in the what now?
September 14, 2012, 01:23:01 PM
#30
This looks really interesting. I'll keep an eye on you! Wink
I'm not on MtGox, so unfortunately I can't help testing the algorithms.


Keep it up!
drekk

full member
Activity: 154
Merit: 102
September 14, 2012, 10:43:10 AM
#29
Not sure if you saw my PM last night. I'm interested in letting it go wild on my mtgox account.

My pm box is so flooded right now its going to tak a long time to go through it all.
Since we have 2 algorithims to test I may want to bring in 20.  Right now we are at 10 with 5 in reserve.

I will do some more math and let you know what I come up with.  Just not sure I can support 20 people right now.
hero member
Activity: 697
Merit: 500
September 14, 2012, 10:16:16 AM
#28
Not sure if you saw my PM last night. I'm interested in letting it go wild on my mtgox account.
full member
Activity: 154
Merit: 102
September 14, 2012, 09:44:53 AM
#27
So I realized that some trades were failing to execute because they were below the minimum tradeable amount.
This was triggering a flaw in the ordering logic which was the source of some of the more interesting notes in my logs.
I've now added both min and max currency amounts.

Quote
High: Ticker [timestamp=2012-09-14T12:37:52.430Z, last=USD 11.52338, bid=USD 11.52338, ask=USD 11.52572, tradableIdentifier=BTC, volume=2949494761223]
Low: Ticker [timestamp=2012-09-14T12:42:37.605Z, last=USD 11.43251, bid=USD 11.43351, ask=USD 11.5233, tradableIdentifier=BTC, volume=2944701489592]
Current: Ticker [timestamp=2012-09-14T13:30:05.568Z, last=USD 11.51, bid=USD 11.451, ask=USD 11.51, tradableIdentifier=BTC, volume=2959960727343]
VWAP: 11.51947
The market is trending down.


Sep 14, 2012 7:30:47 AM org.open.payment.alliance.isis.atp.TradingAgent evalBid
INFO: Attempting to buy 0.00000000 USD
Sep 14, 2012 7:30:47 AM org.open.payment.alliance.isis.atp.TradingAgent evalBid
INFO: 0.00000000 was less than the configured minimum of 0.01
Increasing order size to 0.01
Sep 14, 2012 7:30:47 AM org.open.payment.alliance.isis.atp.TradingAgent marketOrder
INFO: You are in simulation mode, the transaction below did NOT actually occur.
Sep 14, 2012 7:30:47 AM org.open.payment.alliance.isis.atp.TradingAgent marketOrder
INFO: Successfully bought 0.01 at current market price.

So it looks like that part is resolved.  Now for the interesting part.

In my code the algorithm is using max only as a ceiling constraint and it's calculating how much to trade using your balance as the starting point.

When I ran my simulations on the hadoop cluster max was used in the same place in the algorithm as we're using the balance now.

Both situations will always produce a trade between 0 and Max.  The difference being, if you have a substantial balance you'll be trading Max much more often, where as the optimal algorithm identified by my simulations had Max being traded rarely if ever.

I'd like to test both and see which is more performant.  I have a hunch that this "mistake" is primarily why I'm seeing such high profit/loss.

I'll add an option to the setup interview to let you pick one or the other but I need you to pick, understand the risks and roll with it for the entire month.  Keep in mind that the difference is in how much is risked per trade, the decision on whether or not it's time to trade at all is a different step.

So let's walk through it a moment.

With the ATP, trading occurs in two steps.  

First is to determine "are market conditions favoring, buy, sell or hold right now?"
Second is to determine "how much do I trade right now?"

Market Conditions means all trades that have actually occurred in the last hour.

These are summed at each tick and a VWAP (Volume Weighted Average Price) (Each trade on the ticker multiplied by each trade's quantity.  Each is then summed and the sum is divided by the total volume)
 
3 indicators called arrows are generated as well, we have a trendArrow, bidArrow and askArrow.

Each arrow can be any one of positive, negative or 0.
If it's 0 that means the market is completely flat, so we have to wait.

If the trendArrow is positive it means that prices for bitcoins are going up relative to your local currency, thus we should look at selling some of ours off.  If the trendArrow is down, then it means prices are going down relative to your local currency and we should look at buying.

Once the trendArrow has been evaluated and we know the market is trading, we want to time our entry and exit into the market to maximize our profit.

We do that by comparing the last trade with the vwap.  

If the trendArrow is up, then we compare the last trade from the ticker with the vwap.  If it's above the vwap then we sell (at market prices).

If the trendArrow is down, then we compare the last trade from the ticker with the vwap.  If it's below the vwap then we buy (again at market prices).

The decision has now been set in stone, we are buying (or selling).  The only question now is how many BTC do we buy or sell?

Here are the two Bid algorithms in question, the Ask is the same algo, but instead of askArrow we use the bidArrow and instead of local currency we use BTC

I'll let you do your own math.

Trading Algorithm 1
Code:
BigDecimal weight = new BigDecimal((askArrow / ticker.size()) * (trendArrow / ticker.size()));
BigDecimal balance = AccountManager.getInstance().getBalance("USD").getAmount();
BigDecimal amountToSpend = balance.multiply(weight).multiply(fee);



Algorithm 2
Code:

BigDecimal weight = new BigDecimal((askArrow / ticker.size()) * (trendArrow / ticker.size()));
BigDecimal amountToSpend = maxLocal.multiply(weight).multiply(fee);




The askArrow (or bidArrow if we're selling), is calculated the same way as the trendArrow but uses the "ask" value from the ticker.
It's purpose is to let us know if people(or bots) placing limit orders are raising or lowering their prices.

Both of these values are multiplied together to give us a weight.

That weight is multiplied against (max or balance) and determines how MUCH we are trading.

That's it for now.  You now know enough (hopefully) to choose your trading algorithm. Let me know what you think!
sr. member
Activity: 386
Merit: 250
September 14, 2012, 09:34:01 AM
#26
my local currency is euro but i can still use gox usd. so how do i get started? Smiley

There are two ways.
You can wait a day or so and I'll have it localized, which honestly is the best option.

The second option is to open a USD wallet.  To do that, log into mtgox.  Go to settings.  Change the default currency to USD and check the box that says "create a new wallet in that currency", then hit save.  Next trade 1BTC or whatever into that currency so you have a balance.

If your still looking or taking folks to work with this happy to help or get in line to help
zaj
member
Activity: 103
Merit: 10
September 14, 2012, 08:48:53 AM
#25
il wait a day then Smiley
full member
Activity: 154
Merit: 102
September 14, 2012, 08:35:59 AM
#24
my local currency is euro but i can still use gox usd. so how do i get started? Smiley

There are two ways.
You can wait a day or so and I'll have it localized, which honestly is the best option.

The second option is to open a USD wallet.  To do that, log into mtgox.  Go to settings.  Change the default currency to USD and check the box that says "create a new wallet in that currency", then hit save.  Next trade 1BTC or whatever into that currency so you have a balance.
zaj
member
Activity: 103
Merit: 10
September 14, 2012, 08:23:47 AM
#23
my local currency is euro but i can still use gox usd. so how do i get started? Smiley
full member
Activity: 154
Merit: 102
September 14, 2012, 08:18:41 AM
#22
still need someone?

Ya sure, welcome aboard.
zaj
member
Activity: 103
Merit: 10
September 14, 2012, 08:00:42 AM
#21
still need someone?
BCB
vip
Activity: 1078
Merit: 1002
BCJ
September 14, 2012, 07:17:58 AM
#20
USD
full member
Activity: 154
Merit: 102
September 13, 2012, 11:36:34 PM
#19
Ok I think we're all full for now.
If more room opens up I'll post here, so watch this thread.

In the meantime, I need to know what local currencies are being used.

The bot is working with USD right now, but I wasn't watching closely when I coded this stuff and some places have USD hard coded.
I'm going through and fixing it, but if everyone right now is on USD then that's something I can backburner to try and get some of the other issues cleaned up such as coming out of full stop etc.
full member
Activity: 154
Merit: 102
full member
Activity: 173
Merit: 102
September 13, 2012, 11:15:50 PM
#17
am i in? Smiley
full member
Activity: 154
Merit: 102
September 13, 2012, 11:11:58 PM
#16
any more places left ?

Only 2 more slots after you.
full member
Activity: 154
Merit: 102
September 13, 2012, 11:10:29 PM
#15
Ugh...

I really need to work on some of these log messages.
Quote
High: Ticker [timestamp=2012-09-14T03:32:44.963Z, last=USD 11.48, bid=USD 11.411, ask=USD 11.48, tradableIdentifier=BTC, volume=2474899142791]
Low: Ticker [timestamp=2012-09-14T02:59:20.378Z, last=USD 11.3925, bid=USD 11.3925, ask=USD 11.45, tradableIdentifier=BTC, volume=2564530722153]
Current: Ticker [timestamp=2012-09-14T03:57:13.588Z, last=USD 11.48, bid=USD 11.42, ask=USD 11.48, tradableIdentifier=BTC, volume=2521263487173]
VWAP: 11.39688
The market is trending up.


Sep 13, 2012 9:59:05 PM org.open.payment.alliance.isis.atp.TradingAgent evalAsk
INFO: Attempting to sell 0E-8 of 1.92244874 BTC
Sep 13, 2012 10:04:09 PM org.open.payment.alliance.isis.atp.TradingAgent marketOrder

Sep 13, 2012 9:59:05 PM org.open.payment.alliance.isis.atp.TradingAgent marketOrder
INFO: Successfully sold 0E-8 at current market price.

Overall they're pretty clear for anything over 1mBTC, but below that it gets a bit hokey.
I have a feeling it just tried to sell 1 Satoshi Smiley
full member
Activity: 154
Merit: 102
September 13, 2012, 10:44:03 PM
#14
For those who are wondering about what to start an account with.  I started with 2 btc then performed a market order to sell 1 btc which gave me 11 usd and some change.  That's frankly about all I could afford to risk.
My account as of this moment has 1.98btc and 24.00usd

Trades can be as small as the mtgox minimum trade which I think is 0.00005btc but I haven't looked too closely.  However it is the smallest trade I show in my history at the moment.
My stop loss is currently 0.25 or 25%,  I'm going to advise you folks to maybe make it 10 or 12% since your working with more money, but its up to you.

Understand the stop loss in this case is a bailout function that stops the trader from executing until the market recovers or you restart the app.  It won't close any positions since the trader works exclusively on market orders and thus all positions are closed automatically and a PL calculated at that point.
full member
Activity: 154
Merit: 102
September 13, 2012, 10:29:54 PM
#13
Ok so I Have a 32 bit operating system.

This works under the security center feature Advanced Api Key Creation, So I would just grant rights to trade and get info.
Then plug the key  that was created into your program.

I set up an acct with 25 btc for it.

Yes that's correct.  There is an interactive setup feature that will prompt you on first run ONLY for your API keys. 
You only need to give those keys minimal permissions.

During first run it will also ask basic questions such as max btc to buy or sell in a single order,  stop loss threshold etc.
full member
Activity: 193
Merit: 100
September 13, 2012, 10:18:46 PM
#12
Ok so I Have a 32 bit operating system.

This works under the security center feature Advanced Api Key Creation, So I would just grant rights to trade and get info.
Then plug the key  that was created into your program.

I set up an acct with 25 btc for it.
full member
Activity: 173
Merit: 102
September 13, 2012, 09:45:37 PM
#11
i'll give it a shot
full member
Activity: 154
Merit: 102
September 13, 2012, 09:44:30 PM
#10
I've been doing the math.  I think 10 people for 1 month will give me sufficient data.
So let's open this up and invite 5 more, but that is seriously my personal support maximum.

In the meantime, if you want to be a part of this, just voice it here in this thread.  The pm system is very unwieldy for this much communication.

Thanks!
full member
Activity: 154
Merit: 102
September 13, 2012, 09:39:48 PM
#9
Hey Isis , thanks for the add with the automated tradebot, I intend to use it in a seperate account to keep the data right for you and manual trades will not be done.

Anyway I havent figured out a btc amount to put in yet, but will it try to earn btc and not usd , that is what i want.

Would 20 be good ?  Start with 20 and add more later if successful.

Thanks again

Mysterious.

The algorithm is opportunistic.  It tries to maximize gains on both sides while limiting losses.  I've added a full stop option as well.  The full stop let's you specify a max loss you will tolerate.  Since the loss is based on your account high balances it should function exactly like a trailing stop loss.
full member
Activity: 193
Merit: 100
September 13, 2012, 09:20:48 PM
#8
Hey Isis , thanks for the add with the automated tradebot, I intend to use it in a seperate account to keep the data right for you and manual trades will not be done.

Anyway I havent figured out a btc amount to put in yet, but will it try to earn btc and not usd , that is what i want.

Would 20 be good ?  Start with 20 and add more later if successful.

Thanks again

Mysterious.
BCB
vip
Activity: 1078
Merit: 1002
BCJ
September 13, 2012, 08:17:18 PM
#7
Sign me up.
full member
Activity: 154
Merit: 102
September 13, 2012, 08:08:06 PM
#6
Got this in my log a little bit ago.  Found it humorous and thought I'd share.

Quote
Sep 13, 2012 5:36:31 PM org.open.payment.alliance.isis.atp.TradingAgent evalBid
INFO: Attempting to sell 0.00000 of 24.16351 USD

Sep 13, 2012 5:36:31 PM org.open.payment.alliance.isis.atp.TradingAgent marketOrder
INFO: Successfully bought 0.00000 at current market price.

Two problems with that log statement, but fortunately it's just a cosmetic. 
My trading history shows an order for 2 bitcoins at $12.0817 placed at that time.
full member
Activity: 154
Merit: 102
September 13, 2012, 07:11:35 PM
#5
Sure, why not.

It sounds like this is either in C or C++. Is there a platform restriction? Or is it ANSI/ISO?

*Thanks for your interest, I've updated the original post accordingly*

Actually it's in Java.  I've tested it successfully on Ubuntu Precise 64bit.  I don't see any reason why it wouldn't run on anything with a Java 6 JVM although I may have to rebuild the jar if someone needs a 32bit version.
newbie
Activity: 32
Merit: 0
September 13, 2012, 07:03:34 PM
#4
Sure, why not.

It sounds like this is either in C or C++. Is there a platform restriction? Or is it ANSI/ISO?
full member
Activity: 154
Merit: 102
September 13, 2012, 06:53:40 PM
#3
Sure, sign me up!


Original post updated accordingly Wink  Thanks!
sr. member
Activity: 408
Merit: 261
September 13, 2012, 06:50:55 PM
#2
Sure, sign me up!
full member
Activity: 154
Merit: 102
September 13, 2012, 06:10:06 PM
#1
I'm just wanting to take a moment and test the waters to see what the interest level is in an automated trading platform.

In the process of writing the unit tests for the Exchange Connector for OpenPay I realized that I had essentially created a trading bot.
For fun I ran all the MtGox data I could get my hands on through a hadoop cluster and tested it against a few conservative algorithms that I had learned while pursuing my MBA.

The algorithm that showed the most potential was one that makes numerous small trades against the trendline and scales the size of each trade with a weighted volume calculation.  It sounds complex, but in reality it's not.  If the market is falling you buy, if it's gaining you sell.

Anyways to make a long story short I coded a trading engine around the algorithm and ran it in simulation mode for 48 hours.

The first day it gained 350% (It managed to turn 1 BTC into 3.5 so don't take it to mean anything much.)
The second day it lost 65% of the previous days gains which leaves me with 1.225 or a total gain of 22.5% in 48 hrs.
Near the end of the second day it also caught a null pointer exception (which is now fixed) and shut down while I was paying attention to something else.

I don't have enough data to say if this will work consistently over the long term or not, but if it does I would like to commercialize it.
Therefore I need more data.

In an effort to get this data, I'm looking for 5 volunteers who are willing to let it run against live accounts and see what happens.

I DO NOT RECOMMEND YOU KEEP ANY MONEY IN THE ACCOUNT YOU ARE NOT PREPARED TO LOSE!

In exchange for letting it run for a few weeks to gather data the product is yours to keep forever and if it's ever commercialized you will receive lifetime free upgrades.

All I ask for is a daily email with the profit/loss and the log file.  And personal testimonials at the end of the data collection run.

I'm going to limit this to 5 people at the outset so that the overall exposure is limited.  I'm willing to help with setup and debug issues, but overall I don't have a lot of time to devote to this project right now and I can't let myself get bogged down with too many support requests.

I have 4 volunteers already and we need 1 more.

If you're interested let me know.


F.A.Q.
     Q. *What platforms will this thing run on?*
     A.  It's written in Java.  I targeted a 64 bit version of the Java 6 JRE and have tested it on Ubuntu Precise 64bit.  Nevertheless it should run on anything with a Java 6 JVM.  If anyone needs a 32bit version let me know and I'll recompile it against the 32 bit JVM for you.
Jump to: