Bitcoin Forum
November 20, 2017, 02:56:08 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 44607 times)
RicRock
Sr. Member
****
Offline Offline

Activity: 288



View Profile
October 28, 2012, 06:40:48 PM
 #221

I have tried other combinations but they either error out or cause the above mentioned problem.

So you are not entering --debug-live=true into the console window?

Is anyone else having this or a similar issue?

I'm not having any issues. Not sure what is going on... cut and pasting a carriage return after the API key?
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.
1511146568
Hero Member
*
Offline Offline

Posts: 1511146568

View Profile Personal Message (Offline)

Ignore
1511146568
Reply with quote  #2

1511146568
Report to moderator
RicRock
Sr. Member
****
Offline Offline

Activity: 288



View Profile
October 29, 2012, 08:06:48 PM
 #222


Would anyone else be willing to share their P/L? It would seem the high risk model will slowly lose if the market is too stable. Has anyone been using the conservative algorithm since the last build?

I'll post my numbers in a bit... but I'm using high risk as well.

Zeek_W
Sr. Member
****
Offline Offline

Activity: 336



View Profile
October 30, 2012, 04:53:50 AM
 #223

New build, broke up the ticker output with a newline for each print. No functional change, but makes it easier for me to read at a glance. New build included in commit.
https://github.com/nomorecoin/OpenPay/commit/a3826d44ba32ccc5b1c7ebbaddc245ac18df4f99

Nice work!

Aido
Sr. Member
****
Offline Offline

Activity: 249


1. Collect underpants 2. ? 3. Profit


View Profile
November 01, 2012, 03:02:31 AM
 #224

I noticed that there is a lack of trades buying BTC when I think there should be more trades happening.

I think that in some instances, when making a trade decision, the trading agent is directly comparing BTC to local currency i.e. in the following code from TradingAgent.java qtyToBuy (BTC) is being directly compared to maxLocal and minLocal (local currency).

Code:
log.info("Attempting to buy "+qtyToBuy.toPlainString()+" BTC");                                       
if(maxLocal != null){
if(qtyToBuy.compareTo(maxLocal) > 0){
log.info(qtyToBuy.toPlainString() + " was more than the configured maximum of "+maxLocal.toPlainString()+"\nReducing order size to "+maxLocal.toPlainString());
qtyToBuy = maxLocal;
}

if(qtyToBuy.compareTo(minLocal) < 0){
log.info(qtyToBuy.toPlainString() + " was less than the configured minimum of "+minLocal.toPlainString()+"\nThere just isn't enough momentum to trade at this time.");
return;
}
}

I think maybe the comparsion should not be mixing currencies and instead the comparison be made between BTC and local currency / ask price:
Code:
log.info("Attempting to buy "+qtyToBuy.toPlainString()+" BTC");
if(maxLocal != null){
if(qtyToBuy.compareTo(maxLocal.divide(currentAsk)) > 0){
log.info(qtyToBuy.toPlainString() + " BTC was more than the configured maximum of "+maxLocal.toPlainString()+"\nReducing order size to "+maxLocal.toPlainString()+" "+localCurrency.getCurrencyCode());
qtyToBuy = maxLocal;
}

if(qtyToBuy.compareTo(minLocal.divide(currentAsk)) < 0){
log.info(qtyToBuy.toPlainString() + " BTC was less than the configured minimum of "+minLocal.toPlainString()+" "+localCurrency.getCurrencyCode()+"\nThere just isn't enough momentum to trade at this time.");
return;
}
}

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

Activity: 249


1. Collect underpants 2. ? 3. Profit


View Profile
November 01, 2012, 03:37:18 PM
 #225

I feel it can't hurt to repeat: I'm muddling my way through this, I am not the original developer, nor am I well-versed in Java.

Ditto!


From looking at this a bit more I think the weighted decision to buy is based on the MaxLoss setting in the config file i.e. a percentage of balance.

I now think the values and currencies used in the trade are correct but the log output is not.

Maybe the only code change needed is from:

Code:
log.info("Attempting to buy "+qtyToBuy.toPlainString()+" BTC");

to:

Code:
log.info("Attempting to buy "+qtyToBuy.divide(currentAsk).toPlainString()+" BTC");


and maybe clarify things by adding a currency code to the log:

Code:
log.info("Attempting to buy "+qtyToBuy.divide(currentAsk).toPlainString()+" BTC");
if(maxLocal != null){
if(qtyToBuy.compareTo(maxLocal) > 0){
log.info(qtyToBuy.toPlainString() + " " + localCurrency.getCurrencyCode() + " was more than the configured maximum of "+maxLocal.toPlainString()+ " " + localCurrency.getCurrencyCode() +"\nReducing order size to "+maxLocal.toPlainString()+ " " + localCurrency.getCurrencyCode());
qtyToBuy = maxLocal;
}

if(qtyToBuy.compareTo(minLocal) < 0){
log.info(qtyToBuy.toPlainString() + " " + localCurrency.getCurrencyCode() + " was less than the configured minimum of "+minLocal.toPlainString()+ " " + localCurrency.getCurrencyCode() +"\nThere just isn't enough momentum to trade at this time.");
return;
}
}

This can then be easily checked by comparing the actual trades in MtGOX Account history to log output.

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

Activity: 103



View Profile
November 02, 2012, 12:47:12 AM
 #226

i'm willing to test another version soon if it turns out people make some profit. already lost 2 btc to testing the original versions :p
1455
Newbie
*
Offline Offline

Activity: 27


View Profile
November 02, 2012, 01:54:20 AM
 #227

Sorry for to posting P/L:
I ran the script a few times for a few hours (run into an exception), so I wasn't able to propperly log the data. Anyway, I was running at High Risk with 25% max loss settings and faced losses between 1 and 4% everytime.
Oh, BTW, it was the last build you were posting here:

I'll do my best to get a build posted tomorrow.

It's technically tomorrow. Here's a build that runs.

Only change is the bid/ask arrow swap. Running on my machine now. I'm working to set up a clone on github, so I can release with commits for peace of mind. Github fork established, mostly as I intended.

Thanks for resuming the work!
Aido
Sr. Member
****
Offline Offline

Activity: 249


1. Collect underpants 2. ? 3. Profit


View Profile
November 02, 2012, 02:27:11 AM
 #228

I run the following script in a screen session:

Code:
#!/bin/bash +xv

declare JAVA=/usr/bin/java
declare ISISATP_DIR=/home/aido/Isis-ATP/bin/
declare ISISATP_JAR=isisbugfix.jar

cd $ISISATP_DIR

$JAVA -jar $ISISATP_JAR --debug-live=true

And if it fails respawn using following line in /etc/inittab:

Code:
IS:2345:respawn:/bin/su - aido -c "/usr/bin/screen -mDS IsisATP /home/aido/Scripts/Bash/IsisATP.sh"


I may extend the script to pipe the output to tee, logging output to a file. I will then use logrotate to rotate the log when it reaches a certain size.

@nomorecoin: Thanks for the latest build

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

Activity: 103



View Profile
November 03, 2012, 10:12:09 AM
 #229

i'm willing to test another version soon if it turns out people make some profit. already lost 2 btc to testing the original versions :p
Yep, I'm down as well. I think it's very safe to say there are improvements to be made in the calculations made for trade decisions. I've been doing a lot of napkin math, but the biggest reason I've lost is my connection fades ~1 time per day, and I've now missed movement in the market 3 times in a row. No one is really posting P/L, but what I'm more interested in is what your configured settings are, compared to profit or loss.

Also, if anyone has suggestions on catching Xchange when it fails and restarting, I'd love to hear.

Edit: Zaj, when you say original versions, do you mean prior to the bug fix? Have you run my build?

yeah i ment the builds that isis posted, i tried every build with 10 bitcoins.  over the course of all different versions i lost 2 bitcoins.
scrybe
Sr. Member
****
Offline Offline

Activity: 350



View Profile
November 04, 2012, 03:34:11 PM
 #230


and maybe clarify things by adding a currency code to the log


I like that. I'll probably have a little bit of time to tinker this weekend, I'll post a new build if I commit anything. Thanks for the input!


Any chance you or someone else could roll up a new binary, the current one is over 2 months old.

EDIT: Found it under the noarb branch, doh.

I'd love to help, but I only know how to install the Java tools, so it would take a WHILE.

Thanks,

Scrybe

"...as simple as possible, but no simpler" -AE
BTC/TRC/FRC: 1ScrybeSNcjqgpPeYNgvdxANArqoC6i5u Ripple:rf9gutfmGB8CH39W2PCeRbLWMKRauYyVfx LTC:LadmiD6tXq7gFZvMibhFUZegUHKXgbu1Gb
scrybe
Sr. Member
****
Offline Offline

Activity: 350



View Profile
November 05, 2012, 03:30:31 AM
 #231


That's basically where I started. The code is fairly easy to read on Github if you'd prefer not to set up an IDE.

I'm one of those guys who has picked up the bare essentials on about a dozen languages as part of building, upgrading, maintaining the systems on which the code actually runs. Of course none of those is Java since I spend more time with Microsoft side of the world Sad

So if you see any bizzare feedback (like my Rainbow Table suggestion on the Vanity Miner thread), I'm not a crazy person, I'm just speaking Developeraza as a 3rd or 4th language Wink

Thanks,

Scrybe


"...as simple as possible, but no simpler" -AE
BTC/TRC/FRC: 1ScrybeSNcjqgpPeYNgvdxANArqoC6i5u Ripple:rf9gutfmGB8CH39W2PCeRbLWMKRauYyVfx LTC:LadmiD6tXq7gFZvMibhFUZegUHKXgbu1Gb
Aido
Sr. Member
****
Offline Offline

Activity: 249


1. Collect underpants 2. ? 3. Profit


View Profile
November 05, 2012, 12:54:25 PM
 #232

I have not given up on fixing the thread deadlock issue in the Isis arbitrage engine.

So, with the help of jtrace I was able to pinpoint where in the code the thread deadlock was happening.

I have made some changes to the last version of IsisATP commited to github by Isis. The change seems to have fixed the thread deadlock issue (or at least reduced it's frequency). I have left ATP running overnight in test mode and there hasn't been a single thread deadlock yet.

I will now test it with some live trades. Once I'm happy that it is performing OK I will let it into the wild so others may then give it a more thorough test.

Stay tuned for a new commit with the fix included.

As I am not a developer let alone a java developer, I am not sure if this fix will have a negative effect on some other part of code.

For those interested, heres where the thread deadlock was occuring. Look at "Thread-3" and "Thread-9" of the bottom of the following stack trace file:
Code:
2012-11-05 00:54:22
Full thread dump OpenJDK 64-Bit Server VM (22.0-b10 mixed mode):

"Keep-Alive-Timer" daemon prio=10 tid=0x00007f2820570800 nid=0x549f waiting on condition [0x00007f2824195000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
        at java.lang.Thread.sleep(Native Method)
        at sun.net.www.http.KeepAliveCache.run(KeepAliveCache.java:172)
        at java.lang.Thread.run(Thread.java:722)

   Locked ownable synchronizers:
        - None

"Attach Listener" daemon prio=10 tid=0x00000000022ba000 nid=0x4c2f waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
        - None

"Thread-9" prio=10 tid=0x00007f2820568000 nid=0x4bdd waiting for monitor entry [0x00007f281c9b0000]
   java.lang.Thread.State: BLOCKED (on object monitor)
        at org.open.payment.alliance.isis.atp.TickerManager.getLastTick(TickerManager.java:162)
        - waiting to lock <0x00000000d6830958> (a java.util.ArrayList)
        - locked <0x00000000d6830920> (a org.open.payment.alliance.isis.atp.TickerManager)
        at org.open.payment.alliance.isis.atp.AccountManager.getLastTick(AccountManager.java:155)
        at org.open.payment.alliance.isis.atp.ArbitrageEngine.getLowestAsk(ArbitrageEngine.java:182)
        - locked <0x00000000d69e91b8> (a org.open.payment.alliance.isis.atp.ArbitrageEngine)
        at org.open.payment.alliance.isis.atp.ArbitrageEngine.run(ArbitrageEngine.java:52)
        at java.lang.Thread.run(Thread.java:722)

   Locked ownable synchronizers:
        - None

"Thread-8" prio=10 tid=0x00007f2820565800 nid=0x4bd7 waiting on condition [0x00007f281cab1000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
        at java.lang.Thread.sleep(Native Method)
        at org.open.payment.alliance.isis.atp.TrendObserver.run(TrendObserver.java:186)
        at java.lang.Thread.run(Thread.java:722)

   Locked ownable synchronizers:
        - None

"Thread-7" prio=10 tid=0x00007f2820563800 nid=0x4bd6 waiting on condition [0x00007f281cbb2000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
        at java.lang.Thread.sleep(Native Method)
        at org.open.payment.alliance.isis.atp.TickerManager.run(TickerManager.java:115)
        at java.lang.Thread.run(Thread.java:722)

   Locked ownable synchronizers:
        - None

"Thread-6" prio=10 tid=0x00007f2820561800 nid=0x4bd5 waiting on condition [0x00007f281ccb3000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
        at java.lang.Thread.sleep(Native Method)
        at org.open.payment.alliance.isis.atp.TrendObserver.run(TrendObserver.java:186)
        at java.lang.Thread.run(Thread.java:722)

   Locked ownable synchronizers:
        - None

"Thread-5" prio=10 tid=0x00007f2820560800 nid=0x4bd4 waiting on condition [0x00007f281cdb4000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
        at java.lang.Thread.sleep(Native Method)
        at org.open.payment.alliance.isis.atp.TickerManager.run(TickerManager.java:115)
        at java.lang.Thread.run(Thread.java:722)

   Locked ownable synchronizers:
        - None

"Thread-4" prio=10 tid=0x00007f28203bf800 nid=0x4bd3 waiting for monitor entry [0x00007f281ceb5000]
   java.lang.Thread.State: BLOCKED (on object monitor)
        at org.open.payment.alliance.isis.atp.TickerManager.getMarketData(TickerManager.java:138)
        - waiting to lock <0x00000000d6830958> (a java.util.ArrayList)
        at org.open.payment.alliance.isis.atp.TrendObserver.run(TrendObserver.java:71)
        at java.lang.Thread.run(Thread.java:722)

   Locked ownable synchronizers:
        - None

"Thread-3" prio=10 tid=0x00007f28203bf000 nid=0x4bd2 waiting for monitor entry [0x00007f281cfb6000]
   java.lang.Thread.State: BLOCKED (on object monitor)
        at org.open.payment.alliance.isis.atp.ArbitrageEngine.addTick(ArbitrageEngine.java:206)
        - waiting to lock <0x00000000d69e91b8> (a org.open.payment.alliance.isis.atp.ArbitrageEngine)
        at org.open.payment.alliance.isis.atp.TickerManager.run(TickerManager.java:109)
        - locked <0x00000000d6830958> (a java.util.ArrayList)
        at java.lang.Thread.run(Thread.java:722)

   Locked ownable synchronizers:
        - None

"Timer-0" daemon prio=10 tid=0x0000000002065800 nid=0x4bce in Object.wait() [0x00007f2824296000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x00000000d6913f70> (a java.util.TaskQueue)
        at java.util.TimerThread.mainLoop(Timer.java:552)
        - locked <0x00000000d6913f70> (a java.util.TaskQueue)
        at java.util.TimerThread.run(Timer.java:505)

   Locked ownable synchronizers:
        - None

"Service Thread" daemon prio=10 tid=0x0000000001fc9800 nid=0x4bcc runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
        - None

"C2 CompilerThread1" daemon prio=10 tid=0x0000000001fc7000 nid=0x4bcb waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
        - None

"C2 CompilerThread0" daemon prio=10 tid=0x0000000001fc4000 nid=0x4bca waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
        - None

"Signal Dispatcher" daemon prio=10 tid=0x0000000001fc1800 nid=0x4bc9 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
        - None

"Finalizer" daemon prio=10 tid=0x0000000001f6a800 nid=0x4bc8 in Object.wait() [0x00007f2824a13000]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x00000000d69a19e8> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:135)
        - locked <0x00000000d69a19e8> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:151)
        at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:177)

   Locked ownable synchronizers:
        - None

"Reference Handler" daemon prio=10 tid=0x0000000001f63000 nid=0x4bc7 in Object.wait() [0x00007f2824b14000]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x00000000d69a1760> (a java.lang.ref.Reference$Lock)
        at java.lang.Object.wait(Object.java:503)
        at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:133)
        - locked <0x00000000d69a1760> (a java.lang.ref.Reference$Lock)

   Locked ownable synchronizers:
        - None

"main" prio=10 tid=0x0000000001e9c800 nid=0x4bc1 runnable [0x00007f2829ad4000]
   java.lang.Thread.State: RUNNABLE
        at java.lang.Thread.isAlive(Native Method)
        at org.open.payment.alliance.isis.atp.CurrencyManager.isRunning(CurrencyManager.java:47)
        at org.open.payment.alliance.isis.atp.AccountManager.isRunning(AccountManager.java:145)
        at org.open.payment.alliance.isis.atp.Application.start(Application.java:77)
        at org.open.payment.alliance.isis.atp.Application.main(Application.java:49)

   Locked ownable synchronizers:
        - None

"VM Thread" prio=10 tid=0x0000000001f5a800 nid=0x4bc6 runnable

"GC task thread#0 (ParallelGC)" prio=10 tid=0x0000000001ea7000 nid=0x4bc2 runnable

"GC task thread#1 (ParallelGC)" prio=10 tid=0x0000000001ea9000 nid=0x4bc3 runnable

"GC task thread#2 (ParallelGC)" prio=10 tid=0x0000000001eab000 nid=0x4bc4 runnable

"GC task thread#3 (ParallelGC)" prio=10 tid=0x0000000001ead000 nid=0x4bc5 runnable

"VM Periodic Task Thread" prio=10 tid=0x0000000001fdc000 nid=0x4bcd waiting on condition

JNI global references: 203


Found one Java-level deadlock:
=============================
"Thread-9":
  waiting to lock monitor 0x0000000001f687b8 (object 0x00000000d6830958, a java.util.ArrayList),
  which is held by "Thread-3"
"Thread-3":
  waiting to lock monitor 0x0000000002216ff0 (object 0x00000000d69e91b8, a org.open.payment.alliance.isis.atp.ArbitrageEngine),
  which is held by "Thread-9"

Java stack information for the threads listed above:
===================================================
"Thread-9":
        at org.open.payment.alliance.isis.atp.TickerManager.getLastTick(TickerManager.java:162)
        - waiting to lock <0x00000000d6830958> (a java.util.ArrayList)
        - locked <0x00000000d6830920> (a org.open.payment.alliance.isis.atp.TickerManager)
        at org.open.payment.alliance.isis.atp.AccountManager.getLastTick(AccountManager.java:155)
        at org.open.payment.alliance.isis.atp.ArbitrageEngine.getLowestAsk(ArbitrageEngine.java:182)
        - locked <0x00000000d69e91b8> (a org.open.payment.alliance.isis.atp.ArbitrageEngine)
        at org.open.payment.alliance.isis.atp.ArbitrageEngine.run(ArbitrageEngine.java:52)
        at java.lang.Thread.run(Thread.java:722)
"Thread-3":
        at org.open.payment.alliance.isis.atp.ArbitrageEngine.addTick(ArbitrageEngine.java:206)
        - waiting to lock <0x00000000d69e91b8> (a org.open.payment.alliance.isis.atp.ArbitrageEngine)
        at org.open.payment.alliance.isis.atp.TickerManager.run(TickerManager.java:109)
        - locked <0x00000000d6830958> (a java.util.ArrayList)
        at java.lang.Thread.run(Thread.java:722)

Found 1 deadlock.

So you may see exactly what line is causing the problem, the above trace was run using the code version currently at https://github.com/aido/IsisATP (commit e19ca9279d86421b1b6b76bdc1f5c4494ad713a0)


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

Activity: 350



View Profile
November 05, 2012, 03:39:38 PM
 #233

I have not given up on fixing the thread deadlock issue in the Isis arbitrage engine.

So, with the help of jtrace I was able to pinpoint where in the code the thread deadlock was happening.

Looking at the commits now. I've done zero looking into the arbitrage code, so I may take a while to get up to speed.

Fork looks good! I like it. Consider the noarb version on hiatus.

I was wondering about arbitrage, I saw this in the faq though:

Q. Do you keep independent ask/bid tables for different currencies?

A. No, ask/bid tables for different currencies are not independent. All currencies are relative to whichever currency has the highest volume, which is based on said currencies current market price in bitcoin. Every trade is in one pool and in fact, not are not separate currency markets. This allows users the added benefit of trading in "the greater market" -in currencies they understand- while not limiting them to smaller currency markets.

So are they lying and it actually functions like independent tables somehow? Or are we actually just trading against the daily European Central Bank rates for the currencies?

If the latter, I'm not sure there is that much advantage in mixing the two trading types.

"...as simple as possible, but no simpler" -AE
BTC/TRC/FRC: 1ScrybeSNcjqgpPeYNgvdxANArqoC6i5u Ripple:rf9gutfmGB8CH39W2PCeRbLWMKRauYyVfx LTC:LadmiD6tXq7gFZvMibhFUZegUHKXgbu1Gb
Aido
Sr. Member
****
Offline Offline

Activity: 249


1. Collect underpants 2. ? 3. Profit


View Profile
November 06, 2012, 01:53:11 AM
 #234

Aido's build did not deadlock on me, but did fail when my connection dropped.

hhmmmmmm, interesting. I hadn't pushed the fix for the deadlock issue to github while I was testing it. Maybe a rogue 'fixed' jar sneaked into an earlier commit. Anyway, I have now pushed the latest and greatest version to github so feel free to test and comment.

https://github.com/aido/IsisATP.git


Errr, I can't seem to import this project into Eclipse. Could you give a rough outline of what it would take?

I don't use Eclipse. Did I mention that I'm not a developer? Smiley I tend to do things the hard way and use a plain old text editor and command line to build. It seems I like to make life more difficult for myself. However, it does give me a bit more flexibility and I know what's going on under the hood so to speak. That is why I created the build_IsisATP.sh Bash file.

If I were to install Eclipse I fear it may give me delusions of coding competence.

Eclipse config files (a .settings directory and .project and pom.xml files) may have gotten lost when I cloned Isis and reorganised or deleted some files.

I have now added manually edited .project and pom.xml files and will push have pushed them to github as soon as I finish typing this post. The main difference in the pom.xml file from the Isis original is the dependency change from XChange 1.1.0 to 1.2.0.

Hopefully these files will work when importing to Eclipse.


About the latest version. While testing it I noticed that the arbitrage functionality sold all the from currency for BTC then sold ALL the BTC for the to currency. Resulting in 0 from currency balance, 0 BTC balance and everything in to currency. I don't like this. I tried to tweak the algorithm, but with little success. What I think would be better is to just sell the from currency and buy the equivalent amount in to currency. (I hope my explanation makes sense!). I tried this but the result was still the same; ALL BTC dumped into to currency.

So, suggestions on how to fix the arbitrage algorithm are most welcome. You can see what I was trying to do by looking at the following code in ArbitrageEngine.java in the latest commit:

Code:
BigMoney balance = AccountManager.getInstance().getBalance(fromCur);

// Following calculation sells fromCur balance and dumps ALL BTC into toCur resulting in 0 fromCur and 0 BTC
// BigMoney qty = balance.multipliedBy(AccountManager.getInstance().getLastTick(fromCur).getAsk().getAmount());

// Following calculation sells fromCur balance and buys equivalent amount of toCur resulting in 0 fromCur and leaving pre-existing BTC balance
BigMoney qty = balance.multipliedBy(AccountManager.getInstance().getLastTick(toCur).getBid().getAmount()).dividedBy(AccountManager.getInstance().getLastTick(fromCur).getAsk().getAmount(),RoundingMode.HALF_EVEN);


I also plan to add a command line argument to enable/disable arbitrage. Something like --arbitrage=true or --arbitrage=false

After that then maybe cleaning up the log output to prettify everything.

Now, before people start testing the lastest version I pushed to github, I feel the need to re-iterate I am not a java developer and I accept no responsibilty if any of the changes I made to IsisATP causes you to lose your entire balance. Test with small amounts and USE AT YOUR OWN RISK!!!

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

Activity: 249


1. Collect underpants 2. ? 3. Profit


View Profile
November 06, 2012, 10:23:51 PM
 #235

New commit available at https://github.com/aido/IsisATP.git

Commit message "Added --use-arbitrage=true/false commandline parameter (default true)" is self-explanatory.

I'm still not happy with the arbitrage functionality but at least now it can be easily disabled. It may also come in useful if the thread deadlock issue rears it's ugly head again.

While giving the new --use-arbitrage parameter a quick test I noticed an intermittent java.io.EOFException error when reading one of the dat files on startup. It may have been caused by me using Ctrl-C to stop the application on previous run i.e. a write to file operation did not complete properly. So, keep an eye out for this error.


Right, now I'm going to look at the arbitrage algorithm......still not sure what to do here though.

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

Activity: 249


1. Collect underpants 2. ? 3. Profit


View Profile
November 07, 2012, 12:49:43 AM
 #236

I would like to concentrate on the arbitrage engine first because there is a guaranteed profit from successful trades with this.

I was thinking of first changing the trade amounts the arbitrage engine calculates. Currently, it dumps the entire BTC wallet into the to currency wallet. When testing I had an initial shock of "hey, where the hell did all my $ and BTC go?".......until I looked at my € wallet.

This also has a negative effect on the other trade engine as it leaves no BTC to trade with until the maket moves in favour a selling the currency in the to currency wallet.

I thought it would be an easy fix but the calculation I tested yesterday didn't work. It still dumped my entire BTC wallet.

Say, for example, there is an arbitrage opportunity between $'s and €'s. On paper the following looks good to me, but in practice it doesn't work:

Trade 1. If there is an arbitrage opportunity sell entire $ balance for BTC
Trade 2. If the trade 1 was successful then buy ($ balance divided by $ ask price) mutipied by € bid price.
($ balance divided by $ ask price) being the amout of BTC bought in trade 1 and only this amount of BTC should be sold in trade 2.


That seems simple enough and is what I thought the following code in ArbitrageEngine.java was going to do:

Code:
BigMoney balance = AccountManager.getInstance().getBalance(fromCur);
BigMoney qty = balance.multipliedBy(AccountManager.getInstance().getLastTick(toCur).getBid().getAmount()).dividedBy(AccountManager.getInstance().getLastTick(fromCur).getAsk().getAmount(),RoundingMode.HALF_EVEN);
.
.
MarketOrder buyOrder  = new MarketOrder(OrderType.BID,balance.getAmount(),"BTC",fromCur.toString());
.
.
MarketOrder sellOrder = new MarketOrder(OrderType.ASK,qty.getAmount(),"BTC",toCur.toString());

but apparently not.


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

Activity: 249


1. Collect underpants 2. ? 3. Profit


View Profile
November 07, 2012, 02:09:30 AM
 #237

New commit available.

I updated the arbitrage calculations so it doesn't sell all BTC as described in previous post.

I was doing something silly; using from and to currency amounts in buy and sell market orders instead of BTC amount.......how embarrasing  Roll Eyes

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

Activity: 249


1. Collect underpants 2. ? 3. Profit


View Profile
November 07, 2012, 11:53:10 AM
 #238

OK, I'll have a look at the IoException shortly. The real world is getting in the way at the moment.

I tried to make the build script as generic as possible; creating directories if they don't exist etc. Maybe some of the script's dependencies aren't installed, like git, git-svn, jar and javac? Also, the two logback jar files logback-core-1.0.7.jar and logback-classic-1.0.7.jar need to be in the jars directory. I might do something clever with wget where if it can't find the files in the jar directory it downloads them from the logback repository.

OK, reading back on that, maybe it isn't that generic after all.

I created the build script when I was trying to fix the thread deadlock issue. I wasn't sure what was causing it so I decided to download the latest vesion of all dependency libraries and their dependencies then build everything from scratch.

Do the Eclipse config files I created not work?


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

Activity: 249


1. Collect underpants 2. ? 3. Profit


View Profile
November 08, 2012, 01:55:17 AM
 #239

https://github.com/aido/IsisATP.git new commit messages self explanatory:

To perform proper currency conversion:

     commit 7800f9fda70acd7e620c89f1614fa4d5b1c283c4

          Changed arbitrage engine currency calculations from BigMoney.dividedBy and BigMoney.multipliedBy to BigMoney.convertedTo





Aido's build did not deadlock on me, but did fail when my connection dropped. Here's the cause:

Code:
Caught unexpected exception, shutting down now!.
Details are listed below.
com.xeiam.xchange.HttpException: Problem GETing (IO)

Aido, I'd appreciate if you could build a version with the IoException suppressed in TickerManager. For some reason, my connection likes to flake a few times a day, and it's hell to have the arb version sit on the side lines for an hour rebuilding the market profile.

     commit 97e94bfcb4f7c1fe4fb14e6e799257039aad887d

          Changed exception handling in ticker manager and added com.xeiam.xchange.HttpException exception handler




I fired up my Xubuntu install and made a solid go at building, but I had to admit failure. I can change the files, but your build script is rather suited to your machine. I'm positive I'm missing something simple, but I've given up for the evening.

      commit 78ef6e30680eb51aa8a563252d75277b7032579f

          Updated build script to be a bit more generic


When build script is first run it will take several minutes to download and build all required dependencies. On subsequent builds the script automatically checks for updates to depenency libraries and takes no more than 30 seconds to build a new aido.jar with the latest code.

The script now checks for all the binaries it needs and lets the user know if they're not installed. It now also dowloads the logback jar files if it cannot find them locally.

But, if you're more comfortable with Eclipse, Maven or whatever IDE/plugin combo you use, stick to that. The script was really just written to make my life a bit easier when repeatedly running test builds.


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

Activity: 249


1. Collect underpants 2. ? 3. Profit


View Profile
November 08, 2012, 02:31:25 AM
 #240

Only because I'm too dense to handle the dependencies without Maven. Had I been thinking, I would have dropped your commits into a fresh clone of the main repo and built as I usually do.

I think the pom.xml file I created takes care of the dependencies for Maven. Not sure though, I'm not a Maven/Eclipse warrior like you. Smiley The file just has Xchange as a dependency for IsisATP. XChange has it's own set of dependencies which Maven should be able to figure out for itself.

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 [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!