Pages:
Author

Topic: ATP [Advanced Trading Platform] - page 5. (Read 20926 times)

member
Activity: 101
Merit: 10
June 21, 2013, 09:21:39 AM
That will make a lot of people happy

Nice to see activity with the atp and atpx

Thank you for keeping us informed

And yes it's pretty amazing what aido is doing!

Well both of you!

Talk soon

full member
Activity: 140
Merit: 101
June 21, 2013, 07:07:56 AM
I have an implementation of the MtGox streaming sockets API working.
I used the weberknecht websocket client and then exposed it's internals to the Java scripting engine.

It still needs some work, but I've been able to successfully stream the mtgox ticker as a proof of concept.
Code:
--open
--received message: {"channel":"24e67e0d-1cad-4cc0-9e7a-f8523ef460fe","channel_name":"depth.BTCUSD","op":"private","origin":"broadcast","private":"depth","depth":{"price":"109.77799","type":1,"type_str":"ask","volume":"0.6571238","price_int":"10977799","volume_int":"65712380","item":"BTC","currency":"USD","now":"1371815700524398","total_volume_int":"65712380"}}
--received message: {"channel":"24e67e0d-1cad-4cc0-9e7a-f8523ef460fe","channel_name":"depth.BTCUSD","op":"private","origin":"broadcast","private":"depth","depth":{"price":"107.58376","type":2,"type_str":"bid","volume":"0.19365289","price_int":"10758376","volume_int":"19365289","item":"BTC","currency":"USD","now":"1371815700722156","total_volume_int":"19365289"}}

At least though, there is no reason to rely on Xchange API
full member
Activity: 140
Merit: 101
June 21, 2013, 04:44:18 AM
Is already Java 7 for AidoATP.

New commit in develop branch btw which cleans up the trade locking mechanism.

Still trying to fix up the Arbitrage code.

I'm excited to see the changes you're making.  For a first time Java dev you've got some serious skill.
ATPx hasn't seen a commit yet because I'm having trouble testing it out.  My MtGox account is empty and BTC-e is too low to trade with.  That will likely remain the case until July.  However I'm about 80% code complete on it now.  40% if you figure that I'm going to tie in the scripting engine to the intimate parts of the system Smiley
Still I think the module based approach is better in the long haul for what we're trying to accomplish.

Also I'm adding AES encryption to the values stored in preferences API, so that all prefs are stored encrypted.  It's a simple enough change you should look at backporting it into AidoATP once it's committed, it adds a nice strong layer of security.
sr. member
Activity: 248
Merit: 252
1. Collect underpants 2. ? 3. Profit
June 21, 2013, 02:51:43 AM
Is already Java 7 for AidoATP.

New commit in develop branch btw which cleans up the trade locking mechanism.

Still trying to fix up the Arbitrage code.
full member
Activity: 140
Merit: 101
June 20, 2013, 08:37:20 PM
Java 6 was EOL'd today.  Guess we should move the build target to JDK7.
legendary
Activity: 965
Merit: 1000
June 20, 2013, 11:33:23 AM
That's why I use a single OrderBook in my code to send orders to exchanges.
sr. member
Activity: 248
Merit: 252
1. Collect underpants 2. ? 3. Profit
June 20, 2013, 11:27:24 AM
Good point, I think you mentioned previously that the arbitrage manager is not blocking trend trades properly. I'll look into it.

I will also make sure it blocks any other arbitrage trades that may be triggered in another thread. Although this is highly unlikely using the current polling method but it could possibly happen if we use a streaming ticker and we get two ticks in quick succession.
full member
Activity: 140
Merit: 101
June 20, 2013, 10:14:48 AM
Not positive here, but have your checked this to ensure the code is not re-entrant?  It seems like it could attempt a trade while another is in progress.  This could cause interesting and unexpected behavior.

Good job though, the code looks really good overall.
sr. member
Activity: 248
Merit: 252
1. Collect underpants 2. ? 3. Profit
June 20, 2013, 03:00:45 AM
OK, I'll flip it on the next release. Schoolboy error but I keep mixing that up.

Don't worry too much about the profit %. I haven't done the calculation for that yet and had hardcoded a very high number to ensure it outputs something even when there is a very small actual profit.

Thanks for the feedback.
member
Activity: 101
Merit: 10
June 20, 2013, 02:40:46 AM
thanks Aido
if you want to flip it then I will run( sim Mode ) it for 24 hours and post back the results

thank you




full member
Activity: 140
Merit: 101
June 20, 2013, 02:13:17 AM
Quote
Arbitrage Engine has detected an after fee profit opportunity of 9,998.8% on currency pair

You need to flip the direction of that calculation.  It's actually found a 9% loss in that direction.  Looking at the numbers I would say if you flip the calculation around (and fix the numberformat to report it properly.  You'll find a about a 9% opportunity in either USD/GBP or GBP/USD frankly I'm not sure which.

10,000% profit should be something we check for in an automated regression test though.
full member
Activity: 224
Merit: 100
June 19, 2013, 09:00:46 PM

Yeah, I also noticed that user is posting a lot of posts like that.  Seems to be going through and hitting another thread every few seconds.

Doesn't make sense to me either.
sr. member
Activity: 248
Merit: 252
1. Collect underpants 2. ? 3. Profit
June 19, 2013, 07:34:46 PM
sr. member
Activity: 248
Merit: 252
1. Collect underpants 2. ? 3. Profit
June 19, 2013, 07:21:47 PM
New commit available in the develop branch:

commit 3d17d46dc146cf4aa63ee7ecc3d9a1ce15f876ba

    Rough draft of new arbitrage class


This is a very rough and ready draft of the arbitrage code for testing purposes only. I'm not even sure if its going to work. It is in no way ready for the big time yet so please review code and provide feedback.

As part of testing, please check if the arbitrage engine is identifying the correct opportunities if there were no fees involved.

Ignore the double reporting of the opportunity, I'll fix that somehow.

Code:
2013-06-20 11:08:17,258 : DEBUG org.aido.atp.ArbitrageEngine [Thread-20] - MtGox Arbitrage profit after fee: 99.988
2013-06-20 11:08:17,259 : INFO  org.aido.atp.ArbitrageEngine [Thread-20] - Arbitrage Engine has detected an after fee profit opportunity of 9,998.8% on currency pair USD/GBP on MtGox
2013-06-20 11:08:17,260 : DEBUG org.aido.atp.ArbitrageEngine [Thread-20] - Last ticker Ask price was USD 108.49000
2013-06-20 11:08:17,260 : DEBUG org.aido.atp.ArbitrageEngine [Thread-20] - BTC/USD is 0.0092174393953360
2013-06-20 11:08:17,261 : DEBUG org.aido.atp.ArbitrageEngine [Thread-20] - Last ticker Bid price was GBP 68.11000
2013-06-20 11:08:17,261 : DEBUG org.aido.atp.ArbitrageEngine [Thread-20] - BTC/GBP is 0.0146821318455440
2013-06-20 11:08:17,624 : DEBUG org.aido.atp.ArbitrageEngine [Thread-20] - MtGox Arbitrage profit after fee: 99.988
2013-06-20 11:08:17,625 : INFO  org.aido.atp.ArbitrageEngine [Thread-20] - Arbitrage Engine has detected an after fee profit opportunity of 9,998.8% on currency pair GBP/USD on MtGox
2013-06-20 11:08:17,626 : DEBUG org.aido.atp.ArbitrageEngine [Thread-20] - Last ticker Ask price was GBP 69.19803
2013-06-20 11:08:17,627 : DEBUG org.aido.atp.ArbitrageEngine [Thread-20] - BTC/GBP is 0.0144512784540254
2013-06-20 11:08:17,628 : DEBUG org.aido.atp.ArbitrageEngine [Thread-20] - Last ticker Bid price was USD 107.82735
2013-06-20 11:08:17,628 : DEBUG org.aido.atp.ArbitrageEngine [Thread-20] - BTC/USD is 0.0092740849144489
2013-06-20 11:08:17,953 : DEBUG org.aido.atp.ArbitrageEngine [Thread-20] - MtGox Arbitrage buy order is buy BTC 570.8051138161016 for GBP 40000.00000000
2013-06-20 11:08:17,953 : DEBUG org.aido.atp.ArbitrageEngine [Thread-20] - MtGox Arbitrage sell order is sell BTC 570.8051138161016923387558865479373640 for USD 62329.72239238622858760
2013-06-20 11:08:17,955 : INFO  org.aido.atp.ArbitrageEngine [Thread-20] - Arbitrage sold GBP 40000.00000000 for BTC 580.00000000 on MtGox
2013-06-20 11:08:17,956 : INFO  org.aido.atp.ArbitrageEngine [Thread-20] - Arbitrage bought USD 62333.00000000 for BTC 580.00000000 on MtGox
2013-06-20 11:08:17,957 : INFO  org.aido.atp.ArbitrageEngine [Thread-20] - Arbitrage successfully traded GBP 40000.00000 for USD 62329.72239238622858760 on MtGox


Although it's reporting the opportunity twice it still just triggers one trade pair i.e. sell the 'from' currency and buy the 'to' currency.

By the way, arbitrage is still intraexchange not interexchange
hero member
Activity: 981
Merit: 500
DIV - Your "Virtual Life" Secured and Decentralize
June 19, 2013, 05:23:58 PM
Actually its a bit impressive.
Buys and sells add up to 15 BTC.
I only ever had .41BTC.
I lost .05 BTC leaving me at a loss of .33 repeating % or 0.0033 repeating. 
MTGoX charges .6% so I lost less then the fee. At least if I look at it as a loss per BTC transacted.
sr. member
Activity: 248
Merit: 252
1. Collect underpants 2. ? 3. Profit
June 19, 2013, 05:13:12 AM
Understood.

I will look into the Streaming ticker code when I get a chance.
hero member
Activity: 981
Merit: 500
DIV - Your "Virtual Life" Secured and Decentralize
June 19, 2013, 03:32:09 AM
Hi Askit2,

Have a chat with Ianwhitbread. Sorry, I am a bit too lazy at the moment to search back through the thread, but it seems he had hit upon a winning formula and was happy enough with the small but consistent profit ATP was generating (barring MtGox cock ups that is).

Maybe if you ask him nicely he will tell you his secret.


Mental note to self....ask Ianwhitbread for his config settings  Smiley


The logic isn't the problem well at least my trading logic isn't. When MTGoX ticker was reliable for me this logic made me ~3% per day easily. By reliable I mean with a polling interval of 30 and a max tick age of 60 I had a USD with 90+ ticks. I was missing 1/4th of the ticks or less.

Currently with a 30 second polling interval and a max tick age of 120 I get less then 110. The perfect number would be 240. So I have 110 data points and am missing 130 data points. How accurate can I expect any trade logic to be missing half its data? I would say maybe 50%.

Currently on MTGoX I get reliable ticker data sporadically and I miss blocks of time of at least 2 minutes and usually 5 minutes regularly. How accurate could the trade be on the tick after a 5 minute sabbatical? I would bet not very. Add to that fun fact that the ticker frequently goes AWOL when the market heads a direction quickly and I get a lot of missed trades.

Even if the logic is great it is very hard to fight the nothing storm from MTGoX. I can sit on MTGoX website and when ATP loses its ticker at a weight of .009BTC of .01 BTC minimum (MTGoX tells me that is the minimum). I can watch the market go in the required direction for the trade to execute at a rate fast enough the ticker isn't bumped around much. The trade is missed by the nothingness. When the next tick comes in half the time the market is up slightly and it buys if the market had been heading down.

I'm not saying ATP is bad. But with a large near term gap in data maybe a trade isn't the best thing on the next tick. Possibly I am the only one having this much trouble with MTGoX ticker. I doubt it. Maybe the 50X errors crashing ATP only happen to me. I doubt it. Maybe the missing ticker data only happens to people who haven't paid MTGoX enough in fees. I don't know. Some one is trading when I can't get data. I can literally watch it happen.

Right now I have a max tick age of 120 and a polling interval of 15. I should have 480 data points. I have 130. I am averaging 25% successful polls. If I actually got 1 per minute reliably I would be OK with it. I get bursts of 2 minutes of polling then nothing for more. When I am lucky I get 2 in 60 seconds. It doesn't matter what I set the polling interval to I average a low %. I really doubt that any trading logic deals well with intermittent data. If you can point out one that that actually times out so it would stop trading when I am missing too much data I would very likely add it.

I appreciate both Aido and Nova's work I asked about the ticker because I am quite sure it would fix my problem or at least lessen the problem.
Some other fun facts.
I started with 0.41 BTC.
Today I had more then 15 BTC trading volume for the month.
Today I had 0.36 left. I have lost maybe 6$.
The logic is solid. It buys USD when I would want and sells USD when I want.
full member
Activity: 140
Merit: 101
June 18, 2013, 05:39:19 PM
HAHA 

SEE MEN CANT MULTI TASK NOVA

I  did PM my settings over to you  ( I  hope I have not done a you ) and pinged it to the wrong place lol

and the amount I lost with the MTGox hiccup was not massive,  quite small like £5

so no major shakes


I got it, I'm going to try running with similar settings, but I have a feeling the other trading logic didn't know how to deal with the shortened ticker.  The VWAP logic should have just caught it and waited until it had sufficient recent ticks to make a decision. 
member
Activity: 101
Merit: 10
June 18, 2013, 05:26:16 PM
HAHA  

SEE MEN CANT MULTI TASK NOVA

I  did PM my settings over to you  ( I  hope I have not done a you ) and pinged it to the wrong place lol

and the amount I lost with the MTGox hiccup was not massive,  quite small like £5

so no major shakes

edit
but then I am not playing with massive amounts of money

just playing with 1btc at the moment

seeing what different formula do, doing some reading to find out what best

its would be perfect if I was clever enough to be able to do a proper back test in ninja trader  or something  like that

but have never been able to import the data to get it working or find the time to get it working

with many of us

I do this in my spare time

I work Full time in my "real life" and have a lovely wife and daughter  to look after, so don't tend to be on the computer in front of them.

but
its slow but i will surely learn from the mistakes I make





full member
Activity: 140
Merit: 101
June 18, 2013, 04:50:47 PM
And of course I posted that to the wrong thread.  Sorry.
Pages:
Jump to: