Bitcoin Forum
November 22, 2017, 08:20:20 AM *
News: Latest stable version of Bitcoin Core: 0.15.1  [Torrent].
 
   Home   Help Search Donate Login Register  
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 44622 times)
isis
Full Member
***
Offline Offline

Activity: 154


View Profile
September 15, 2012, 11:41:16 PM
 #1

I'm starting a new thread for Isis ATP.
The application was originally discussed in https://bitcointalk.org/index.php?topic=109317.0

It's available from https://github.com/openpay/OpenPay/tree/master/Isis-ATP
If you just want to run it and you aren't interested in helping develop the application, you can get a binary build from...
https://github.com/openpay/OpenPay/tree/master/Isis-ATP/bin

You only need the isis.jar file (it's 64bit, there will be a 32bit version as soon as I can get eclipse to co-operate or someone else submits one.

To run it
Code:
java -jar isis.jar

If you need to reset the configuration, change keys, reset thresholds etc...
Code:
java -jar isis.jar --clear-config=true

At the moment the stop loss functionality has been removed.  It wasn't working as expected.  I will need to rethink what is meant by a stop loss on a market order engine and that's a discussion for a different day.

If you find this application useful, especially if it helps you make some money or survive a severe market correct, please feel free to donate something to the address in my sig line.

Thanks!

DO NOT USE THIS ON AN ACCOUNT WITH MONEY YOU CANNOT AFFORD TO LOSE!

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
Join ICO Now A blockchain platform for effective freelancing
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1511338820
Hero Member
*
Offline Offline

Posts: 1511338820

View Profile Personal Message (Offline)

Ignore
1511338820
Reply with quote  #2

1511338820
Report to moderator
isis
Full Member
***
Offline Offline

Activity: 154


View Profile
September 15, 2012, 11:44:48 PM
 #2

Awesome. Are you still interested in performance reports? Also, what a great way to get exposure for openpay!

I'm extremely interested in performance reports.  Daily P/L per currency would be great!

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: 1456



View Profile
September 16, 2012, 01:27:21 AM
 #3

Code:
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: java.lang.ArithmeticException: Division undefined
at java.math.BigDecimal.divide(BigDecimal.java:1586)
at org.open.payment.alliance.isis.atp.AccountManager.calculatePL(AccountManager.java:73)
at org.open.payment.alliance.isis.atp.AccountManager.refreshAccount(AccountManager.java:60)
at org.open.payment.alliance.isis.atp.AccountManager.<init>(AccountManager.java:30)
at org.open.payment.alliance.isis.atp.AccountManager.getInstance(AccountManager.java:35)
at org.open.payment.alliance.isis.atp.Application.start(Application.java:91)
at org.open.payment.alliance.isis.atp.Application.main(Application.java:52)
... 5 more

Using Ubuntu 12.04 64bits
It detects my MtGox account and balances correctly.

isis
Full Member
***
Offline Offline

Activity: 154


View Profile
September 16, 2012, 01:47:51 AM
 #4

Code:
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: java.lang.ArithmeticException: Division undefined
at java.math.BigDecimal.divide(BigDecimal.java:1586)
at org.open.payment.alliance.isis.atp.AccountManager.calculatePL(AccountManager.java:73)
at org.open.payment.alliance.isis.atp.AccountManager.refreshAccount(AccountManager.java:60)
at org.open.payment.alliance.isis.atp.AccountManager.<init>(AccountManager.java:30)
at org.open.payment.alliance.isis.atp.AccountManager.getInstance(AccountManager.java:35)
at org.open.payment.alliance.isis.atp.Application.start(Application.java:91)
at org.open.payment.alliance.isis.atp.Application.main(Application.java:52)
... 5 more

Using Ubuntu 12.04 64bits
It detects my MtGox account and balances correctly.

Its saying it doesn't know how to divide a bigdecimal by another big decimal.
What's the output of
java --version

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
Shirik
Jr. Member
*
Offline Offline

Activity: 32


View Profile
September 16, 2012, 01:59:57 AM
 #5

It's not saying that it doesn't know how, it's saying that the division is undefined. Probably that means you tried to do a 0/0.

By the way this is running fine for me so far, though it hasn't made any trades yet.
isis
Full Member
***
Offline Offline

Activity: 154


View Profile
September 16, 2012, 02:05:48 AM
 #6

also i cannot clear config file

Code:
SEVERE: Bad Parameter: --clear
Parameters must be specified as "-parameter=value"
java.lang.ArrayIndexOutOfBoundsException: 1
        at org.open.payment.alliance.isis.atp.Application.parseArgs(Application.java:191)
        at org.open.payment.alliance.isis.atp.Application.start(Application.java:56)
        at org.open.payment.alliance.isis.atp.Application.main(Application.java:52)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)

Try --clear-config=true

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: 1456



View Profile
September 16, 2012, 02:27:53 AM
 #7

Code:
java version "1.7.0_07"
OpenJDK Runtime Environment (IcedTea7 2.3.2) (7u7-2.3.2-1ubuntu0.12.04.1)
OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode)

isis
Full Member
***
Offline Offline

Activity: 154


View Profile
September 16, 2012, 03:17:27 AM
 #8

Try --clear-config=true
and --debug-live=true for live trading mode

Eclipse has no console.  That flag is to allow debugging in eclipse.
What it does is assume you accepted the agreement.

When you first run it should interview you, store your answers in a preferences file and exit.
After first run it should default to simulation mode but it should also prompt you with an agreement and allow you to enter live mode after typing "I agree"

The agreement is just saying you won't sue me if this thing causes a loss and that you won't let it trade with money you can't afford to lose.

I'm working on a fix for all the bugs that have been reported thus far and should have a new commit within the hour.

Btw this should now allow trading in currencies besides USD, but the algorithm has never been tested against other currencies and so may act strangely if there isn't sufficient volume.

Has anyone had it execute a trade yet btw?

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
Shirik
Jr. Member
*
Offline Offline

Activity: 32


View Profile
September 16, 2012, 03:30:08 AM
 #9

As far as I can tell from the code, it sets sim mode in the constructor of Application and then there is literally no code that ever changes that flag. (There is a single function that touches it which never gets called.)

It would require a code change to get out of simulation mode.
isis
Full Member
***
Offline Offline

Activity: 154


View Profile
September 16, 2012, 03:38:55 AM
 #10

As far as I can tell from the code, it sets sim mode in the constructor of Application and then there is literally no code that ever changes that flag. (There is a single function that touches it which never gets called.)

It would require a code change to get out of simulation mode.

Yeah when I made it multi-currency enabled I fat fingered a delete and removed that.  It's back now in the next commit.
Code:
if(config.get("ApiKey", null) == null) {
interview();
}

should read
Code:
if(config.get("ApiKey", null) == null) {
interview();
}else {
simModeFlag = showAgreement();
}

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
Full Member
***
Offline Offline

Activity: 154


View Profile
September 16, 2012, 03:43:38 AM
 #11

I have not been able to build in eclipse, but I don't really know what the hell I'm doing.

Will update with any successful trade.

There is an eclipse project file included, but this thing isn't going to build unless you have maven installed. 
I'm using Maven for dependency management.

So to build it you will need the m2e plugin installed for eclipse.

After you install the plugin, just go to File->Import->Maven->Import Existing Maven Project

Then select the OpenPay/Isis-ATP directory and it should find the pom file and build it for you.


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
Full Member
***
Offline Offline

Activity: 154


View Profile
September 16, 2012, 03:50:37 AM
 #12

It's not saying that it doesn't know how, it's saying that the division is undefined. Probably that means you tried to do a 0/0.

By the way this is running fine for me so far, though it hasn't made any trades yet.

I was able to check this.  I forced it to zero and tried and it threw a divide by zero exception.
I think the problem is actually a non-terminating decimal expansion.

I'm looking into how to guard against that.  Probably with rounding since there is only a certain amount of precision we really need to worry about.

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
Shirik
Jr. Member
*
Offline Offline

Activity: 32


View Profile
September 16, 2012, 04:05:18 AM
 #13

It's not saying that it doesn't know how, it's saying that the division is undefined. Probably that means you tried to do a 0/0.

By the way this is running fine for me so far, though it hasn't made any trades yet.

I was able to check this.  I forced it to zero and tried and it threw a divide by zero exception.
I think the problem is actually a non-terminating decimal expansion.

I'm looking into how to guard against that.  Probably with rounding since there is only a certain amount of precision we really need to worry about.

n / 0 results in division by zero
0 / 0 results in division undefined

Example: http://ideone.com/VUfTA
Shirik
Jr. Member
*
Offline Offline

Activity: 32


View Profile
September 16, 2012, 04:10:05 AM
 #14

There is an error in TradingAgent:

Code:
                                                if(qtyToSell.compareTo(minBTC) < 0) {
log.info(qtyToSell.toPlainString() + " was less than the configured limit of "+minBTC.toPlainString()+"\nIncreasing order size to "+minBTC.toPlainString());

}

I believe there is a missing `qtyToSell = minBTC` here.
Shirik
Jr. Member
*
Offline Offline

Activity: 32


View Profile
September 16, 2012, 04:24:51 AM
 #15

Even after that fix I am still getting this error; can't determine why (the funds are certainly there)

Code:
Sep 15, 2012 9:23:18 PM org.open.payment.alliance.isis.atp.TradingAgent evalAsk
INFO: 0.00000000 was less than the configured limit of 0.001
Increasing order size to 0.001
Sep 15, 2012 9:23:18 PM org.open.payment.alliance.isis.atp.TradingAgent marketOrder
SEVERE: Failed to sell 0.001 at current market price.
Please investigate

I do use a yubikey. Does this matter?
isis
Full Member
***
Offline Offline

Activity: 154


View Profile
September 16, 2012, 04:27:59 AM
 #16

There is an error in TradingAgent:

Code:
                                                if(qtyToSell.compareTo(minBTC) < 0) {
log.info(qtyToSell.toPlainString() + " was less than the configured limit of "+minBTC.toPlainString()+"\nIncreasing order size to "+minBTC.toPlainString());

}

I believe there is a missing `qtyToSell = minBTC` here.

Good catch!  Fixed in latest commit.

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
Full Member
***
Offline Offline

Activity: 154


View Profile
September 16, 2012, 04:30:53 AM
 #17

Even after that fix I am still getting this error; can't determine why (the funds are certainly there)

Code:
Sep 15, 2012 9:23:18 PM org.open.payment.alliance.isis.atp.TradingAgent evalAsk
INFO: 0.00000000 was less than the configured limit of 0.001
Increasing order size to 0.001
Sep 15, 2012 9:23:18 PM org.open.payment.alliance.isis.atp.TradingAgent marketOrder
SEVERE: Failed to sell 0.001 at current market price.
Please investigate

I do use a yubikey. Does this matter?

Maybe, but I would check the permissions for your API key and ensure it's enabled for trading as well as information.

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
Full Member
***
Offline Offline

Activity: 154


View Profile
September 16, 2012, 04:35:42 AM
 #18

It's not saying that it doesn't know how, it's saying that the division is undefined. Probably that means you tried to do a 0/0.

By the way this is running fine for me so far, though it hasn't made any trades yet.

I was able to check this.  I forced it to zero and tried and it threw a divide by zero exception.
I think the problem is actually a non-terminating decimal expansion.

I'm looking into how to guard against that.  Probably with rounding since there is only a certain amount of precision we really need to worry about.

n / 0 results in division by zero
0 / 0 results in division undefined

Example: http://ideone.com/VUfTA

Interesting.  I've added code to guard for that now though.  It should be in the latest commit.

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: 1456



View Profile
September 16, 2012, 04:41:43 AM
 #19

Now it works. Building a Market profile. It started doing it right after the configuration. 55min remaining it says.
Do I need to restart it so it trades live? Will it need to build the profile again after I restart it, or can I let it run and restart it on live mode when it's ready?

isis
Full Member
***
Offline Offline

Activity: 154


View Profile
September 16, 2012, 04:49:11 AM
 #20

Now it works. Building a Market profile. It started doing it right after the configuration. 55min remaining it says.
Do I need to restart it so it trades live? Will it need to build the profile again after I restart it, or can I let it run and restart it on live mode when it's ready?
If you started it in live mode its still in live mode.  Its just not going to execute any trades until it builds the market profile which means it needs the last hour of market data with no gaps.

The profile has to be rebuilt each time the application is started for now.  However in the future I may split the trend observer into a stand alone daemon so the trading agent can be swapped out or whatever.  Anyways the profile is live data and can't have any significant gaps.

Perhaps a better way would be to have the trend observer pull in historical data from some source at initialization time.  Ill look into both of these options and see what I can do.

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
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:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!