Bitcoin Forum
May 07, 2024, 06:49:07 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 3 4 5 6 [7] 8 9 10 11 »  All
  Print  
Author Topic: ATP [Advanced Trading Platform]  (Read 20881 times)
Askit2
Hero Member
*****
Offline Offline

Activity: 981
Merit: 500


DIV - Your "Virtual Life" Secured and Decentralize


View Profile
June 19, 2013, 10:23:58 PM
 #121

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.

          ▄▄
        ▄█▀▀█▄
      ▄█▀ ▄▄ ▀█▄
      ▀ ▄████▄ ▀
   ▄▀ ▄ ▀████▀ ▄ ▀▄
 ▄▀ ▄███▄ ▀▀ ▄███▄ ▀▄
█  ███████  ███████  █
 ▀▄ ▀███▀ ▄▄ ▀███▀ ▄▀

   ▀▄ ▀ ▄████▄ ▀ ▄▀
      ▄ ▀████▀ ▄
      ▀█▄ ▀▀ ▄█▀
        ▀█▄▄█▀
          ▀▀
███████████████████████████████████████████████████████████████████
██████▀▀▀▀▀▀▀▀▀▀▀██████████▀▀▀▀▀████▀▀▀▀▀█████▀▀▀▀█████▀▀▀▀▀███████
██████            ▀████████     ████     █████    █████     ███████
██████     ▄▄▄▄▄    ▀██████     █████    ████      ████    ████████
██████     ██████▄    █████     █████    ▀██▀  ▄▄  ▀██▀    ████████
██████     ███████    █████     ██████    ██   ██   ██    █████████
██████     ███████    █████     ██████    ██   ██   ██    █████████
██████     ███████    █████     ██████     █   ██   █     █████████
██████     █████▀    ██████     ███████       ████       ██████████
██████     ▀▀▀▀▀    ▄██████     ████████     ██████     ███████████
██████            ▄████████     ████████     ██████     ███████████
██████▄▄▄▄▄▄▄▄▄▄▄██████████▄▄▄▄▄█████████▄▄▄▄██████▄▄▄▄████████████
███████████████████████████████████████████████████████████████████
.DIWtoken.com.
▄██████████████████▄
███       ▀███████
███       █████████
███       █████████
███       █████████
███              ██
███   ▄▄▄▄▄▄▄▄   ███
███   ▄▄▄▄▄▄▄▄   ███
███              ███
███▄▄▄▄▄▄▄▄▄▄▄▄▄▄███
██████████████████▀

▄██████████████████▄
███████████▀ ███████
█████████▀   ███████
███████▀     ██▀ ███
███ ▀▀       █▄▄████
███          █▀▀▀▀██
███ ▄▄       ███████
██████▄     █▄ ▀███
█████████▄   ███▄███
███████████▄ ███████
▀██████████████████▀

▄██████████████████▄
████████████████████
███████████████▀▀ ██
█████████▀▀     ███
████▀▀     ▄█▀   ███
███▄    ▄██      ███
█████████▀      ▄██
█████████▄     ████
█████████████▄ ▄████
████████████████████
▀██████████████████▀
......SECURITY DECENTRALIZED...
There are several different types of Bitcoin clients. The most secure are full nodes like Bitcoin Core, which will follow the rules of the network no matter what miners do. Even if every miner decided to create 1000 bitcoins per block, full nodes would stick to the rules and reject those blocks.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715107747
Hero Member
*
Offline Offline

Posts: 1715107747

View Profile Personal Message (Offline)

Ignore
1715107747
Reply with quote  #2

1715107747
Report to moderator
1715107747
Hero Member
*
Offline Offline

Posts: 1715107747

View Profile Personal Message (Offline)

Ignore
1715107747
Reply with quote  #2

1715107747
Report to moderator
Aido (OP)
Sr. Member
****
Offline Offline

Activity: 248
Merit: 250


1. Collect underpants 2. ? 3. Profit


View Profile
June 20, 2013, 12:21:47 AM
Last edit: June 20, 2013, 01:11:17 AM by Aido
 #122

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

Interesting Bash command line, try it Wink:
bitcoin-cli sendtoaddress 1Aidan4r4rqoCBprfp2dVZeYosZ5ryVqH6 `bitcoin-cli getbalance`
Aido (OP)
Sr. Member
****
Offline Offline

Activity: 248
Merit: 250


1. Collect underpants 2. ? 3. Profit


View Profile
June 20, 2013, 12:34:46 AM
 #123

reserved

?

Interesting Bash command line, try it Wink:
bitcoin-cli sendtoaddress 1Aidan4r4rqoCBprfp2dVZeYosZ5ryVqH6 `bitcoin-cli getbalance`
dwolfman
Full Member
***
Offline Offline

Activity: 224
Merit: 100



View Profile WWW
June 20, 2013, 02:00:46 AM
 #124


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.

Wanna send coins my way? 1BY2rZduB9j8Exa4158QXPFJoJ2NWU1NGf or just scan the QR code in my avatar.  :-)
Nova!
Full Member
***
Offline Offline

Activity: 140
Merit: 101


View Profile
June 20, 2013, 07:13:17 AM
 #125

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.

Donate @ 1LE4D5ERPZ4tumNoYe5GMeB5p9CZ1xKb4V
Ianwhitbread
Member
**
Offline Offline

Activity: 101
Merit: 10


View Profile
June 20, 2013, 07:40:46 AM
 #126

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




Aido (OP)
Sr. Member
****
Offline Offline

Activity: 248
Merit: 250


1. Collect underpants 2. ? 3. Profit


View Profile
June 20, 2013, 08:00:45 AM
 #127

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.

Interesting Bash command line, try it Wink:
bitcoin-cli sendtoaddress 1Aidan4r4rqoCBprfp2dVZeYosZ5ryVqH6 `bitcoin-cli getbalance`
Nova!
Full Member
***
Offline Offline

Activity: 140
Merit: 101


View Profile
June 20, 2013, 03:14:48 PM
 #128

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.

Donate @ 1LE4D5ERPZ4tumNoYe5GMeB5p9CZ1xKb4V
Aido (OP)
Sr. Member
****
Offline Offline

Activity: 248
Merit: 250


1. Collect underpants 2. ? 3. Profit


View Profile
June 20, 2013, 04:27:24 PM
 #129

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.

Interesting Bash command line, try it Wink:
bitcoin-cli sendtoaddress 1Aidan4r4rqoCBprfp2dVZeYosZ5ryVqH6 `bitcoin-cli getbalance`
daybyter
Legendary
*
Offline Offline

Activity: 965
Merit: 1000


View Profile
June 20, 2013, 04:33:23 PM
 #130

That's why I use a single OrderBook in my code to send orders to exchanges.

Nova!
Full Member
***
Offline Offline

Activity: 140
Merit: 101


View Profile
June 21, 2013, 01:37:20 AM
 #131

Java 6 was EOL'd today.  Guess we should move the build target to JDK7.

Donate @ 1LE4D5ERPZ4tumNoYe5GMeB5p9CZ1xKb4V
Aido (OP)
Sr. Member
****
Offline Offline

Activity: 248
Merit: 250


1. Collect underpants 2. ? 3. Profit


View Profile
June 21, 2013, 07:51:43 AM
 #132

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.

Interesting Bash command line, try it Wink:
bitcoin-cli sendtoaddress 1Aidan4r4rqoCBprfp2dVZeYosZ5ryVqH6 `bitcoin-cli getbalance`
Nova!
Full Member
***
Offline Offline

Activity: 140
Merit: 101


View Profile
June 21, 2013, 09:44:18 AM
 #133

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.

Donate @ 1LE4D5ERPZ4tumNoYe5GMeB5p9CZ1xKb4V
Nova!
Full Member
***
Offline Offline

Activity: 140
Merit: 101


View Profile
June 21, 2013, 12:07:56 PM
 #134

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

Donate @ 1LE4D5ERPZ4tumNoYe5GMeB5p9CZ1xKb4V
Ianwhitbread
Member
**
Offline Offline

Activity: 101
Merit: 10


View Profile
June 21, 2013, 02:21:39 PM
 #135

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

Aido (OP)
Sr. Member
****
Offline Offline

Activity: 248
Merit: 250


1. Collect underpants 2. ? 3. Profit


View Profile
June 21, 2013, 03:48:36 PM
 #136

For a first time Java dev you've got some serious skill.

Thank you. The 'skill' is 99.9% perspiration.

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.

Excellent, it's been on the AidoATP TODO list for a while.

Interesting Bash command line, try it Wink:
bitcoin-cli sendtoaddress 1Aidan4r4rqoCBprfp2dVZeYosZ5ryVqH6 `bitcoin-cli getbalance`
Ianwhitbread
Member
**
Offline Offline

Activity: 101
Merit: 10


View Profile
June 23, 2013, 07:51:46 PM
 #137

Mtgox is down again
crashed the ATP 

can see from the debug that they are now using cloud flare

still  does not help us and that fact you can not even do manual trades

looking at the charts I can see China is still moving so is russia

but USD  and GBP have not moved for an hour

not one single order

Ianwhitbread
Member
**
Offline Offline

Activity: 101
Merit: 10


View Profile
June 23, 2013, 08:02:03 PM
 #138

Joined Quantopian Today

Cloned a BitCoin ticker with vwap

Just got to figure out how to add ads to it now

And wait for the ta-lib support

Quite excited to back testing algos

Just got to figure out how to write python code


Askit2
Hero Member
*****
Offline Offline

Activity: 981
Merit: 500


DIV - Your "Virtual Life" Secured and Decentralize


View Profile
June 24, 2013, 08:59:58 PM
 #139

Hey Aido,
How do the moving averages get the long average?
I have a setting for Short M A tick. I don't see a setting to adjust the long average.

Either way setting Min tick up to 55 with 60M max and 30s poll time has been acting much better. At least it doesn't trade after ticker drop until the length gets long enough.

          ▄▄
        ▄█▀▀█▄
      ▄█▀ ▄▄ ▀█▄
      ▀ ▄████▄ ▀
   ▄▀ ▄ ▀████▀ ▄ ▀▄
 ▄▀ ▄███▄ ▀▀ ▄███▄ ▀▄
█  ███████  ███████  █
 ▀▄ ▀███▀ ▄▄ ▀███▀ ▄▀

   ▀▄ ▀ ▄████▄ ▀ ▄▀
      ▄ ▀████▀ ▄
      ▀█▄ ▀▀ ▄█▀
        ▀█▄▄█▀
          ▀▀
███████████████████████████████████████████████████████████████████
██████▀▀▀▀▀▀▀▀▀▀▀██████████▀▀▀▀▀████▀▀▀▀▀█████▀▀▀▀█████▀▀▀▀▀███████
██████            ▀████████     ████     █████    █████     ███████
██████     ▄▄▄▄▄    ▀██████     █████    ████      ████    ████████
██████     ██████▄    █████     █████    ▀██▀  ▄▄  ▀██▀    ████████
██████     ███████    █████     ██████    ██   ██   ██    █████████
██████     ███████    █████     ██████    ██   ██   ██    █████████
██████     ███████    █████     ██████     █   ██   █     █████████
██████     █████▀    ██████     ███████       ████       ██████████
██████     ▀▀▀▀▀    ▄██████     ████████     ██████     ███████████
██████            ▄████████     ████████     ██████     ███████████
██████▄▄▄▄▄▄▄▄▄▄▄██████████▄▄▄▄▄█████████▄▄▄▄██████▄▄▄▄████████████
███████████████████████████████████████████████████████████████████
.DIWtoken.com.
▄██████████████████▄
███       ▀███████
███       █████████
███       █████████
███       █████████
███              ██
███   ▄▄▄▄▄▄▄▄   ███
███   ▄▄▄▄▄▄▄▄   ███
███              ███
███▄▄▄▄▄▄▄▄▄▄▄▄▄▄███
██████████████████▀

▄██████████████████▄
███████████▀ ███████
█████████▀   ███████
███████▀     ██▀ ███
███ ▀▀       █▄▄████
███          █▀▀▀▀██
███ ▄▄       ███████
██████▄     █▄ ▀███
█████████▄   ███▄███
███████████▄ ███████
▀██████████████████▀

▄██████████████████▄
████████████████████
███████████████▀▀ ██
█████████▀▀     ███
████▀▀     ▄█▀   ███
███▄    ▄██      ███
█████████▀      ▄██
█████████▄     ████
█████████████▄ ▄████
████████████████████
▀██████████████████▀
......SECURITY DECENTRALIZED...
Aido (OP)
Sr. Member
****
Offline Offline

Activity: 248
Merit: 250


1. Collect underpants 2. ? 3. Profit


View Profile
June 24, 2013, 11:52:08 PM
 #140

Looking at the code:


Code:
Integer shortMASize = Integer.valueOf(Application.getInstance().getConfig("ShortMATickSize"));
.
.
.
shortSMA = sumShortSMA.dividedBy(Long.valueOf(shortMASize),RoundingMode.HALF_EVEN);
longSMA = sumLongSMA.dividedBy(Long.valueOf(tickerSize),RoundingMode.HALF_EVEN);

So, short SMA uses the 'ShortMATickSize' value from the config file.

Long SMA uses the entire ticker size i.e. derived from MaxTickAge, the maximum ticker age in minutes.

Interesting Bash command line, try it Wink:
bitcoin-cli sendtoaddress 1Aidan4r4rqoCBprfp2dVZeYosZ5ryVqH6 `bitcoin-cli getbalance`
Pages: « 1 2 3 4 5 6 [7] 8 9 10 11 »  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!