Bitcoin Forum

Economy => Trading Discussion => Topic started by: Aido on May 19, 2013, 10:06:02 AM



Title: ATP [Advanced Trading Platform]
Post by: Aido on May 19, 2013, 10:06:02 AM
I'm starting a new topic for a discussion on ATP development. This topic is a continuation of the discussion on IsisATP and AidoATP (https://bitcointalk.org/index.php?topic=109831.0).

Ok, so back to the new design.  I think the idea of programmable logic is an admirable idea, but when someone is just setting up for the first time, there needs to be a logical set of defaults included.  In my fork, I've set the default logic to be VWAPCross, not because I believe it is in any way inherently better, but because it's the simplest and easiest to understand.  Last trade was below vwap we buy, above vwap we sell.  As it stands now if you don't put anything into the bid/ask logic fields it spits out a nasty stack trace and does nothing.  I've fixed that in my branch, but it's refusing to let me commit at the moment.  I'm sort of at a loss on that one and will try to massage it a bit tomorrow.

After we refactor to use the order book and limit orders, the next step will be to add in a proper AI.  Right now, all we are using are algorithmic traders.  The AI will be optional and until it's trained with a few weeks of data it runs a very real risk of making very expensive mistakes.  However it's "learning profile" is a stored data set that can be downloaded and updated regularly with new market information.

Because it will attempt to predict the market direction, it will necessarily be significantly different than the algo traders we have now. 

The AI is a predictive DSP with a genetic algorithm based on a project I wrote a few years back for a company that couldn't afford downtime (downtime meant lives lost not just dollars).  The AI would watch all systems globally and learn about which systems were failing.  At first it just watches everything and reports failures, then it begins to make predictions and give each prediction a weight based on if it comes true or not.  Eventually the strongest predictions survive and the weakest ones die out.
The goal here was to compile an alert of probabilities and send it as far in advance as possible. 
The longer it runs the smarter it gets.  With a failure rate of 1 machine per day it could predict up to 4 hours in advance with 90% certainty.

I've been running it against MtGox since I first created the Isis-ATP project and it's a bit novel in that it can deduce the lump sum direction of the algorithmic traders at play (after all that's what a DSP does it isolates signals from noise).

Since January it's been showing that the pricing structure is actually being supported by VWAPCross and someone somewhere appears to be running a stochastic oscillator and that someone has some serious dollars.  That's pretty much all the bots and it accounts for over 80% of the trading activity.  The remaining is human traders (random noise tends to be from human activity). 

This is MtGox data only.  I haven't tried it against any other exchange and the DDOS attacks a few weeks ago gave the poor thing brain damage for lack of a better word. I'm not sure how to reconcile the dataset so I'll start a new profile when I integrate it.

I will also be adding an internal wallet and a configurable "sweep" to allow you to get your profits out daily and still keep enough on hand for expected volume.

Finally I will also be adding peer to peer mode to allow nodes to specialize in exchanges and share resources.

If that doesn't make a lot of sense imagine this...
There is a significant arbitrage opportunity between btc-e & mtgox on BTC right now.  You can buy bitcoins cheaper on BTC-e and sell them for more on MtGox (feel free to check this).

Each node can be configured to specialize in a particular exchange and this is where the bulk of it's money is at. 

If we can predict the size and length of an arbitrage opportunity we can do the buying and selling individually and settle up the profits later.  This obviously only works if you are working with close friends and people you know.  But the fact is this can work in the right circumstances.

Imagine if I had $5000 USD on BTC-e and Aido (sorry you're volunteered), has a few hundred BTC on MtGox.  I can authorize my machine to spend the $5000 USD into BTC on BTC-e and Aido can authorize his machine to spend the BTC on MtGox into USD.  I am effectively lending him my USD while he in turn is loaning me his BTC.

Once the arbitrage window is over (or we run out of cash), then we settle and split the profits.

Obviously this system would require trust which is scare in the bitcoin community, but if the transactions were small enough and there were enough people running it and we added a "confidence" ranking of some sort based on previous interactions, this thing has real potential to make serious money for anyone who cares to participate while not requiring everyone to have a hundred thousand accounts everywhere to try and keep track of. 

It's optional and will be default disabled, but just be aware this is one really easy way to run arbitrage without so much risk from window expiry.
Hope you guys find it exciting.  There is quite a bit of work to do here, but I think it will all be worth it in the end.


Title: Re: ATP [Advanced Trading Platform]
Post by: Nova! on May 19, 2013, 05:52:02 PM
I was thinking TAP (Trader's Advanced Platform) would be a good name too.

A Tap can mean a lot of things including, a poke on the shoulder, a faucet or connection to a main line, or a song they play at your funeral :)
I'm interested in other names too.



Title: Re: ATP [Advanced Trading Platform]
Post by: daybyter on May 19, 2013, 05:56:01 PM
I would consider a name with 'framework' in it.

MTF = modular trading framework, or so.



Title: Re: ATP [Advanced Trading Platform]
Post by: Aido on May 19, 2013, 06:11:55 PM
I would consider a name with 'framework' in it.

Traders Advanced Pframework (the 'P' is silent like in Michelle Pfeiffer)? :D


Title: Re: ATP [Advanced Trading Platform]
Post by: daybyter on May 19, 2013, 06:20:44 PM
Framework for advandced trading => FAT !  :D

BTW: on the pants in your sig, Aido: you saw, that someone here actually sells used panties for btc? I guess, he has seen your sig...


Title: Re: ATP [Advanced Trading Platform]
Post by: Nova! on May 19, 2013, 06:26:26 PM
I would consider a name with 'framework' in it.

Traders Advanced Pframework (the 'P' is silent like in Michelle Pfeiffer)? :D

Just some more ideas off the top of my head.

Framework for Arbitrage on Real Money (FARM)?

Friendly Actor for Relational Transactions (probably not)

Open Payment & Escrow Network (OPEN)

I'll probably have more later.  Maybe we should re-title the thread to something along the lines of "Help us name our bot trading framework", to attract more attention to the fact we need a name. :)


Title: Re: ATP [Advanced Trading Platform]
Post by: daybyter on May 19, 2013, 06:32:38 PM
Open Framework for Arbitrage with Cryptocoins  => OFAC (pronounced: oh, fu...)  :D


Title: Re: ATP [Advanced Trading Platform]
Post by: Aido on May 19, 2013, 06:43:17 PM
on the pants in your sig, Aido: you saw, that someone here actually sells used panties for btc? I guess, he has seen your sig...

Oh dear. I feel I must explain where the business plan in my sig comes from.....Gnomes (South Park) (http://en.wikipedia.org/wiki/Gnomes_(South_Park))


PLatform for Advance Trading (PLATR - pronounced Platter)

Professional/Programmers Framework for Intelligent Trading (ProFIT)


Title: Re: ATP [Advanced Trading Platform]
Post by: Nova! on May 19, 2013, 06:57:29 PM
on the pants in your sig, Aido: you saw, that someone here actually sells used panties for btc? I guess, he has seen your sig...

Oh dear. I feel I must explain where the business plan in my sig comes from.....Gnomes (South Park) (http://en.wikipedia.org/wiki/Gnomes_(South_Park))


PLatform for Advance Trading (PLATR - pronounced Platter)

Professional/Programmers Framework for Intelligent Trading (ProFIT)

Oooh I like that last one.
Some others though that have been knocking around in the back of my mind....

PROgramed Professional Heterogeneous Exchange Trader (PROPHET)
  
Even just FIT would be good too.

Also Framework for Intelligent eXchange (FIX, which is also a financial protocol name and could lead to some minor confusion but I would have it using FIX as a base communication method anyways).
 
Anyone wanna chip in and search these things for trademarks, domains & products that could cause confusion?


Title: Re: ATP [Advanced Trading Platform]
Post by: ewibit on May 19, 2013, 11:29:51 PM
Professional/Programmers Framework for Intelligent Trading (ProFIT)
+1  ;D
this meets all...


Title: Re: ATP [Advanced Trading Platform]
Post by: Nova! on May 20, 2013, 12:44:27 AM
I'm going to make this quick because I don't have much time right now and I've got to head out for a couple of days.
24hr performance with the Arbitrage bot was terrible, so much so that I decided to debug the algorithm step by step and realized several key assumptions in it are in fact invalid.  I think it will probably need to be scraped.

Now for the good news.  The vwapcross algo actually has decent performance and regular revenue generation in a static market.
You need to set the algorithm to high risk (when the market is flat like it's been), set the minimum currency trade size to 0.01, the minimum BTC to the exchange minimum for MtGox this is 0.001, the max local currency to 1, the max BTC to 0.1 ($10 is a lot of money to me and BTC is currently $120ish). Max loss tolerance of 0.25 (this translates to a risk of between 1 penny and 1 quarter).
Then you need to enable trading across multiple currencies such as GBP, EUR & USD. (I've got all currencies enabled, but performance seems to be in those 3).

With this setup I made ~10% today trading into and out of the various currencies.

I may be incommunicado for a few days.  We're in the process of moving and the new place doesn't have internet yet, but I can at least check this thread a couple times a day.


Title: Re: ATP [Advanced Trading Platform]
Post by: Nova! on May 20, 2013, 02:58:59 AM
I'm seeing an arithemetic exception being thrown in the syncrhonized ticker block of the trendobserver.  This occured when I was offline for an hour or two and then the internet came back.  Aido or someone can you please look into that code and see if it's possible for it be doing something funky with the math like not null checking values or dividing by 0 or something.  There wasn't any sort of logging.  I have the thing running in Eclipse and I just noticed that the thread had stuck and popped open indicating an exception had occured, but not really giving me much else to go on.

The rest of the app kept chugging along, but made some very interesting trades that I'm concerned about and trying to look at now.


Title: Re: ATP [Advanced Trading Platform]
Post by: Aido on May 20, 2013, 09:08:19 AM
I'll have a look at it later, weekend is over and got the day job to attend to first.


Title: Re: ATP [Advanced Trading Platform]
Post by: Aido on May 20, 2013, 09:07:13 PM
I'm seeing an arithemetic exception being thrown in the syncrhonized ticker block of the trendobserver.

Not sure what's causing it. The code (https://github.com/aido/AidoATP/blob/master/src/main/java/org/aido/atp/TrendObserver.java#L122) seems to be doing all the correct checks before doing a calculation. It makes sure the ticker ArrayList isn't empty (https://github.com/aido/AidoATP/blob/master/src/main/java/org/aido/atp/TrendObserver.java#L124) if the connection has dropped for more than an hour. It also checks that each of shortMASize (https://github.com/aido/AidoATP/blob/master/src/main/java/org/aido/atp/TrendObserver.java#L130), shortMACDSize  (https://github.com/aido/AidoATP/blob/master/src/main/java/org/aido/atp/TrendObserver.java#L135)and longMACDSize  (https://github.com/aido/AidoATP/blob/master/src/main/java/org/aido/atp/TrendObserver.java#L140)are not bigger than tickersize so that it doesn't try to access a negative index in the ticker ArrayList.

Can you check in your config that your ShortMA value is set according to the suggested value (https://github.com/aido/AidoATP#suggested-values) i.e. ShortMA =  Minimum ticker size + 1.

If this is the cause then we can enforce the suggested value.

Try running atp with STDERR redirected to a file: java -jar aidoatp.jar 2> aidoatp.err. Kill your internet connection for more than an hour and then reconnect again and see what the error message is.

Meanwhile I'll try and reproduce the error.
         


Title: Re: ATP [Advanced Trading Platform]
Post by: paulthetafy on May 20, 2013, 11:47:50 PM
Hi guys,

Is this available for anyone to try out or only private?  I've read through the previous topics and it all seems very interesting!

Cheers
Paul


Title: Re: ATP [Advanced Trading Platform]
Post by: Nova! on May 21, 2013, 04:46:47 PM
Hi guys,

Is this available for anyone to try out or only private?  I've read through the previous topics and it all seems very interesting!

Cheers
Paul

Yes it is, it's an open source project.  Aido's version is on github under Aido and the OpenPay one is on github under OpenPay/ATP although I'm having difficulty getting a commit to my own repo work right now (Probably because I removed my basis version (Isis-ATP) and then forked Aido's updated version into my own repo).  Use Aido's for the time being, they're basically identical at this point.  Just make sure to disable the Arbitrage Trader because it has some major issues.

Also, pro-tip don't trust it with money you can't afford to lose.  I had a thread lock the other day and when I resolved it in the debugger I was flooded with a bunch of buy & sell market orders that essentially wiped my position out because they had been piling up for a few hours.  I'm actually going to have to buy more bitcoins just so I can keep testing.


Title: Re: ATP [Advanced Trading Platform]
Post by: mccoyspace on May 21, 2013, 08:33:42 PM
Hello,
trying to run Aido, but I get this:

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/aido/atp/Application : Unsupported major.minor version 51.0

java -version gives me this:
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06-451-11M4406)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01-451, mixed mode)


on a mac 10.7.5 with the latest java d/l'ed from oracle.

I'm guessing is wants 1.6.0_51? and I've got _45.....

(btw, the old version of Isis started up no problem)


Title: Re: ATP [Advanced Trading Platform]
Post by: Aido on May 21, 2013, 09:51:56 PM
Hi mccoyspace,

For some reason I can't remember now when I forked the original isisATP to aidoATP I decided to use Java 1.7.  I'm not a Mac person but I believe Java 1.7 is not available on Mac OS X. Although Ianwhitbread (https://bitcointalk.org/index.php?action=profile;u=71007) has reported that he has aidoATP running on a Mac using Java 1.7 (https://bitcointalk.org/index.php?topic=109831.msg1979678#msg1979678). I'm not sure what version of OS he is running.

Currently aidoATP source code will not build with < Java 1.7. However, with a few minor changes I think aidoATP can be modified to be built with Java 1.6. When Nova raised this issue in the other thread (https://bitcointalk.org/index.php?topic=109831.msg1889832#msg1889832) I did a quick check. A simple change to 3 or maybe 4 lines of code is all that is needed.

I was trying to use this thread for discussion on future development of ATP and issues like deciding on a suitable name etc. And use the other IsisATP and AidoATP (https://bitcointalk.org/index.php?topic=109831.0) thread for issues with the existing versions.....like this issue  ;).


Title: Re: ATP [Advanced Trading Platform]
Post by: Aido on May 21, 2013, 10:09:32 PM
I now remember why I decided to use Java 1.7.

Before forking IsisATP to AidoATP I had never programmed in Java before. So, I was just playing around with a few things, trying to learn. One of the things I experimented with was the proposed Java 7 Elvis operator "?". As it turned out the proposal was never accepted into Java 7 so my playing around with it failed. I just decided to keep building with Java 7 and used one of its new features, multi-catch statements, in 3 places.

Basically AidoATP has no real reason for using Java 1.7 over Java 1.6.


Title: Re: ATP [Advanced Trading Platform]
Post by: mccoyspace on May 22, 2013, 02:25:37 AM
Cool, thanks for the explanation. and sorry for mis-filing the post. I have about 5 tabs of ATP discussion threads open and it looks like i didn't keep it straight.

I know just enough java to try to look for those multi-catch statements. maybe the code can be 'devolved' back to 1.6 (or i can get 1.7 running)


Title: Re: ATP [Advanced Trading Platform]
Post by: paulthetafy on May 22, 2013, 06:31:39 AM
Yes it is, it's an open source project.  Aido's version is on github under Aido and the OpenPay one is on github under OpenPay/ATP although I'm having difficulty getting a commit to my own repo work right now (Probably because I removed my basis version (Isis-ATP) and then forked Aido's updated version into my own repo).  Use Aido's for the time being, they're basically identical at this point.  Just make sure to disable the Arbitrage Trader because it has some major issues.

Also, pro-tip don't trust it with money you can't afford to lose.  I had a thread lock the other day and when I resolved it in the debugger I was flooded with a bunch of buy & sell market orders that essentially wiped my position out because they had been piling up for a few hours.  I'm actually going to have to buy more bitcoins just so I can keep testing.

Thanks I'm running Aido's version in sim at the moment so will report back my findings.  I'll try it for 5-7 days and then maybe throw a couple of BTC at it to see what it can do. 

Question: would you recommend using the trend following or custom bid/ask logic?


Title: Re: ATP [Advanced Trading Platform]
Post by: paulthetafy on May 22, 2013, 06:34:54 AM
Actually one other question for you.  Should you begin with both a BTC and USD balance or will it pick an entry point to buy/sell depending on what funds you have?  If it is the former, what sort of split? 50:50?

Paul


Title: Re: ATP [Advanced Trading Platform]
Post by: Aido on May 22, 2013, 10:13:36 AM
Question: would you recommend using the trend following or custom bid/ask logic?

The vwapcross algo actually has decent performance and regular revenue generation in a static market.
You need to set the algorithm to high risk (when the market is flat like it's been), set the minimum currency trade size to 0.01, the minimum BTC to the exchange minimum for MtGox this is 0.001, the max local currency to 1, the max BTC to 0.1 ($10 is a lot of money to me and BTC is currently $120ish). Max loss tolerance of 0.25 (this translates to a risk of between 1 penny and 1 quarter).
Then you need to enable trading across multiple currencies such as GBP, EUR & USD. (I've got all currencies enabled, but performance seems to be in those 3).

With this setup I made ~10% today trading into and out of the various currencies.


Should you begin with both a BTC and USD balance or will it pick an entry point to buy/sell depending on what funds you have?  If it is the former, what sort of split? 50:50?

Depends on which way the market is trending. It first decides whether to buy or sell. Then it looks at the wallet balance to see how much to trade. If there are no funds available it will not trade. For example, if it decides to buy BTC but you have no dollars then nothing happens. But, if in the future the market changes direction it will then sell your BTC for dollars. You will now have dollars in your wallet if the market changes direction yet again and we decides to buy BTC again.




I was trying to use this thread for discussion on future development of ATP and issues like deciding on a suitable name etc. And use the other IsisATP and AidoATP (https://bitcointalk.org/index.php?topic=109831.0) thread for issues with the existing versions.....like this issue  ;).


Title: Re: ATP [Advanced Trading Platform]
Post by: Nova! on May 22, 2013, 09:09:47 PM
Unless you are prescient and can predict the market direction you should put at least a little money into each currency you wish to exchange.
Not all market movements are equal and it won't trade at all even if it detects a huge opportunity if there is no money to trade with.
Also many times an upward swing in 1 currency is due to a downward swing in another, but these are never 1:1 at least not right away.  The vwap trader can profit from both sides of this.

For instance...

I had (at one time) 100 BTC.
At the time BTC was trading at ~10USD.
                                           ~7GBP
                                           ~9.8EUR

I kept 50 BTC and split the rest into roughly even amounts of USD, GBP & EUR.

USD rate fell to $8, so it bought BTC with USD.
A few moments later GBP took a jump to 8.  Thus it sold BTC for GBP.
EUR rate also jumped to 10 so it sold BTC for EUR.

This all happened over the course of 5 to 10 minutes.
I let it run for about a day.

After 24 hours I shut the trader down and swept everything to BTC with a few market orders.  I had made 24BTC in 24 hours.  However the USD rate was back to 10.
The net effect was it had been running arbitrage although not because of any particular arbitrage opportunities it had identified, just a side effect of vwapping 3 markets simultaneously.  If I recall correctly this was the inspiration behind creating a pure arbitrage trader (which actually doesn't work as expected), but it was the inspiration for it.

So my recommendation is to trade a wallet of currencies you are interested in and that move with each-other;  It opens opportunities you otherwise would not have.
I am also recommending everyone start with a fixed amount of money and sweep out  any daily profits into BTC and then BTC xfr to your own private cold storage wallet.
Only sweep if you have end of day profits though.  Remember this is money you have said you don't mind losing.  Every day you will make a loss or a profit, but over the course of a few months you should see that gains will outstrip losses by about 5-10% regardless of the net direction of the market as a whole.

In the next version I expect to create a built in wallet not tied to MtGox that will sweep profits as they occur.


Title: Re: ATP [Advanced Trading Platform]
Post by: paulthetafy on May 23, 2013, 05:39:47 AM
Thanks again for the feedback.  I'm trialling this with MTGox (BTC, USD, EUR, AUD, GBP) and BTC-e (BTC, LTC).  It's been running for a couple of hours now and I'm getting "No LTC ticker data collected yet, cannot calculate profit/loss" and I don't have a BTC-e_LTC.dat file.  Is BTC to LTC supported?

I have approx 1BTC at MTGox (split between various currencies) and the same at BTC-e split between BTC/USD/LTC.  I'll post a report daily of how it tracks (unless you would prefer I posted it in a different thread)


Title: Re: ATP [Advanced Trading Platform]
Post by: Nova! on May 23, 2013, 07:35:16 AM
Thanks again for the feedback.  I'm trialling this with MTGox (BTC, USD, EUR, AUD, GBP) and BTC-e (BTC, LTC).  It's been running for a couple of hours now and I'm getting "No LTC ticker data collected yet, cannot calculate profit/loss" and I don't have a BTC-e_LTC.dat file.  Is BTC to LTC supported?

I have approx 1BTC at MTGox (split between various currencies) and the same at BTC-e split between BTC/USD/LTC.  I'll post a report daily of how it tracks (unless you would prefer I posted it in a different thread)

Congrats, you're using a completely untested configuration.  I would love to know how it works out though.  Frankly I had no idea it could do that.


Title: Re: ATP [Advanced Trading Platform]
Post by: paulthetafy on May 23, 2013, 07:42:27 AM
Congrats, you're using a completely untested configuration.  I would love to know how it works out though.  Frankly I had no idea it could do that.

hmm I'm still getting the same error so it's obviously not working.  In theory it should though as LTC is just another currency to trade BTC in/out of.  For the purpose of testing I think I'll pull my LTC out for now.  If you figure out why it wouldn't create the LTC ticker data then give me a buzz!


Title: Re: ATP [Advanced Trading Platform]
Post by: Aido on May 23, 2013, 08:02:33 AM
LTC is currently not supported. Neither is NMC, PPC, TRC and NVC. aidoATP does not gather any data for these currencies. XChange does not support these currencies, or at least did not when I put the following if statement in AccountManger:

Code:
if(!currency.getCode().equals("BTC") && !currency.getCode().equals("NMC") && !currency.getCode().equals("LTC") && !currency.getCode().equals("PPC") && !currency.getCode().equals("TRC") && !currency.getCode().equals("NVC") && !(exchangeName.equals("BitcoinCentral") && (currency.getCode().equals("CAD") || currency.getCode().equals("INR"))) )

(There was also an issue with CAD and INR on BitcoinCentral)
         


Title: Re: ATP [Advanced Trading Platform]
Post by: Nova! on May 23, 2013, 08:28:07 AM

(There was also an issue with CAD and INR on BitcoinCentral)
         

Uhh what issue?


Title: Re: ATP [Advanced Trading Platform]
Post by: Aido on May 23, 2013, 01:38:52 PM
Uhh what issue?

The ticker kept crashing for those currency/exchange combos so I disabled them with view to fixing at a later date. I don' think the error lies with ATP though. From what I can remember BigMoney was throwing an error.


Title: Re: ATP [Advanced Trading Platform]
Post by: Nova! on May 23, 2013, 07:53:52 PM
Uhh what issue?

The ticker kept crashing for those currency/exchange combos so I disabled them with view to fixing at a later date. I don' think the error lies with ATP though. From what I can remember BigMoney was throwing an error.

Interesting.  I think we should maybe get an issue tracker up.  I'm not at a place where I have reliable internet for a few more days, but it would be a good idea to get one up very soon.


Title: Re: ATP [Advanced Trading Platform]
Post by: Aido on May 23, 2013, 08:08:17 PM
agreed. Have been busy all this week but may get some time over weekend to look at the issues raised in this and other thread.

The github issue tracker (https://github.com/aido/AidoATP/issues?state=open) is a good place to raise them.


Title: Re: ATP [Advanced Trading Platform]
Post by: Ianwhitbread on May 25, 2013, 11:53:26 AM
sorry for the Slow Reply

yes I got adioATP working on a mac

you can install 1.7  from oracle

but the only problem I had was saving the configuration
maybe its just the case of manually making the directory forthe pref file to be saved in

help that helps


Title: Re: ATP [Advanced Trading Platform]
Post by: dwolfman on May 30, 2013, 09:34:27 AM
I'm trying to get ATP going in my virtual machine running Fedora 18.  Pretty sure everything is there it should need (verified I have 1.7.0 version of Java installed at least).  It starts up and gets the basic data of my CampBX account (wallet amounts, etc), but it dies with an exception when it starts trying to get the ticker data.  Here's the error:

Code:
2013-05-30 04:24:17,348 : ERROR: Caught unexpected CampBX exception, ticker manager shutting down now!. Details are listed below.
java.lang.NullPointerException
at org.aido.atp.ATPTicker.<init>(ATPTicker.java:49)
at org.aido.atp.TickerManager.checkTick(TickerManager.java:157)
at org.aido.atp.PollingTickerManager.getTick(PollingTickerManager.java:56)
at org.aido.atp.TickerManager.run(TickerManager.java:91)
at java.lang.Thread.run(Thread.java:722)

It's also a bit annoying as it never seems to save the config either.  I have to go through the interview every time I start it up.  I'm not trying to do anything beyond simulation mode for now (want to see what my strategy does for a couple days).

Any ideas?


Title: Re: ATP [Advanced Trading Platform]
Post by: Aido on May 30, 2013, 07:51:34 PM
It starts up and gets the basic data of my CampBX account (wallet amounts, etc), but it dies with an exception when it starts trying to get the ticker data.

Probably because the CampBX Market ticker (https://campbx.com/api.php) is not very useful and does not contain any volume data, causing a NullPointerException.


It's also a bit annoying as it never seems to save the config either.

Don't know what could be causing this. You seem to be the only one reporting this. After you have completed the interview process and while AidoATP is running can you check the contents of your ~/.java/.userPrefs/org/aido/atp/ directory and see if it contains a prefs.xml file.


Title: Re: ATP [Advanced Trading Platform]
Post by: dwolfman on May 30, 2013, 09:48:26 PM
Probably because the CampBX Market ticker (https://campbx.com/api.php) is not very useful and does not contain any volume data, causing a NullPointerException.

I did want to try the VWAPCross logic out.  Guess that's out for CampBX then.  Is that why it threw the exception then, since I was trying VWAPCross on it?

Quote
Don't know what could be causing this. You seem to be the only one reporting this. After you have completed the interview process and while AidoATP is running can you check the contents of your ~/.java/.userPrefs/org/aido/atp/ directory and see if it contains a prefs.xml file.

Right now ATP is not running, so I checked that folder.  There is a prefs.xml in it, and it has all my settings in it too.  Could it be due to the exception that something isn't being set somewhere to say it's got a prefs file?


Title: Re: ATP [Advanced Trading Platform]
Post by: dwolfman on May 30, 2013, 09:54:28 PM
Even if I change the Bid/Ask logic, it still doesn't remember the settings, even though it updates the prefs.xml file.  Runs through the interview every time.  :-(

I'll bet I'm doing something wrong, but no clue what that would be.


Title: Re: ATP [Advanced Trading Platform]
Post by: dwolfman on May 30, 2013, 10:26:30 PM
And I still get the exception, even when not using the VWAPCross logic.

So if the lack of volume in CampBX's ticker is a problem, why is it listed as supported?  CampBX is the only place I really want to trade, though in a bind I could go with BTC-e, and MtGox is not an option for me.


Title: Re: ATP [Advanced Trading Platform]
Post by: dwolfman on May 30, 2013, 10:48:43 PM
Guess I'll just run this against BTC-e for a while.  That at least doesn't throw the exception.

Any plans to work out the issues with CampBX?  I'd rather trade there since it's easier for me to move my USD to/from.


Title: Re: ATP [Advanced Trading Platform]
Post by: Ianwhitbread on May 30, 2013, 11:08:44 PM
Been lucky today

A whole day. Without any dud trades

Adio and nova

Once I have made up for my loses I with send you some beer money

But today was a good day for once

Now must learn not to touch and fiddle and stop being greedy !!





Title: Re: ATP [Advanced Trading Platform]
Post by: dwolfman on May 30, 2013, 11:55:02 PM
OK, I'm about to give up.

Is MtGox the ONLY place this one will work right with?

BTC-e doesn't do market orders, so that just leaves BitStamp or MtGox.  Guess I'll give BitStamp a try now.


Title: Re: ATP [Advanced Trading Platform]
Post by: dwolfman on May 31, 2013, 12:35:59 AM
And I may not get to try it.  All my BTC (about .14 worth) was tied up on BTC-e, being held captive by their new email verification for withdrawals.  If I can ever get them out of there I'll never go there again.

So, while I'm waiting on getting that resolved, what's everyone's thoughts on using ATP with Bitstamp?  Does it work better with Bitstamp than my experience so far trying it with CampBX and BTC-e?


Title: Re: ATP [Advanced Trading Platform]
Post by: dwolfman on May 31, 2013, 02:10:00 AM
That's it, I give up.

So ATP can't do market orders at Bitstamp either?  Is MtGox truly the only exchange that this bot will work with?  Why even list the others if they won't work?


Title: Re: ATP [Advanced Trading Platform]
Post by: Nova! on May 31, 2013, 06:27:35 AM
That's it, I give up.

So ATP can't do market orders at Bitstamp either?  Is MtGox truly the only exchange that this bot will work with?  Why even list the others if they won't work?

Don't lose heart.  I only ever made it to work with MtGox because that was all the Xchange API it's using was supporting at that time.

Unfortunately I'm still stuck in Ecuador with limited access to internet and I'm having difficulty trying to get my bank to send money to Russia while I'm here in Ecuador so I can't really test anything right now.

I will be catching a flight out of here soon and I'm going to have a nice long talk with my branch manager about what does and does not constitute acceptable security of my funds while traveling, then I plan to work on this fulltime again.

I'm not sure if Aido is planning active development on getting other exchanges to work, but I've sold my soul into another contract job part of which involves getting ATP to work with limit orders and multiple exchanges as soon as I get back to the states.  I made sure I can put those changes back into the mainline, so just have a little patience please and it will be working.

I apologize for everyone's difficulties with this product, but thank you for your patience.


Title: Re: ATP [Advanced Trading Platform]
Post by: Nova! on May 31, 2013, 06:38:31 AM
Been lucky today

A whole day. Without any dud trades

Adio and nova

Once I have made up for my loses I with send you some beer money

But today was a good day for once

Now must learn not to touch and fiddle and stop being greedy !!

Man it's great to hear people making money with the bot.  Makes a crappy day feel better just to know something I had a hand in actually enriched the lives of others.  BTW great job to Aido too for keeping this thing going.  Wouldn't exist anymore if it weren't for him and that's a fact.


Title: Re: ATP [Advanced Trading Platform]
Post by: dwolfman on May 31, 2013, 07:22:52 AM
Oh, I'll keep an eye on it, but I really need something to try and make my coins grow soon.  My mining operation isn't very big (varies from 280 MH/s to 600 MH/s, depends on if the kids are playing games on their computers or not), so it's not bringing anything in very fast.  And since I'm unemployed and broke but looking for work, I'll need to do something within the next few weeks to pay my rent or end up on the street.  Even though trading on an exchange won't get me all of the rent, if I can make my coins grow between now and then it will help at least a little.

And just an FYI:  I was just looking through CampBX's API info on their site.  Apparently, they can do market orders using the Advanced trade API calls.

Code:
 
    An API call to place an advanced order can be made in following format:
    ­
    https://CampBX.com/api/tradeadv.php
    ­
    POST Mandatory fields:
    user=USERNAME pass=PASSWORD
    TradeMode=AdvancedBuy OR TradeMode=AdvancedSell
    Price=DECIMAL OR Price=Market
    Quantity=DECIMAL

    Optional Fields:
    FillType=Incremental OR FillType=AON OR FillType=FOK
    (If omitted, default Fill Type is Incremental)
    ­
    DarkPool=No OR DarkPool=Yes
    (Default is No Darkpool)
    ­
    Expiry=YYYY/MM/DD
    (Allowed range is 1 Hour through 31 Days) (Many additional formats are supported as well,
    including relative values! Please contact our helpdesk if you would like additional information
    about time/date formats.)
   
    Please note that all parameters are case-sensitive. We highly recommend executing small
    trades and experimenting with all of the possible parameter values before implementing them
    in your strategy.

    Expiry date field allows using many relative and absolute values and offers a lot of flexibility.
    If this is something that you rely on heavily in your strategy, please contact us for details
    about additional formats.

    Return Values:
    If your entire order is executed immediately, the return value will be '0' in JSON format:
    {"Success":"0"}
    ­
    In case the order was not filled entirely, the return value would be corresponding Order ID
    in our Order Book.
 

Notice that the Price field has an option of "Market".  :-)


Title: Re: ATP [Advanced Trading Platform]
Post by: Ianwhitbread on May 31, 2013, 09:18:48 AM
Hahaha. Spoke too soon

First dud of the day

8.28am. Bought at £85.66

9.31am. Sold at ca$132.50

Doh!

But first dud in about 15 trades

So happy with results

Making money in the last 24 hours yes
But very small amounts

Could get a Starbucks coffee (small size) with yesterday profits

(Just)

But very interesting

Lets see what the next 24 hours bring

Think I was lucky yesterday was trading pretty flat till the liberty exchange had some problems with
The law which I believe caused a slight drop in the price

Gave me a chance to buy slightly cheaper







Title: Re: ATP [Advanced Trading Platform]
Post by: Askit2 on May 31, 2013, 05:02:44 PM
AidoATP crashed using version with XChange 1.7.0 on MTGoX. Win 7-64bit. Java 1.7
Code:
2013-05-31 10:15:13,531 ←[1;31m:←[0;39m ERROR: Caught unexpected exception, shutting down MtGox trend following trading agent now!
. Details are listed below.
java.lang.RuntimeException: Problem getting JSON object
        at si.mazi.rescu.JSONUtils.getJsonObject(JSONUtils.java:68)
        at si.mazi.rescu.HttpTemplate.executeRequest(HttpTemplate.java:118)
        at si.mazi.rescu.RestInvocationHandler.invokeHttp(RestInvocationHandler.java:53)
        at si.mazi.rescu.RestInvocationHandler.invoke(RestInvocationHandler.java:48)
        at com.sun.proxy.$Proxy6.getAccountInfo(Unknown Source)
        at com.xeiam.xchange.mtgox.v2.service.polling.MtGoxPollingAccountService.getAccountInfo(MtGoxPollingAccountService.java:78
)
        at org.aido.atp.AccountManager.refreshAccounts(AccountManager.java:121)
        at org.aido.atp.AccountManager.getBalance(AccountManager.java:105)
        at org.aido.atp.TrendTradingAgent.evalAsk(TrendTradingAgent.java:394)
        at org.aido.atp.TrendTradingAgent.run(TrendTradingAgent.java:344)
        at java.lang.Thread.run(Unknown Source)
Caused by: com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, St
ring, array, object, 'true', 'false' or 'null')
 at [Source: java.io.StringReader@574979a9; line: 1, column: 2]
        at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1378)
        at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:599)
        at com.fasterxml.jackson.core.base.ParserMinimalBase._reportUnexpectedChar(ParserMinimalBase.java:520)
        at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._handleUnexpectedValue(ReaderBasedJsonParser.java:1387)
        at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextToken(ReaderBasedJsonParser.java:678)
        at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:2834)
        at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:2781)
        at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:1942)
        at si.mazi.rescu.JSONUtils.getJsonObject(JSONUtils.java:64)
        ... 10 more
2013-05-31 10:15:30,675 ←[1;31m:←[0;39m Error unmarshalling from json: <html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>cloudflare-nginx</center>
</body>
</html>
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->

2013-05-31 10:15:30,678 ←[1;31m:←[0;39m ERROR: Caught unexpected MtGox exception, ticker manager shutting down now!. Details are l
isted below.
java.lang.RuntimeException: Problem getting JSON object
        at si.mazi.rescu.JSONUtils.getJsonObject(JSONUtils.java:68)
        at si.mazi.rescu.HttpTemplate.executeRequest(HttpTemplate.java:118)
        at si.mazi.rescu.RestInvocationHandler.invokeHttp(RestInvocationHandler.java:53)
        at si.mazi.rescu.RestInvocationHandler.invoke(RestInvocationHandler.java:48)
        at com.sun.proxy.$Proxy6.getTicker(Unknown Source)
        at com.xeiam.xchange.mtgox.v2.service.polling.MtGoxPollingMarketDataService.getTicker(MtGoxPollingMarketDataService.java:7
7)
        at org.aido.atp.PollingTickerManager.getTick(PollingTickerManager.java:56)
        at org.aido.atp.TickerManager.run(TickerManager.java:91)
        at java.lang.Thread.run(Unknown Source)
Caused by: com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, St
ring, array, object, 'true', 'false' or 'null')
 at [Source: java.io.StringReader@5ba9bb34; line: 1, column: 2]
        at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1378)
        at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:599)
        at com.fasterxml.jackson.core.base.ParserMinimalBase._reportUnexpectedChar(ParserMinimalBase.java:520)
        at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._handleUnexpectedValue(ReaderBasedJsonParser.java:1387)
        at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextToken(ReaderBasedJsonParser.java:678)
        at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:2834)
        at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:2781)
        at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:1942)
        at si.mazi.rescu.JSONUtils.getJsonObject(JSONUtils.java:64)
        ... 8 more

It Looks like my connection hiccupped and ATP went down. Either that or  GoX had an issue.

Second problem is more a nuisance request. Errors are handled but I wonder why it can't create  the file in question or why I can't create the file.
Code:
C:\Downloads\Bitcoin\BitcoinBot\AidoATP-master\bin>java -jar aidoatp.jar --simulation-mode=true
10:52:02,383 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
10:52:02,384 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
10:52:02,384 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [jar:file:/C:/Downloads/Bit
coin/BitcoinBot/AidoATP-master/bin/aidoatp.jar!/logback.xml]
10:52:02,462 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@203f97d7 - URL [jar:file:/C:/Downloads/Bitcoin/Bitcoin
Bot/AidoATP-master/bin/aidoatp.jar!/logback.xml] is not of type file
10:52:02,729 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
10:52:02,776 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.cor
e.ConsoleAppender]
10:52:02,822 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
10:52:02,990 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.en
coder.PatternLayoutEncoder] for [encoder] property
10:52:03,298 |-INFO in ch.qos.logback.core.ConsoleAppender[STDOUT] - Enabling JANSI WindowsAnsiOutputStream for the console.
10:52:03,302 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - Failed to create WindowsAnsiOutputStream. Falling back on the
 default stream. ch.qos.logback.core.util.DynamicClassLoadingException: Failed to instantiate type org.fusesource.jansi.WindowsAns
iOutputStream
        at ch.qos.logback.core.util.DynamicClassLoadingException: Failed to instantiate type org.fusesource.jansi.WindowsAnsiOutpu
tStream
        at      at ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:73)
        at      at ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:42)
        at      at ch.qos.logback.core.ConsoleAppender.getTargetStreamForWindows(ConsoleAppender.java:94)
        at      at ch.qos.logback.core.ConsoleAppender.start(ConsoleAppender.java:85)
        at      at ch.qos.logback.core.joran.action.AppenderAction.end(AppenderAction.java:96)
        at      at ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Interpreter.java:317)
        at      at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:196)
        at      at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:182)
        at      at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:62)
        at      at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:149)
        at      at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:135)
        at      at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:99)
        at      at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:49)
        at      at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75)
        at      at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:148)
        at      at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85)
        at      at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
        at      at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128)
        at      at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:107)
        at      at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:295)
        at      at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:269)
        at      at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:281)
        at      at org.aido.atp.Application.<init>(Application.java:54)
        at      at org.aido.atp.Application.getInstance(Application.java:67)
        at      at org.aido.atp.Application.main(Application.java:75)
Caused by: java.lang.ClassNotFoundException: org.fusesource.jansi.WindowsAnsiOutputStream
        at      at java.net.URLClassLoader$1.run(Unknown Source)
        at      at java.net.URLClassLoader$1.run(Unknown Source)
        at      at java.security.AccessController.doPrivileged(Native Method)
        at      at java.net.URLClassLoader.findClass(Unknown Source)
        at      at java.lang.ClassLoader.loadClass(Unknown Source)
        at      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at      at java.lang.ClassLoader.loadClass(Unknown Source)
        at      at ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:60)
        at      ... 24 common frames omitted
10:52:03,302 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.cor
e.rolling.RollingFileAppender]
10:52:03,314 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [FILE]
10:52:03,402 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@14b7e998 - Will use gz compression
10:52:03,439 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.en
coder.PatternLayoutEncoder] for [encoder] property
10:52:03,447 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - Active log file name: aidoatp.log
10:52:03,448 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - File property is set to [aidoatp.log]
10:52:03,455 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.xeiam.xchange] to WARN
10:52:03,455 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [si.mazi.rescu] to WARN
10:52:03,456 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to DEBUG
10:52:03,456 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [FILE] to Logger[ROOT]
10:52:03,459 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
10:52:03,459 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
10:52:03,463 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@364904c8 - Registering current configuration as safe fallbac
k point

2013-05-31 10:52:03,624 ←[34m:←[0;39m Aido ATP has started successfully
2013-05-31 10:52:03,639 ←[34m:←[0;39m Entering simulation mode. Trades will not be executed.


Title: Re: ATP [Advanced Trading Platform]
Post by: Kosmatik on May 31, 2013, 05:13:54 PM
Getting same as Askit2 this is what console window shows

Code:
Exception in thread "Thread-1" si.mazi.rescu.HttpException: Problem POSTing (IO)

        at si.mazi.rescu.HttpTemplate.executeRequest(HttpTemplate.java:135)
        at si.mazi.rescu.RestInvocationHandler.invokeHttp(RestInvocationHandler.
java:53)
        at si.mazi.rescu.RestInvocationHandler.invoke(RestInvocationHandler.java
:48)
        at $Proxy6.getAccountInfo(Unknown Source)
        at com.xeiam.xchange.mtgox.v2.service.polling.MtGoxPollingAccountService
.getAccountInfo(MtGoxPollingAccountService.java:78)
        at org.aido.atp.AccountManager.refreshAccounts(AccountManager.java:121)
        at org.aido.atp.AccountManager.run(AccountManager.java:101)
        at java.lang.Thread.run(Unknown Source)
Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.Validator
Exception: PKIX path building failed: sun.security.provider.certpath.SunCertPath
BuilderException: unable to find valid certification path to requested target
        at sun.security.ssl.Alerts.getSSLException(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.fatal(Unknown Source)
        at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
        at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
        at sun.security.ssl.ClientHandshaker.serverCertificate(Unknown Source)
        at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source)
        at sun.security.ssl.Handshaker.processLoop(Unknown Source)
        at sun.security.ssl.Handshaker.process_record(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source
)
        at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
        at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect
(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown S
ource)
        at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(Unk
nown Source)
        at si.mazi.rescu.HttpTemplate.executeRequest(HttpTemplate.java:107)
        ... 7 more
Caused by: sun.security.validator.ValidatorException: PKIX path building failed:
 sun.security.provider.certpath.SunCertPathBuilderException: unable to find vali
d certification path to requested target
        at sun.security.validator.PKIXValidator.doBuild(Unknown Source)
        at sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
        at sun.security.validator.Validator.validate(Unknown Source)
        at sun.security.ssl.X509TrustManagerImpl.validate(Unknown Source)
        at sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source)
        at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Sour
ce)
        ... 20 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to
 find valid certification path to requested target
        at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown
 Source)
        at java.security.cert.CertPathBuilder.build(Unknown Source)
        ... 26 more


Title: Re: ATP [Advanced Trading Platform]
Post by: Nova! on May 31, 2013, 10:47:25 PM
Getting same as Askit2 this is what console window shows

Code:
Exception in thread "Thread-1" si.mazi.rescu.HttpException: Problem POSTing (IO)

        at si.mazi.rescu.HttpTemplate.executeRequest(HttpTemplate.java:135)
        at si.mazi.rescu.RestInvocationHandler.invokeHttp(RestInvocationHandler.
java:53)
        at si.mazi.rescu.RestInvocationHandler.invoke(RestInvocationHandler.java
:48)
        at $Proxy6.getAccountInfo(Unknown Source)
        at com.xeiam.xchange.mtgox.v2.service.polling.MtGoxPollingAccountService
.getAccountInfo(MtGoxPollingAccountService.java:78)
        at org.aido.atp.AccountManager.refreshAccounts(AccountManager.java:121)
        at org.aido.atp.AccountManager.run(AccountManager.java:101)
        at java.lang.Thread.run(Unknown Source)
Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.Validator
Exception: PKIX path building failed: sun.security.provider.certpath.SunCertPath
BuilderException: unable to find valid certification path to requested target
        at sun.security.ssl.Alerts.getSSLException(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.fatal(Unknown Source)
        at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
        at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
        at sun.security.ssl.ClientHandshaker.serverCertificate(Unknown Source)
        at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source)
        at sun.security.ssl.Handshaker.processLoop(Unknown Source)
        at sun.security.ssl.Handshaker.process_record(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source
)
        at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
        at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect
(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown S
ource)
        at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(Unk
nown Source)
        at si.mazi.rescu.HttpTemplate.executeRequest(HttpTemplate.java:107)
        ... 7 more
Caused by: sun.security.validator.ValidatorException: PKIX path building failed:
 sun.security.provider.certpath.SunCertPathBuilderException: unable to find vali
d certification path to requested target
        at sun.security.validator.PKIXValidator.doBuild(Unknown Source)
        at sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
        at sun.security.validator.Validator.validate(Unknown Source)
        at sun.security.ssl.X509TrustManagerImpl.validate(Unknown Source)
        at sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source)
        at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Sour
ce)
        ... 20 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to
 find valid certification path to requested target
        at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown
 Source)
        at java.security.cert.CertPathBuilder.build(Unknown Source)
        ... 26 more

Gonna take a wild guess here and say that they probably changed their cert to yet another random issuer without a valid chain.  Try going to the URL, and examining the cert.  Then add it to the accepted certs for Java and see if that fixed it.


Title: Re: ATP [Advanced Trading Platform]
Post by: Nova! on May 31, 2013, 11:21:10 PM
We really need to be catching these exceptions in refresh account and leaving an explanation rather than a stacktrace.

In one section there was a 502 bad gateway error.  500 codes mean the server puked and died, that is something we should definetly handle with an exponential backoff mechanism rather than letting the thread just sit there dead.

In the other one a valid chain of trust could not be built.  This COULD be coming from a 502 gateway exception, but we really have no way to be certain, however my gut tells me MtGox bought yet another cheapy cert that Java isn't happy with.

I would personally just override the setup performing SSL and tell it to not worry about the chain of trust on it (maybe make this configurable), but this is all being handled at the API layer and doing so would create a code fork we would have to maintain forever.

I'm not feeling really impressed with the Xchange API at this time.  It was good when it came out, but we are starting to see some significant issues from our reliance upon it.
I hate to try and re-implement it, forking it would probably cause a similar nightmare.

I'm open to suggestions on whether to fork it, toss it or just keep chugging along with it.
I'll be home soon and be able to devote much more time to it.  In the meantime ideas are always welcome.


Title: Re: ATP [Advanced Trading Platform]
Post by: daybyter on June 01, 2013, 05:37:16 PM
Help here?

https://github.com/ReAzem/cryptocoin-tradelib

I'm doing bot dev, too, and released some of my sources...any helping hand is welcome... :)


Title: Re: ATP [Advanced Trading Platform]
Post by: telemaco on June 01, 2013, 10:43:22 PM
Hello,

I am trying to --clear-config but getting this error (on Windows 8 64 bits with Java JSE 7 U21. It seems it can continue but then won't be able to login to bitstamp, or mtgox saying that the user/password is not correct (and it is!). Wonder if that Ansi output stream maybe the culprit. The passwords on the registry have a "/" character after every highscore character. Is that correct?

Code:
C:\AidoATP\bin>java -jar aidoatp.jar --clear-config=true
00:37:55,523 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
00:37:55,523 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
00:37:55,524 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [jar:file:/C:/AidoATP/bin/aidoatp.jar!/logback.xml]
00:37:55,535 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@5d3f03b - URL [jar:file:/C:/AidoATP/bin/aidoatp.jar!/logback.xml] is not of type file
00:37:56,184 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
00:37:56,307 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
00:37:56,314 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
00:37:56,337 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
00:37:56,394 |-INFO in ch.qos.logback.core.ConsoleAppender[STDOUT] - Enabling JANSI WindowsAnsiOutputStream for the console.
00:37:56,394 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - Failed to create WindowsAnsiOutputStream. Falling back on the default stream. ch.qos.logback.core.util.DynamicClassLoadingException: Failed to instanti
ate type org.fusesource.jansi.WindowsAnsiOutputStream
        at ch.qos.logback.core.util.DynamicClassLoadingException: Failed to instantiate type org.fusesource.jansi.WindowsAnsiOutputStream
        at      at ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:73)
        at      at ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:42)
        at      at ch.qos.logback.core.ConsoleAppender.getTargetStreamForWindows(ConsoleAppender.java:94)
        at      at ch.qos.logback.core.ConsoleAppender.start(ConsoleAppender.java:85)
        at      at ch.qos.logback.core.joran.action.AppenderAction.end(AppenderAction.java:96)
        at      at ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Interpreter.java:317)
        at      at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:196)
        at      at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:182)
        at      at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:62)
        at      at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:149)
        at      at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:135)
        at      at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:99)
        at      at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:49)
        at      at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75)
        at      at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:148)
        at      at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85)
        at      at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
        at      at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128)
        at      at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:107)
        at      at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:295)
        at      at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:269)
        at      at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:281)
        at      at org.aido.atp.Application.<init>(Application.java:54)
        at      at org.aido.atp.Application.getInstance(Application.java:67)
        at      at org.aido.atp.Application.main(Application.java:75)
Caused by: java.lang.ClassNotFoundException: org.fusesource.jansi.WindowsAnsiOutputStream
        at      at java.net.URLClassLoader$1.run(Unknown Source)
        at      at java.net.URLClassLoader$1.run(Unknown Source)
        at      at java.security.AccessController.doPrivileged(Native Method)
        at      at java.net.URLClassLoader.findClass(Unknown Source)
        at      at java.lang.ClassLoader.loadClass(Unknown Source)
        at      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at      at java.lang.ClassLoader.loadClass(Unknown Source)
        at      at ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:60)
        at      ... 24 common frames omitted
00:37:56,394 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
00:37:56,396 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [FILE]
00:37:56,407 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@42e57c4c - Will use gz compression
00:37:56,413 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
00:37:56,415 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - Active log file name: aidoatp.log


Title: Re: ATP [Advanced Trading Platform]
Post by: telemaco on June 01, 2013, 11:10:36 PM
Hello,

Also getting the SSL certificate problem

Code:
2013-06-02 01:09:37,022 ←[34m:←[0;39m Aido ATP has started successfully
2013-06-02 01:09:37,024 ←[34m:←[0;39m Entering simulation mode. Trades will not be executed.
2013-06-02 01:09:37,025 ←[34m:←[0;39m Using arbitrage to decide some trades.
2013-06-02 01:09:37,169 ←[34m:←[0;39m Connecting to Bitstamp Exchange
2013-06-02 01:09:37,170 ←[34m:←[0;39m Connecting to CampBX Exchange
2013-06-02 01:09:37,287 ←[34m:←[0;39m Connecting to BTC-e Exchange
2013-06-02 01:09:37,287 ←[34m:←[0;39m Connecting to MtGox Exchange
2013-06-02 01:09:37,516 ←[31m:←[0;39m WARNING: Testing connection to exchange MtGox
Exception in thread "Thread-4" si.mazi.rescu.HttpException: Problem POSTing (IO)
        at si.mazi.rescu.HttpTemplate.executeRequest(HttpTemplate.java:135)
        at si.mazi.rescu.RestInvocationHandler.invokeHttp(RestInvocationHandler.java:53)
        at si.mazi.rescu.RestInvocationHandler.invoke(RestInvocationHandler.java:48)
        at com.sun.proxy.$Proxy10.getAccountInfo(Unknown Source)
        at com.xeiam.xchange.mtgox.v2.service.polling.MtGoxPollingAccountService.getAccountInfo(MtGoxPollingAccountService.java:78)
        at org.aido.atp.AccountManager.refreshAccounts(AccountManager.java:121)
        at org.aido.atp.AccountManager.run(AccountManager.java:101)
        at java.lang.Thread.run(Unknown Source)
Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to
 requested target
        at sun.security.ssl.Alerts.getSSLException(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.fatal(Unknown Source)
        at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
        at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
        at sun.security.ssl.ClientHandshaker.serverCertificate(Unknown Source)
        at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source)
        at sun.security.ssl.Handshaker.processLoop(Unknown Source)
        at sun.security.ssl.Handshaker.process_record(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
        at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)
        at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(Unknown Source)
        at si.mazi.rescu.HttpTemplate.executeRequest(HttpTemplate.java:107)
        ... 7 more
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
        at sun.security.validator.PKIXValidator.doBuild(Unknown Source)
        at sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
        at sun.security.validator.Validator.validate(Unknown Source)
        at sun.security.ssl.X509TrustManagerImpl.validate(Unknown Source)
        at sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source)
        at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
        ... 20 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
        at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source)
        at java.security.cert.CertPathBuilder.build(Unknown Source)
        ... 26 more

Any help appreciated


Title: Re: ATP [Advanced Trading Platform]
Post by: telemaco on June 02, 2013, 12:52:05 AM
Followed the next steps for C:\Program Files\Java\jdk1.7.0_21\jre\lib\security\cacerts but no luck. Still same error.

http://magicmonster.com/kb/prg/java/ssl/pkix_path_building_failed.html


Title: Re: ATP [Advanced Trading Platform]
Post by: telemaco on June 02, 2013, 02:54:23 AM
Solved.

Followed the steps on the link i pasted before but on

C:\Program Files\Java\jre7\lib\security\cacerts

not on the jdk

Cheers,


Title: Re: ATP [Advanced Trading Platform]
Post by: Nova! on June 02, 2013, 08:03:13 AM
I'm developing the 2.0 version of ATP.  More info is here...
https://bitcointalk.org/index.php?topic=223394.0

The current ATP project will be rolled into this, new version as time progresses.


Title: Re: ATP [Advanced Trading Platform]
Post by: Naruby on June 02, 2013, 08:50:11 AM
After a day of two tinkering, mainly do to my very limited Linux knowledge, I got AidoATP running on my Raspberry Pi  8)
My main steps, problems, solutions:

1) Java
I'm  using Raspbian hard float ABI witch made it a bit hard to find out Java.
I've used https://jdk8.java.net/fxarmpreview/  (https://jdk8.java.net/fxarmpreview/) This is a beta of Java 8 for ARM processors but is running stable.
Move /java from my homedir to /usr/local
Added in PATH /usr/local/java/bin
Added JAVA_HOME=/usr/local/java/bin

2) Certificates
Downloaded the certificate for https://data.mtgox.com website
Code:
echo -n | openssl s_client -connect data.mtgox.com:443 |sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > mtgoxData.pem

Added the mtgox data cert to the java keystore
Code:
keytool -importcert -file mtgoxData.pem -alias mtgoxData

Show the certificate chain :
Code:
openssl s_client -connect data.mtgox.com:443 -showcert
Copy&paste the 2 certs between the BEGIN CERT en END CERT lines in 2 files : StartComInterCA.pem and startComCA.pem

Added the chain cert to the CA java store:
Code:
keytool -keystore /usr/local/java/jre/lib/security/cacerts  -importcert -file StartComInterCA.pem -alias startComInterCA
keytool -keystore /usr/local/java/jre/lib/security/cacerts  -importcert -file startComCA.pem -alias startComCA

3) Succes !


Title: Re: ATP [Advanced Trading Platform]
Post by: Nova! on June 02, 2013, 10:45:30 PM
After a day of two tinkering, mainly do to my very limited Linux knowledge, I got AidoATP running on my Raspberry Pi  8)
My main steps, problems, solutions:

1) Java
I'm  using Raspbian hard float ABI witch made it a bit hard to find out Java.
I've used https://jdk8.java.net/fxarmpreview/  This is a beta of Java 8 for ARM processors but is running stable.
Move /java from my homedir to /usr/local
Added in PATH /usr/local/java/bin
Added JAVA_HOME=/usr/local/java/bin

2) Certificates
Downloaded the certificate for https://data.mtgox.com website
Code:
echo -n | openssl s_client -connect data.mtgox.com:443 |sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > mtgoxData.pem

Added the mtgox data cert to the java keystore
Code:
keytool -importcert -file mtgoxData.pem -alias mtgoxData

Show the certificate chain :
Code:
openssl s_client -connect data.mtgox.com:443 -showcert
Copy&paste the 2 certs between the BEGIN CERT en END CERT lines in 2 files : StartComInterCA.pem and startComCA.pem

Added the chain cert to the CA java store:
Code:
keytool -keystore /usr/local/java/jre/lib/security/cacerts  -importcert -file StartComInterCA.pem -alias startComInterCA
keytool -keystore /usr/local/java/jre/lib/security/cacerts  -importcert -file startComCA.pem -alias startComCA

3) Succes !


Excellent work!  I'm glad it's working for you.


Title: Re: ATP [Advanced Trading Platform]
Post by: Simonsays on June 03, 2013, 04:32:04 PM
After a day of two tinkering, mainly do to my very limited Linux knowledge, I got AidoATP running on my Raspberry Pi  8)
My main steps, problems, solutions:

1) Java
I'm  using Raspbian hard float ABI witch made it a bit hard to find out Java.
I've used https://jdk8.java.net/fxarmpreview/  This is a beta of Java 8 for ARM processors but is running stable.
Move /java from my homedir to /usr/local
Added in PATH /usr/local/java/bin
Added JAVA_HOME=/usr/local/java/bin

2) Certificates
Downloaded the certificate for https://data.mtgox.com website
Code:
echo -n | openssl s_client -connect data.mtgox.com:443 |sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > mtgoxData.pem

Added the mtgox data cert to the java keystore
Code:
keytool -importcert -file mtgoxData.pem -alias mtgoxData

Show the certificate chain :
Code:
openssl s_client -connect data.mtgox.com:443 -showcert
Copy&paste the 2 certs between the BEGIN CERT en END CERT lines in 2 files : StartComInterCA.pem and startComCA.pem

Added the chain cert to the CA java store:
Code:
keytool -keystore /usr/local/java/jre/lib/security/cacerts  -importcert -file StartComInterCA.pem -alias startComInterCA
keytool -keystore /usr/local/java/jre/lib/security/cacerts  -importcert -file startComCA.pem -alias startComCA

3) Succes !


Having issues getting MtGox to allow access upon starting - for those that are Java-noobs like myself - suggestions? or is compatibility with MtGox have to wait till the next update?

Fixed:  Installed the cert located at http://codebistro.com/2010/03/25/adding-cacert-to-the-java-trusted-store/


Title: Re: ATP [Advanced Trading Platform]
Post by: Nova! on June 04, 2013, 04:16:14 AM
Should be out of the box compatible with MtGox.  You say issues, please elaborate preferably with a log or stack trace of some sort.
Also what did you do that before seeing the error?  Thanks!


Title: Re: ATP [Advanced Trading Platform]
Post by: Askit2 on June 04, 2013, 07:44:13 AM
I think this is the expected behavior. When I use MTGoX I get, regardless of the ticker polling interval, gaps of 1-5 minutes. I am not sure if there is no action for a while or if the ticker API doesn't actually respond often enough to my requests. I would assume the streaming ticker should get me data when it happens or at least close to it but there should be no way a windows sidebar tool updating every 60 seconds updates more frequently (including new prices) then the bot set to poll every 3,5,6,10,12,15,or 20 seconds. I would also guess streaming isn't working as expected as on the MTGoX site I am able to see a new price up on the ticker every few seconds.
Is anyone else seeing large gaps >1 minute with a polling interval of <20 seconds? I have it set at polling 12 and get 2 minute gaps frequently. Lower polling intervals do not make it update any more reliably. Higher then 20 has been untested by me. Possibly this is just me and has no influence on anyone elses setup.

I worry my tone may come across as irritated. I am a little irritated. AidoATP seems to work great. It reliably had ticker data on BTC-E. It couldn't trade at all but the ticker at least worked getting new data frequently and reliably. MTGoX seems less reliable.  The Cheap SSL cert adds a level of annoyance to get it setup. Once running the ticker flakes out and leaves me with a crashed or semi-running ATP. When I am lucky I get a new piece of market data every 30 seconds. Most of the time the data is at 1-3 minute intervals. When I say crashed I mean instead of ATP running I am staring at the command prompt. When I say semi-running I mean that most tickers die, refuse to update or are ignored from a point on and the only ones that survive have such limited data they can't or won't trade. I am not irritated at ATP itself or the kind staff that generously lets me use it. I have missed out on 4$ swings today because ATP never got polling data for the swing. Market was down at 120.7 (it shot up to about 124.5$) then dropped back slightly to my next ATP tick of 123.8. Bot correctly discerned given the trend it had (ignoring the steps it missed for 4 minutes) that the market was heading down. It was heading down at that tick. Sadly because it was heading down before the missing data no trade could occur. Had the data been transmitted correctly I am fairly sure the trend line would have switched to up and when the reversal happened I could have made money on it.

Is there a way to force either new data from MTGoX or to get more reliable market data to ATP?


Title: Re: ATP [Advanced Trading Platform]
Post by: Aido on June 04, 2013, 09:50:51 AM
Maybe a polling interval less than 30 seconds is too small. Just a theory but if you are constantly hitting MtGox at 5 or 10 second intervals they may see you as a DDOS attack and strange things may happen. Try setting it to 30 seconds and see if it's more reliable. In a previous version of AidoATP I had the streaming ticker working but had to switch back to a polling ticker because of a bug in the streaming library used by XChange. This bug has now been fixed but consequently XChange has totally changed how a streaming ticker is coded and I have not updated AidoATP to account for this. It's been on my todo list for a while now.


Title: Re: ATP [Advanced Trading Platform]
Post by: Askit2 on June 04, 2013, 06:34:53 PM
Here is what actually makes it in the log. Sadly the console puts out a ton more data. I wish I had it logged but as I was not watching when it went belly up I didn't capture it.

Code:
2013-06-04 00:41:10,745 : ERROR org.aido.atp.TickerManager [Thread-1] - ERROR: Caught unexpected MtGox exception, ticker manager shutting down now!. Details are listed below.

Below isn't more data just the tickers for the non USD currency. So it's been down about 12 hours for USD.

EDIT: I will try 30 seconds. It can't be worse then 1-5 minutes.

EDIT2: I used your settings for a flat market from the other thread so I had started with a polling interval of 15 seconds. When the data was slow I thought maybe if it checked more often when the data was available at least I would get new data closer to the drop out. I later had considered that if I polled too often maybe they where actually blocking me to punish me for too many requests. Thus I went up to 20 seconds. I didn't think 3X a minute would be overloading anything but maybe they don't allow that much.

Code:
2013-06-04 15:15:13,020 ←[34m:←[0;39m MtGox High EUR :-  Last: EUR 95.00000 | Bid: EUR 94.00000 | Ask: EUR 95.00000 | Volume: 4509
 | Currency: BTC | TimeStamp: Tue Jun 04 14:05:15 MDT 2013
2013-06-04 15:15:13,022 ←[34m:←[0;39m MtGox Low EUR :-  Last: EUR 93.50000 | Bid: EUR 93.40000 | Ask: EUR 94.99000 | Volume: 4433
| Currency: BTC | TimeStamp: Tue Jun 04 15:05:32 MDT 2013
2013-06-04 15:15:13,025 ←[34m:←[0;39m MtGox Current EUR :-  Last: EUR 94.79000 | Bid: EUR 93.69000 | Ask: EUR 94.79000 | Volume: 4
429 | Currency: BTC | TimeStamp: Tue Jun 04 15:15:08 MDT 2013
2013-06-04 15:15:13,041 ←[34m:←[0;39m MtGox EUR Ticker Size: 37
2013-06-04 15:15:13,054 ←[34m:←[0;39m MtGox VWAP Cross algorithm has determined that the EUR market is trending down.
2013-06-04 15:15:13,087 ←[34m:←[0;39m Used High risk algorithm to calculate weight of 0.08108108108108109
2013-06-04 15:15:13,334 ←[34m:←[0;39m BTC 0.00368800 was less than the configured limit of BTC 0.01
2013-06-04 15:15:13,336 ←[34m:←[0;39m MtGox Trend following trade agent has decided that there is not enough EUR momentum to trade
 at this time.
2013-06-04 15:16:13,308 ←[34m:←[0;39m MtGox GBP Ticker size: 13. Trend observer does not currently have enough GBP data to determi
ne trend.
2013-06-04 15:16:13,347 ←[34m:←[0;39m MtGox High GBP :-  Last: GBP 79.60000 | Bid: GBP 78.42148 | Ask: GBP 79.60000 | Volume: 338
| Currency: BTC | TimeStamp: Tue Jun 04 14:59:37 MDT 2013
2013-06-04 15:16:13,351 ←[34m:←[0;39m MtGox Low GBP :-  Last: GBP 77.69690 | Bid: GBP 77.92599 | Ask: GBP 79.60000 | Volume: 431 |
 Currency: BTC | TimeStamp: Tue Jun 04 15:05:06 MDT 2013
2013-06-04 15:16:13,354 ←[34m:←[0;39m MtGox Current GBP :-  Last: GBP 77.69690 | Bid: GBP 78.11364 | Ask: GBP 79.59000 | Volume: 4
20 | Currency: BTC | TimeStamp: Tue Jun 04 15:15:58 MDT 2013
2013-06-04 15:16:13,444 ←[34m:←[0;39m MtGox High USD :-  Last: USD 121.77698 | Bid: USD 120.55603 | Ask: USD 121.77698 | Volume: 2
4603 | Currency: BTC | TimeStamp: Tue Jun 04 13:57:26 MDT 2013
2013-06-04 15:16:13,447 ←[34m:←[0;39m MtGox Low USD :-  Last: USD 120.00000 | Bid: USD 119.96213 | Ask: USD 120.01212 | Volume: 24
535 | Currency: BTC | TimeStamp: Tue Jun 04 13:48:41 MDT 2013
2013-06-04 15:16:13,472 ←[34m:←[0;39m MtGox Current USD :-  Last: USD 121.38493 | Bid: USD 121.38488 | Ask: USD 121.38493 | Volume
: 23021 | Currency: BTC | TimeStamp: Tue Jun 04 15:15:14 MDT 2013
2013-06-04 15:16:13,496 ←[34m:←[0;39m MtGox USD Ticker Size: 56
2013-06-04 15:16:13,501 ←[34m:←[0;39m MtGox VWAP Cross algorithm has determined that the USD market is trending up.
2013-06-04 15:16:13,521 ←[34m:←[0;39m Used High risk algorithm to calculate weight of 0.125
2013-06-04 15:16:13,758 ←[34m:←[0;39m BTC 0.00697909 was less than the configured limit of BTC 0.01
2013-06-04 15:16:13,763 ←[34m:←[0;39m Trend following trade agent has decided that there is not enough USD momentum to trade at th
is time.
2013-06-04 15:19:45,591 ←[34m:←[0;39m MtGox High USD :-  Last: USD 121.77698 | Bid: USD 120.55603 | Ask: USD 121.77698 | Volume: 2
4603 | Currency: BTC | TimeStamp: Tue Jun 04 13:57:26 MDT 2013
2013-06-04 15:19:45,594 ←[34m:←[0;39m MtGox Low USD :-  Last: USD 120.00254 | Bid: USD 120.00255 | Ask: USD 120.99990 | Volume: 25
041 | Currency: BTC | TimeStamp: Tue Jun 04 14:02:27 MDT 2013
2013-06-04 15:19:45,599 ←[34m:←[0;39m MtGox Current USD :-  Last: USD 121.38393 | Bid: USD 121.38389 | Ask: USD 121.38393 | Volume
: 22987 | Currency: BTC | TimeStamp: Tue Jun 04 15:19:24 MDT 2013
2013-06-04 15:19:45,607 ←[34m:←[0;39m MtGox USD Ticker Size: 52
2013-06-04 15:19:45,637 ←[34m:←[0;39m MtGox VWAP Cross algorithm has determined that the USD market is trending up.
2013-06-04 15:19:45,648 ←[34m:←[0;39m Used High risk algorithm to calculate weight of 0.057692307692307696
2013-06-04 15:19:45,928 ←[34m:←[0;39m BTC 0.00322112 was less than the configured limit of BTC 0.01
2013-06-04 15:19:45,931 ←[34m:←[0;39m Trend following trade agent has decided that there is not enough USD momentum to trade at th
is time.


Title: Re: ATP [Advanced Trading Platform]
Post by: nii236 on June 04, 2013, 08:48:05 PM
Getting a strange error. All the API keys are set up and I'm running in simulation mode. It was working at first until it collected enough ticker data then it started to display all of these errors. Anyone have any idea what's wrong?

Code:
PS C:\nii\Bitcoin\AidoATP-master\bin> java -jar .\aidoatp.jar --simulation-mode=true
20:45:47,000 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
20:45:47,000 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
20:45:47,000 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [jar:file:/C:/Nii/Bitcoin/AidoATP-master/bin/aidoatp.jar!/logback.xml]
20:45:47,013 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@17a220d7 - URL [jar:file:/C:/Nii/Bitcoin/AidoATP-master/bin/aidoatp.jar!/logback.xml] is not of type file
20:45:47,052 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
20:45:47,060 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
20:45:47,067 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
20:45:47,094 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
20:45:47,138 |-INFO in ch.qos.logback.core.ConsoleAppender[STDOUT] - Enabling JANSI WindowsAnsiOutputStream for the console.
20:45:47,139 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - Failed to create WindowsAnsiOutputStream. Falling back on the default stream. ch.qos.logback.core.util.DynamicClassLoadingException
: Failed to instantiate type org.fusesource.jansi.WindowsAnsiOutputStream
        at ch.qos.logback.core.util.DynamicClassLoadingException: Failed to instantiate type org.fusesource.jansi.WindowsAnsiOutputStream
        at      at ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:73)
        at      at ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:42)
        at      at ch.qos.logback.core.ConsoleAppender.getTargetStreamForWindows(ConsoleAppender.java:94)
        at      at ch.qos.logback.core.ConsoleAppender.start(ConsoleAppender.java:85)
        at      at ch.qos.logback.core.joran.action.AppenderAction.end(AppenderAction.java:96)
        at      at ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Interpreter.java:317)
        at      at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:196)
        at      at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:182)
        at      at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:62)
        at      at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:149)
        at      at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:135)
        at      at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:99)
        at      at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:49)
        at      at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75)
        at      at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:148)
        at      at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85)
        at      at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
        at      at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128)
        at      at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:107)
        at      at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:295)
        at      at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:269)
        at      at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:281)
        at      at org.aido.atp.Application.<init>(Application.java:54)
        at      at org.aido.atp.Application.getInstance(Application.java:67)
        at      at org.aido.atp.Application.main(Application.java:75)
Caused by: java.lang.ClassNotFoundException: org.fusesource.jansi.WindowsAnsiOutputStream
        at      at java.net.URLClassLoader$1.run(Unknown Source)
        at      at java.net.URLClassLoader$1.run(Unknown Source)
        at      at java.security.AccessController.doPrivileged(Native Method)
        at      at java.net.URLClassLoader.findClass(Unknown Source)
        at      at java.lang.ClassLoader.loadClass(Unknown Source)
        at      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at      at java.lang.ClassLoader.loadClass(Unknown Source)
        at      at ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:60)
        at      ... 24 common frames omitted
20:45:47,139 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
20:45:47,141 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [FILE]
20:45:47,156 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@315b5b68 - Will use gz compression
20:45:47,162 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
20:45:47,164 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - Active log file name: aidoatp.log
20:45:47,164 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - File property is set to [aidoatp.log]
20:45:47,165 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.xeiam.xchange] to WARN
20:45:47,166 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [si.mazi.rescu] to WARN
20:45:47,166 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to DEBUG
20:45:47,166 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [FILE] to Logger[ROOT]
20:45:47,166 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
20:45:47,166 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
20:45:47,167 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@64ce2228 - Registering current configuration as safe fallback point

2013-06-04 20:45:47,220 ←[34m:←[0;39m Aido ATP has started successfully
2013-06-04 20:45:47,223 ←[34m:←[0;39m Entering simulation mode. Trades will not be executed.
2013-06-04 20:45:47,223 ←[34m:←[0;39m Using trend following to decide some trades.
2013-06-04 20:45:47,553 ←[34m:←[0;39m Connecting to BTC-e Exchange
2013-06-04 20:45:47,553 ←[34m:←[0;39m Connecting to MtGox Exchange
2013-06-04 20:45:49,039 ←[34m:←[0;39m BTC-e AccountInfo as String: AccountInfo [username=null, wallets=[Wallet [currency=USD, balance=USD 0], Wallet [currency=RUR, balance=RUR 0], Wallet [currency=EUR
, balance=EUR 0], Wallet [currency=BTC, balance=BTC 0], Wallet [currency=LTC, balance=LTC 0], Wallet [currency=NMC, balance=NMC 0], Wallet [currency=NVC, balance=NVC 0], Wallet [currency=TRC, balance=
TRC 0], Wallet [currency=PPC, balance=PPC 0], Wallet [currency=FTC, balance=FTC 0], Wallet [currency=CNC, balance=CNC 0]]]
2013-06-04 20:45:49,342 ←[34m:←[0;39m Attempting to open market data file C:\nii\Bitcoin\AidoATP-master\bin/BTC-e_USD.dat
2013-06-04 20:45:49,364 ←[34m:←[0;39m Attempting to open market data file C:\nii\Bitcoin\AidoATP-master\bin/BTC-e_RUR.dat
2013-06-04 20:45:49,369 ←[34m:←[0;39m Attempting to open market data file C:\nii\Bitcoin\AidoATP-master\bin/BTC-e_EUR.dat
2013-06-04 20:45:49,485 ←[34m:←[0;39m MtGox AccountInfo as String: AccountInfo [username=nii236, wallets=[Wallet [currency=BTC, balance=BTC 0.00000000], Wallet [currency=USD, balance=USD 0.00000], Wal
let [currency=AUD, balance=AUD 0.00000]]]
2013-06-04 20:45:49,744 ←[34m:←[0;39m BTC-e High USD :-  Last: USD 119.765 | Bid: USD 119.3 | Ask: USD 119.765 | Volume: 3736 | Currency: BTC | TimeStamp: Tue Jun 04 20:38:04 UTC 2013
2013-06-04 20:45:49,745 ←[34m:←[0;39m BTC-e Low USD :-  Last: USD 119.3 | Bid: USD 119.3 | Ask: USD 119.765 | Volume: 3725 | Currency: BTC | TimeStamp: Tue Jun 04 20:40:39 UTC 2013
2013-06-04 20:45:49,749 ←[34m:←[0;39m BTC-e Current USD :-  Last: USD 119.3 | Bid: USD 119.4 | Ask: USD 119.759 | Volume: 3724 | Currency: BTC | TimeStamp: Tue Jun 04 20:45:48 UTC 2013
2013-06-04 20:45:49,758 ←[34m:←[0;39m BTC-e USD Ticker Size: 20
2013-06-04 20:45:49,811 ←[1;31m:←[0;39m ERROR: Caught unexpected exception, shutting down BTC-e trend following trading agent now!. Details are listed below.
org.codehaus.commons.compiler.CompileException: Line 0, Column 0: Unexpected token "End-Of-File" in primary
        at org.codehaus.janino.Parser.throwCompileException(Parser.java:2593)
        at org.codehaus.janino.Parser.parsePrimary(Parser.java:2163)
        at org.codehaus.janino.Parser.parseUnaryExpression(Parser.java:1886)
        at org.codehaus.janino.Parser.parseMultiplicativeExpression(Parser.java:1846)
        at org.codehaus.janino.Parser.parseAdditiveExpression(Parser.java:1826)
        at org.codehaus.janino.Parser.parseShiftExpression(Parser.java:1806)
        at org.codehaus.janino.Parser.parseRelationalExpression(Parser.java:1774)
        at org.codehaus.janino.Parser.parseEqualityExpression(Parser.java:1751)
        at org.codehaus.janino.Parser.parseAndExpression(Parser.java:1730)
        at org.codehaus.janino.Parser.parseExclusiveOrExpression(Parser.java:1709)
        at org.codehaus.janino.Parser.parseInclusiveOrExpression(Parser.java:1688)
        at org.codehaus.janino.Parser.parseConditionalAndExpression(Parser.java:1667)
        at org.codehaus.janino.Parser.parseConditionalOrExpression(Parser.java:1646)
        at org.codehaus.janino.Parser.parseConditionalExpression(Parser.java:1627)
        at org.codehaus.janino.Parser.parseAssignmentExpression(Parser.java:1607)
        at org.codehaus.janino.Parser.parseExpression(Parser.java:1593)
        at org.codehaus.janino.ExpressionEvaluator.makeStatements(ExpressionEvaluator.java:255)
        at org.codehaus.janino.ScriptEvaluator.cook(ScriptEvaluator.java:454)
        at org.codehaus.janino.ScriptEvaluator.cook(ScriptEvaluator.java:345)
        at org.codehaus.janino.SimpleCompiler.cook(SimpleCompiler.java:194)
        at org.codehaus.commons.compiler.Cookable.cook(Cookable.java:80)
        at org.codehaus.commons.compiler.Cookable.cook(Cookable.java:72)
        at org.codehaus.janino.ExpressionEvaluator.<init>(ExpressionEvaluator.java:100)
        at org.aido.atp.TrendTradingAgent.evalLogic(TrendTradingAgent.java:626)
        at org.aido.atp.TrendTradingAgent.run(TrendTradingAgent.java:343)
        at java.lang.Thread.run(Unknown Source)
2013-06-04 20:45:49,906 ←[1;31m:←[0;39m ERROR: Caught unexpected exception, shutting down BTC-e trend following trading agent now!. Details are listed below.
org.codehaus.commons.compiler.CompileException: Line 0, Column 0: Unexpected token "End-Of-File" in primary
        at org.codehaus.janino.Parser.throwCompileException(Parser.java:2593)
        at org.codehaus.janino.Parser.parsePrimary(Parser.java:2163)
        at org.codehaus.janino.Parser.parseUnaryExpression(Parser.java:1886)
        at org.codehaus.janino.Parser.parseMultiplicativeExpression(Parser.java:1846)
        at org.codehaus.janino.Parser.parseAdditiveExpression(Parser.java:1826)
        at org.codehaus.janino.Parser.parseShiftExpression(Parser.java:1806)
        at org.codehaus.janino.Parser.parseRelationalExpression(Parser.java:1774)
        at org.codehaus.janino.Parser.parseEqualityExpression(Parser.java:1751)
        at org.codehaus.janino.Parser.parseAndExpression(Parser.java:1730)
        at org.codehaus.janino.Parser.parseExclusiveOrExpression(Parser.java:1709)
        at org.codehaus.janino.Parser.parseInclusiveOrExpression(Parser.java:1688)
        at org.codehaus.janino.Parser.parseConditionalAndExpression(Parser.java:1667)
        at org.codehaus.janino.Parser.parseConditionalOrExpression(Parser.java:1646)
        at org.codehaus.janino.Parser.parseConditionalExpression(Parser.java:1627)
        at org.codehaus.janino.Parser.parseAssignmentExpression(Parser.java:1607)
        at org.codehaus.janino.Parser.parseExpression(Parser.java:1593)
        at org.codehaus.janino.ExpressionEvaluator.makeStatements(ExpressionEvaluator.java:255)
        at org.codehaus.janino.ScriptEvaluator.cook(ScriptEvaluator.java:454)
        at org.codehaus.janino.ScriptEvaluator.cook(ScriptEvaluator.java:345)
        at org.codehaus.janino.SimpleCompiler.cook(SimpleCompiler.java:194)
        at org.codehaus.commons.compiler.Cookable.cook(Cookable.java:80)
        at org.codehaus.commons.compiler.Cookable.cook(Cookable.java:72)
        at org.codehaus.janino.ExpressionEvaluator.<init>(ExpressionEvaluator.java:100)
        at org.aido.atp.TrendTradingAgent.evalLogic(TrendTradingAgent.java:626)
        at org.aido.atp.TrendTradingAgent.run(TrendTradingAgent.java:345)
        at java.lang.Thread.run(Unknown Source)
2013-06-04 20:45:50,018 ←[34m:←[0;39m BTC-e Trend following trading agent has decided no USD action will be taken at this time.
2013-06-04 20:45:50,432 ←[34m:←[0;39m BTC-e EUR Ticker size: 7. Trend observer does not currently have enough EUR data to determine trend.
2013-06-04 20:45:50,438 ←[34m:←[0;39m BTC-e High EUR :-  Last: EUR 93.704 | Bid: EUR 93.704 | Ask: EUR 94.29399 | Volume: 53 | Currency: BTC | TimeStamp: Tue Jun 04 20:15:29 UTC 2013
2013-06-04 20:45:50,438 ←[34m:←[0;39m BTC-e Low EUR :-  Last: EUR 93.704 | Bid: EUR 93.704 | Ask: EUR 94.29399 | Volume: 53 | Currency: BTC | TimeStamp: Tue Jun 04 20:15:29 UTC 2013
2013-06-04 20:45:50,439 ←[34m:←[0;39m BTC-e Current EUR :-  Last: EUR 93.704 | Bid: EUR 93.704 | Ask: EUR 94.29399 | Volume: 48 | Currency: BTC | TimeStamp: Tue Jun 04 20:45:49 UTC 2013
2013-06-04 20:45:50,529 ←[34m:←[0;39m Attempting to open market data file C:\nii\Bitcoin\AidoATP-master\bin/MtGox_USD.dat
2013-06-04 20:45:50,536 ←[34m:←[0;39m Attempting to open market data file C:\nii\Bitcoin\AidoATP-master\bin/MtGox_AUD.dat
2013-06-04 20:45:50,754 ←[34m:←[0;39m MtGox High USD :-  Last: USD 121.49991 | Bid: USD 121.00004 | Ask: USD 121.49991 | Volume: 24802 | Currency: BTC | TimeStamp: Tue Jun 04 20:32:35 UTC 2013
2013-06-04 20:45:50,755 ←[34m:←[0;39m MtGox Low USD :-  Last: USD 120.00101 | Bid: USD 120.00104 | Ask: USD 120.99981 | Volume: 24930 | Currency: BTC | TimeStamp: Tue Jun 04 20:22:33 UTC 2013
2013-06-04 20:45:50,761 ←[34m:←[0;39m MtGox Current USD :-  Last: USD 121.49889 | Bid: USD 121.00001 | Ask: USD 121.49888 | Volume: 24433 | Currency: BTC | TimeStamp: Tue Jun 04 20:45:06 UTC 2013
2013-06-04 20:45:50,766 ←[34m:←[0;39m MtGox USD Ticker Size: 26
2013-06-04 20:45:50,770 ←[1;31m:←[0;39m ERROR: Caught unexpected exception, shutting down MtGox trend following trading agent now!. Details are listed below.
org.codehaus.commons.compiler.CompileException: Line 0, Column 0: Unexpected token "End-Of-File" in primary
        at org.codehaus.janino.Parser.throwCompileException(Parser.java:2593)
        at org.codehaus.janino.Parser.parsePrimary(Parser.java:2163)
        at org.codehaus.janino.Parser.parseUnaryExpression(Parser.java:1886)
2013-06-04 20:45:50,788 ←[34m:←[0;39m BTC-e RUR Ticker size: 13. Trend observer does not currently have enough RUR data to determine trend.
        at org.codehaus.janino.Parser.parseMultiplicativeExpression(Parser.java:1846)
        at org.codehaus.janino.Parser.parseAdditiveExpression(Parser.java:1826)
        at org.codehaus.janino.Parser.parseShiftExpression(Parser.java:1806)
        at org.codehaus.janino.Parser.parseRelationalExpression(Parser.java:1774)
        at org.codehaus.janino.Parser.parseEqualityExpression(Parser.java:1751)2013-06-04 20:45:50,802 ←[34m:←[0;39m BTC-e High RUR :-  Last: RUR 3705 | Bid: RUR 3705 | Ask: RUR 3719.9986 | Volume: 35
9 | Currency: BTC | TimeStamp: Tue Jun 04 20:15:30 UTC 2013

2013-06-04 20:45:50,814 ←[34m:←[0;39m BTC-e Low RUR :-  Last: RUR 3705 | Bid: RUR 3705 | Ask: RUR 3719.9986 | Volume: 359 | Currency: BTC | TimeStamp: Tue Jun 04 20:15:30 UTC 2013
        at org.codehaus.janino.Parser.parseAndExpression(Parser.java:1730)2013-06-04 20:45:50,822 ←[34m:←[0;39m BTC-e Current RUR :-  Last: RUR 3705 | Bid: RUR 3710 | Ask: RUR 3719.996 | Volume: 349 |
 Currency: BTC | TimeStamp: Tue Jun 04 20:45:49 UTC 2013

        at org.codehaus.janino.Parser.parseExclusiveOrExpression(Parser.java:1709)
        at org.codehaus.janino.Parser.parseInclusiveOrExpression(Parser.java:1688)
        at org.codehaus.janino.Parser.parseConditionalAndExpression(Parser.java:1667)
        at org.codehaus.janino.Parser.parseConditionalOrExpression(Parser.java:1646)
        at org.codehaus.janino.Parser.parseConditionalExpression(Parser.java:1627)
        at org.codehaus.janino.Parser.parseAssignmentExpression(Parser.java:1607)
        at org.codehaus.janino.Parser.parseExpression(Parser.java:1593)
        at org.codehaus.janino.ExpressionEvaluator.makeStatements(ExpressionEvaluator.java:255)
        at org.codehaus.janino.ScriptEvaluator.cook(ScriptEvaluator.java:454)
        at org.codehaus.janino.ScriptEvaluator.cook(ScriptEvaluator.java:345)
        at org.codehaus.janino.SimpleCompiler.cook(SimpleCompiler.java:194)
        at org.codehaus.commons.compiler.Cookable.cook(Cookable.java:80)
        at org.codehaus.commons.compiler.Cookable.cook(Cookable.java:72)
        at org.codehaus.janino.ExpressionEvaluator.<init>(ExpressionEvaluator.java:100)
        at org.aido.atp.TrendTradingAgent.evalLogic(TrendTradingAgent.java:626)
        at org.aido.atp.TrendTradingAgent.run(TrendTradingAgent.java:343)
        at java.lang.Thread.run(Unknown Source)
2013-06-04 20:45:50,890 ←[1;31m:←[0;39m ERROR: Caught unexpected exception, shutting down MtGox trend following trading agent now!. Details are listed below.
org.codehaus.commons.compiler.CompileException: Line 0, Column 0: Unexpected token "End-Of-File" in primary
        at org.codehaus.janino.Parser.throwCompileException(Parser.java:2593)
        at org.codehaus.janino.Parser.parsePrimary(Parser.java:2163)
        at org.codehaus.janino.Parser.parseUnaryExpression(Parser.java:1886)
        at org.codehaus.janino.Parser.parseMultiplicativeExpression(Parser.java:1846)
        at org.codehaus.janino.Parser.parseAdditiveExpression(Parser.java:1826)
        at org.codehaus.janino.Parser.parseShiftExpression(Parser.java:1806)
        at org.codehaus.janino.Parser.parseRelationalExpression(Parser.java:1774)
        at org.codehaus.janino.Parser.parseEqualityExpression(Parser.java:1751)
        at org.codehaus.janino.Parser.parseAndExpression(Parser.java:1730)
        at org.codehaus.janino.Parser.parseExclusiveOrExpression(Parser.java:1709)
        at org.codehaus.janino.Parser.parseInclusiveOrExpression(Parser.java:1688)
        at org.codehaus.janino.Parser.parseConditionalAndExpression(Parser.java:1667)
        at org.codehaus.janino.Parser.parseConditionalOrExpression(Parser.java:1646)
        at org.codehaus.janino.Parser.parseConditionalExpression(Parser.java:1627)
        at org.codehaus.janino.Parser.parseAssignmentExpression(Parser.java:1607)
        at org.codehaus.janino.Parser.parseExpression(Parser.java:1593)
        at org.codehaus.janino.ExpressionEvaluator.makeStatements(ExpressionEvaluator.java:255)
        at org.codehaus.janino.ScriptEvaluator.cook(ScriptEvaluator.java:454)
        at org.codehaus.janino.ScriptEvaluator.cook(ScriptEvaluator.java:345)
        at org.codehaus.janino.SimpleCompiler.cook(SimpleCompiler.java:194)
        at org.codehaus.commons.compiler.Cookable.cook(Cookable.java:80)
        at org.codehaus.commons.compiler.Cookable.cook(Cookable.java:72)
        at org.codehaus.janino.ExpressionEvaluator.<init>(ExpressionEvaluator.java:100)
        at org.aido.atp.TrendTradingAgent.evalLogic(TrendTradingAgent.java:626)
        at org.aido.atp.TrendTradingAgent.run(TrendTradingAgent.java:345)
        at java.lang.Thread.run(Unknown Source)
2013-06-04 20:45:50,990 ←[34m:←[0;39m MtGox Trend following trading agent has decided no USD action will be taken at this time.
2013-06-04 20:45:51,079 ←[34m:←[0;39m MtGox AUD Ticker size: 11. Trend observer does not currently have enough AUD data to determine trend.
2013-06-04 20:45:51,088 ←[34m:←[0;39m MtGox High AUD :-  Last: AUD 127.00000 | Bid: AUD 125.01000 | Ask: AUD 126.99000 | Volume: 909 | Currency: BTC | TimeStamp: Tue Jun 04 20:13:00 UTC 2013
2013-06-04 20:45:51,088 ←[34m:←[0;39m MtGox Low AUD :-  Last: AUD 126.99000 | Bid: AUD 126.99000 | Ask: AUD 127.00000 | Volume: 906 | Currency: BTC | TimeStamp: Tue Jun 04 20:32:25 UTC 2013
2013-06-04 20:45:51,090 ←[34m:←[0;39m MtGox Current AUD :-  Last: AUD 126.99000 | Bid: AUD 126.99000 | Ask: AUD 127.00000 | Volume: 910 | Currency: BTC | TimeStamp: Tue Jun 04 20:45:26 UTC 2013

Thanks in advance!


Title: Re: ATP [Advanced Trading Platform]
Post by: Aido on June 04, 2013, 09:14:51 PM
OK. there's a few things going on here.

I think you may be using Windows and the logback errors stem from that.

This is just a guess but it may be related to the coloured logback output not working correctly on Windows:

See Coloring section here: http://logback.qos.ch/manual/layouts.html

and line 6 of AidoATP's logback.xml: https://github.com/aido/AidoATP/blob/master/src/main/resources/logback.xml#L6

But this is more of an annoyance than a real problem.

I have done very little (read none) testing of AidoATP on Windows. Sorry.



The other error is more serious.

I am willing to bet that it is a problem with your trading logic. Have a look at you config and I think you'll find a misspelling or rogue character in there somewhere. This error was reported a few times in the other thread e.g. https://bitcointalk.org/index.php?topic=109831.msg1507782#msg1507782 (https://bitcointalk.org/index.php?topic=109831.msg1507782#msg1507782)

Actually, having a second thread started off as a good idea, now it's just annoying.


Title: Re: ATP [Advanced Trading Platform]
Post by: nii236 on June 04, 2013, 09:40:03 PM
Thanks! That did the trick. What is the status of the arbitrage bot? I had a look through the thread and the last mention of it was a recommendation to disable it. Is this still the case?

Does the arbitrage calculate opportunities between exchanges, or just between currencies on a single exchange?


Title: Re: ATP [Advanced Trading Platform]
Post by: Simonsays on June 04, 2013, 09:50:23 PM
Does the arbitrage calculate opportunities between exchanges, or just between currencies on a single exchange?

I am certain it is inner-exchange only.  Logistically it would be much more difficult to set up a reliable arbitrage between exchanges.  Even doing it manually the process is plagued with roadblocks and long transfer times.



Title: Re: ATP [Advanced Trading Platform]
Post by: nii236 on June 04, 2013, 10:07:44 PM
Well you could have an arbitrage opportunity but have reserves ready on either exchange. Then you could execute the trade and then pool the profits later?

ALARM!ALARM! - Should I be freaking out that my API key and Secret is stored in plaintext in the registry?


Title: Re: ATP [Advanced Trading Platform]
Post by: Aido on June 04, 2013, 11:40:34 PM
ALARM!ALARM! - Should I be freaking out that my API key and Secret is stored in plaintext in the registry?

Another thing on my todo list (https://github.com/aido/AidoATP/blob/master/TODO).


Title: Re: ATP [Advanced Trading Platform]
Post by: nii236 on June 05, 2013, 05:48:51 AM
So my recommendation is to trade a wallet of currencies you are interested in and that move with each-other;  It opens opportunities you otherwise would not have.

How do I choose which currencies to work in? For example I might be interested in AUD, USD and EUR, but not RUR. How do I tell the bot not to touch the BTCRUR market on BTC-e?

I'm currently looking towards using VWAP_Cross_Up and VWAP_Cross_Down. Does VWAP_Cross_Up mean the last price is above the VWAP or below the VWAP?

I'm trying to implement this from the readme:

Code:
If trend = down & last < VWAP then buy
If trend = up & last > VWAP then sell

But from the readme, I can't use these exact terms. For instance, the "if", and "<", and "then" operators are not listed as supported in the readme.

I'm thinking of this:

Code:
Bid Logic: (ADS_Up && EMA_Down && SMA_Down) && VWAP_Cross_Down
Ask Logic: (ADS_Down && EMA_Up && SMA_Up) && VWAP_Cross_Up

Or does VWAP_Cross_Up and VWAP_Cross_Down already take into account the market trend? So the proper answer would be:
Code:
Bid Logic: VWAP_Cross_Down
Ask Logic: VWAP_Cross_Up


Title: Re: ATP [Advanced Trading Platform]
Post by: Simonsays on June 05, 2013, 07:08:52 AM
Working with the preferences - and I have a few high level comments/questions

MACD and EMA are both good indicators for the 'greater' trend - history shows, to me at least, good trend prediction from MACD 9 on short12 and long26 plots - however, the time interval between datapoints needs to be roughly 30mins or greater to capture the trend. With this method you substantially sacrifice reaction time.  Shorter lengths - say 30sec-5 minutes fill up the 9, 12 and 26 sample buffers too quickly - especially when the market is this flat.  You end up with a 5-30 minute window to show an MACD trend - when I would think you would want a longer time interval.  Am I thinking right here?  I suppose I do not understand how a short polling interval (the suggested 15-60seconds) is a viable setting for EMA or MACD trending.

My next question is regarding the VWAPCross algorithm.   How does the polling interval and maximum ticker age affect results.   It seems to me that a short ticker time would react faster to the market, but yield riskier trades.  Conversely a longer ticker age is affected less by a coming trend since it allows more samples - and potentially misses a trend altogether and trades too late.

IS my train of thought in the right direction here? 

I let ATP run in live mode using only VWAPCross - with the preferences suggested by Nova previously.  I found trades to be too frequent and got eaten up by fees.  I think a more complex logic is necessary - but am finding that MACD at the same 30s polling interval can swap between 'up' and 'down' back to back quite often.



Title: Re: ATP [Advanced Trading Platform]
Post by: nii236 on June 05, 2013, 07:11:34 AM
I let ATP run in live mode using only VWAPCross - with the preferences suggested by Nova previously.  I found trades to be too frequent and got eaten up by fees.  I think a more complex logic is necessary - but am finding that MACD at the same 30s polling interval can swap between 'up' and 'down' back to back quite often.

What are your Bid Logic/Ask Logic settings for VWAPCross?


Title: Re: ATP [Advanced Trading Platform]
Post by: Simonsays on June 05, 2013, 07:23:30 AM

What are your Bid Logic/Ask Logic settings for VWAPCross?

Bid:  VWAPCross_Up
Ask  VWAPCross_Down
Polling Interval: 30 sec
Min BTC/Trade: 0.01
Mas BTC/Trade: 0.1
Min Currency: 1
Max Currency: 10
Minimum ticker size for trend following trade decisions: 24
Maximum ticker age for trend following trade decisions (in minutes): 90
Number of ticks used to calculate short Moving Average: 25
Number of ticks used to calculate short Moving Average Convergence-Divergence: 12
Number of ticks used to calculate long Moving Average Convergence-Divergence: 26
Number of MACD values used to calculate MACD Signal Line: 9


Title: Re: ATP [Advanced Trading Platform]
Post by: nii236 on June 05, 2013, 09:34:33 AM
Quote
Bid:  VWAPCross_Up
Ask  VWAPCross_Down

Are you sure this is correct? I think it should be the other way around.

The readme says this:
Quote
Market Trending Down = Look at buying
Market Trending Up = Look at selling

In order for the bot to do this, you need the logic to be thus:

Code:
Bid:  VWAPCross_Down
Ask  VWAPCross_Up


Title: Re: ATP [Advanced Trading Platform]
Post by: Simonsays on June 05, 2013, 02:46:12 PM
Well don't I feel silly!

That might do the trick - running now.


Title: Re: ATP [Advanced Trading Platform]
Post by: nii236 on June 05, 2013, 03:56:06 PM
No problem! It took me absolutely ages to work it out. It goes against the typical mentality of "Buy low, sell high". The readme basically says "when the market is falling, buy and when the market is rising, sell". Which also doesn't make sense.

After reading the readme for ages and doing some further reading, I think:

"Market trending up" means the last price is higher than the VWAP, so you sell.
"Market trending down" means  the last price is lower than the VWAP, so you buy.
"Market trending flat" means last price is equal to the VWAP, so you don't do anything.

I think this is because the price always tends towards the VWAP, so as the last price oscillates above and below it the VWAP cross attempts to take advantage of that.

I have no idea though, this is just a guess.


Title: Re: ATP [Advanced Trading Platform]
Post by: Aido on June 05, 2013, 06:38:10 PM
You are all confusing me now  ???

This may explain it better than I can:

http://www.investopedia.com/terms/v/vwap-cross.asp (http://www.investopedia.com/terms/v/vwap-cross.asp)



Title: Re: ATP [Advanced Trading Platform]
Post by: Askit2 on June 05, 2013, 06:54:55 PM
The logic is more like this:
As the market heads up you wait.
When it starts down you look at selling (Sell high).
When the market stops going down and starts going up you look at buying
Buy Low.
It could work the opposite way too market starts heading down. When it changes to up look at buying. When that trend reverses and market starts down look at selling.


Title: Re: ATP [Advanced Trading Platform]
Post by: nii236 on June 05, 2013, 07:45:15 PM
Yes but it was the definitions of VWAPCross_Up and VWAPCross_Down that was confusing. What ARE they? The Investopedia article doesn't reference those terms.

From the readme:

Code:
Volume Participation algorithm (VWAP Cross)

The trend observer functionality constantly monitors the market for trends. A combination of the Advance/Decline Spread, SMA and EMA algorithms decide what way the market is trending.

Market Trending Down = Look at buying
Market Trending Up = Look at selling
Once it is decided the trend is up (ask) or down (bid) it then compares the last transaction to the VWAP.

The ratio of last price versus VWAP is used as a waterline to make the final determination that we will take an action.

If trend = down & last < VWAP then buy
If trend = up & last > VWAP then sell

So what IS it? Does VWAPCross_Up mean? What does the "up" refer to? Could it be:

1. A combination of Advance/Decline Spread, SMA and EMA algorithms which suggest the market is trending up?
1a. ADS up, SMA and EMA down
1b. ADS up, SMA up, EMA up
2. Trend = down & Last < VWAP (meaning VWAP crossing UP above Last)
3. Trend = up & Last > VWAP (meaning Last crossing UP above VWAP)
4. Last < VWAP? Meaning you'll need to add the trend up parameter to your ask/bid logic
5. Last > VWAP? Meaning you'll need to add the trend up parameter to your ask/bid logic

Sorry for confusing everyone!

Alternatively just tell me what to put where for the ask/bid logic and I'll shut up ;D



Title: Re: ATP [Advanced Trading Platform]
Post by: Askit2 on June 05, 2013, 09:19:38 PM
Market direction is what the up or down refer to or at least it is what it seems like to me


Title: Re: ATP [Advanced Trading Platform]
Post by: Aido on June 05, 2013, 09:26:10 PM
I'll let the code answer this:

https://github.com/aido/AidoATP/blob/master/src/main/java/org/aido/atp/TrendTradingAgent.java#L267 (https://github.com/aido/AidoATP/blob/master/src/main/java/org/aido/atp/TrendTradingAgent.java#L267)

Code:
if (currentBid.isGreaterThan(vwap)) {
tradeIndicator.put("VWAPCross_Up",true);
} else if (currentAsk.isLessThan(vwap)) {
tradeIndicator.put("VWAPCross_Down",true);
}

So, VWAPCross_Up is true when last price > VWAP (i.e. current price has crossed up above VWAP, up trend) and VWAPCross_Down is true when last price < VWAP (i.e. current price has crossed down below VWAP, down trend).

Maybe Probably my choice of terms 'up' and 'down' was not the best.

The VWAP Cross indicator should probably be used in tandem with one of the other indicators.

Although, looking at the code now my description in the README isn't quite accurate. It uses current bid and current ask instead of last; a slight difference.


Title: Re: ATP [Advanced Trading Platform]
Post by: Simonsays on June 06, 2013, 04:23:01 AM
Has anyone created a script to pull data from the .log file for graphing/trending/backtesting?

I am working on an excel sheet (I'm a lousy coder), but automating the mining from the log is too timeconsuming to bother with.



Title: Re: ATP [Advanced Trading Platform]
Post by: Askit2 on June 07, 2013, 07:20:11 PM
Same error as before. Not sure why Cloudflare or a bad gateway crashes the whole ATP though.

Code:
2013-06-07 09:14:41,464 ←[1;31m:←[0;39m Error unmarshalling from json: <html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>cloudflare-nginx</center>
</body>
</html>
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->

2013-06-07 09:14:41,464 ←[1;31m:←[0;39m Error unmarshalling from json: <html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>cloudflare-nginx</center>
</body>
</html>
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->

2013-06-07 09:14:41,469 ←[1;31m:←[0;39m ERROR: Caught unexpected MtGox exception, ticker manager shutting down now!. Details are l
isted below.
java.lang.RuntimeException: Problem getting JSON object
        at si.mazi.rescu.JSONUtils.getJsonObject(JSONUtils.java:68)
        at si.mazi.rescu.HttpTemplate.executeRequest(HttpTemplate.java:118)
        at si.mazi.rescu.RestInvocationHandler.invokeHttp(RestInvocationHandler.java:53)
        at si.mazi.rescu.RestInvocationHandler.invoke(RestInvocationHandler.java:48)
        at com.sun.proxy.$Proxy6.getTicker(Unknown Source)
        at com.xeiam.xchange.mtgox.v2.service.polling.MtGoxPollingMarketDataService.getTicker(MtGoxPollingMarketDataService.java:7
7)
        at org.aido.atp.PollingTickerManager.getTick(PollingTickerManager.java:56)
        at org.aido.atp.TickerManager.run(TickerManager.java:91)
        at java.lang.Thread.run(Unknown Source)
Caused by: com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, St
ring, array, object, 'true', 'false' or 'null')
 at [Source: java.io.StringReader@62c59c35; line: 1, column: 2]
        at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1378)
        at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:599)
        at com.fasterxml.jackson.core.base.ParserMinimalBase._reportUnexpectedChar(ParserMinimalBase.java:520)
        at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._handleUnexpectedValue(ReaderBasedJsonParser.java:1387)
        at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextToken(ReaderBasedJsonParser.java:678)
        at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:2834)
        at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:2781)
        at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:1942)
        at si.mazi.rescu.JSONUtils.getJsonObject(JSONUtils.java:64)
        ... 8 more
2013-06-07 09:14:41,473 ←[1;31m:←[0;39m ERROR: Caught unexpected MtGox exception, ticker manager shutting down now!. Details are l
isted below.
java.lang.RuntimeException: Problem getting JSON object
        at si.mazi.rescu.JSONUtils.getJsonObject(JSONUtils.java:68)
        at si.mazi.rescu.HttpTemplate.executeRequest(HttpTemplate.java:118)
        at si.mazi.rescu.RestInvocationHandler.invokeHttp(RestInvocationHandler.java:53)
        at si.mazi.rescu.RestInvocationHandler.invoke(RestInvocationHandler.java:48)
        at com.sun.proxy.$Proxy6.getTicker(Unknown Source)
        at com.xeiam.xchange.mtgox.v2.service.polling.MtGoxPollingMarketDataService.getTicker(MtGoxPollingMarketDataService.java:7
7)
        at org.aido.atp.PollingTickerManager.getTick(PollingTickerManager.java:56)
        at org.aido.atp.TickerManager.run(TickerManager.java:91)
        at java.lang.Thread.run(Unknown Source)
Caused by: com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, St
ring, array, object, 'true', 'false' or 'null')
 at [Source: java.io.StringReader@3f055bc9; line: 1, column: 2]
        at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1378)
        at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:599)2013-06-07 09:14:42,250 ←[1;3
1m:←[0;39m Error unmarshalling from json: <html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>cloudflare-nginx</center>
</body>
</html>
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->


        at com.fasterxml.jackson.core.base.ParserMinimalBase._reportUnexpectedChar(ParserMinimalBase.java:520)
        at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._handleUnexpectedValue(ReaderBasedJsonParser.java:1387)
        at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextToken(ReaderBasedJsonParser.java:678)
        at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:2834)
        at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:2781)
        at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:1942)
        at si.mazi.rescu.JSONUtils.getJsonObject(JSONUtils.java:64)
        ... 8 more
2013-06-07 09:14:41,560 ←[1;31m:←[0;39m Error unmarshalling from json: <html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>cloudflare-nginx</center>
</body>
</html>
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->

2013-06-07 09:14:41,507 ←[1;31m:←[0;39m Error unmarshalling from json: <html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>cloudflare-nginx</center>
</body>
</html>
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->

2013-06-07 09:14:49,413 ←[1;31m:←[0;39m ERROR: Caught unexpected MtGox exception, ticker manager shutting down now!. Details are l
isted below.
java.lang.RuntimeException: Problem getting JSON object2013-06-07 09:14:48,232 ←[1;31m:←[0;39m ERROR: Caught unexpected MtGox exce
ption, ticker manager shutting down now!. Details are listed below.

        at si.mazi.rescu.JSONUtils.getJsonObject(JSONUtils.java:68)
        at si.mazi.rescu.HttpTemplate.executeRequest(HttpTemplate.java:118)
        at si.mazi.rescu.RestInvocationHandler.invokeHttp(RestInvocationHandler.java:53)
        at si.mazi.rescu.RestInvocationHandler.invoke(RestInvocationHandler.java:48)
        at com.sun.proxy.$Proxy6.getTicker(Unknown Source)
        at com.xeiam.xchange.mtgox.v2.service.polling.MtGoxPollingMarketDataService.getTicker(MtGoxPollingMarketDataService.java:7
7)
        at org.aido.atp.PollingTickerManager.getTick(PollingTickerManager.java:56)
        at org.aido.atp.TickerManager.run(TickerManager.java:91)
        at java.lang.Thread.run(Unknown Source)
Caused by: com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, St
ring, array, object, 'true', 'false' or 'null')
 at [Source: java.io.StringReader@6c619e3b; line: 1, column: 2]
        at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1378)
        at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:599)
        at com.fasterxml.jackson.core.base.ParserMinimalBase._reportUnexpectedChar(ParserMinimalBase.java:520)
        at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._handleUnexpectedValue(ReaderBasedJsonParser.java:1387)
        at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextToken(ReaderBasedJsonParser.java:678)
        at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:2834)
        at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:2781)
        at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:1942)
        at si.mazi.rescu.JSONUtils.getJsonObject(JSONUtils.java:64)
        ... 8 more
java.lang.RuntimeException: Problem getting JSON object
        at si.mazi.rescu.JSONUtils.getJsonObject(JSONUtils.java:68)
        at si.mazi.rescu.HttpTemplate.executeRequest(HttpTemplate.java:118)
        at si.mazi.rescu.RestInvocationHandler.invokeHttp(RestInvocationHandler.java:53)
        at si.mazi.rescu.RestInvocationHandler.invoke(RestInvocationHandler.java:48)
        at com.sun.proxy.$Proxy6.getTicker(Unknown Source)
        at com.xeiam.xchange.mtgox.v2.service.polling.MtGoxPollingMarketDataService.getTicker(MtGoxPollingMarketDataService.java:7
7)
        at org.aido.atp.PollingTickerManager.getTick(PollingTickerManager.java:56)
        at org.aido.atp.TickerManager.run(TickerManager.java:91)
        at java.lang.Thread.run(Unknown Source)
Caused by: com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, St
ring, array, object, 'true', 'false' or 'null')
 at [Source: java.io.StringReader@320809b; line: 1, column: 2]
        at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1378)
        at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:599)
        at com.fasterxml.jackson.core.base.ParserMinimalBase._reportUnexpectedChar(ParserMinimalBase.java:520)
        at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._handleUnexpectedValue(ReaderBasedJsonParser.java:1387)
        at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextToken(ReaderBasedJsonParser.java:678)
        at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:2834)
        at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:2781)
        at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:1942)
        at si.mazi.rescu.JSONUtils.getJsonObject(JSONUtils.java:64)
        ... 8 more
2013-06-07 09:14:50,566 ←[1;31m:←[0;39m ERROR: Caught unexpected MtGox exception, ticker manager shutting down now!. Details are l
isted below.
java.lang.RuntimeException: Problem getting JSON object
        at si.mazi.rescu.JSONUtils.getJsonObject(JSONUtils.java:68)
        at si.mazi.rescu.HttpTemplate.executeRequest(HttpTemplate.java:118)
        at si.mazi.rescu.RestInvocationHandler.invokeHttp(RestInvocationHandler.java:53)
        at si.mazi.rescu.RestInvocationHandler.invoke(RestInvocationHandler.java:48)
        at com.sun.proxy.$Proxy6.getTicker(Unknown Source)
        at com.xeiam.xchange.mtgox.v2.service.polling.MtGoxPollingMarketDataService.getTicker(MtGoxPollingMarketDataService.java:7
7)
        at org.aido.atp.PollingTickerManager.getTick(PollingTickerManager.java:56)
        at org.aido.atp.TickerManager.run(TickerManager.java:91)
        at java.lang.Thread.run(Unknown Source)
Caused by: com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, St
ring, array, object, 'true', 'false' or 'null')
 at [Source: java.io.StringReader@47140a02; line: 1, column: 2]
        at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1378)
        at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:599)
        at com.fasterxml.jackson.core.base.ParserMinimalBase._reportUnexpectedChar(ParserMinimalBase.java:520)
        at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._handleUnexpectedValue(ReaderBasedJsonParser.java:1387)
        at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextToken(ReaderBasedJsonParser.java:678)
        at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:2834)
        at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:2781)
        at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:1942)
        at si.mazi.rescu.JSONUtils.getJsonObject(JSONUtils.java:64)
        ... 8 more
2013-06-07 09:16:02,486 ←[1;31m:←[0;39m Error unmarshalling from json: <html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>cloudflare-nginx</center>
</body>
</html>
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->

2013-06-07 09:16:02,490 ←[1;31m:←[0;39m ERROR: Caught unexpected MtGox exception, ticker manager shutting down now!. Details are l
isted below.
java.lang.RuntimeException: Problem getting JSON object
        at si.mazi.rescu.JSONUtils.getJsonObject(JSONUtils.java:68)
        at si.mazi.rescu.HttpTemplate.executeRequest(HttpTemplate.java:118)
        at si.mazi.rescu.RestInvocationHandler.invokeHttp(RestInvocationHandler.java:53)
        at si.mazi.rescu.RestInvocationHandler.invoke(RestInvocationHandler.java:48)
        at com.sun.proxy.$Proxy6.getTicker(Unknown Source)
        at com.xeiam.xchange.mtgox.v2.service.polling.MtGoxPollingMarketDataService.getTicker(MtGoxPollingMarketDataService.java:7
7)
        at org.aido.atp.PollingTickerManager.getTick(PollingTickerManager.java:56)
        at org.aido.atp.TickerManager.run(TickerManager.java:91)
        at java.lang.Thread.run(Unknown Source)
Caused by: com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, St
ring, array, object, 'true', 'false' or 'null')
 at [Source: java.io.StringReader@7beefe14; line: 1, column: 2]
        at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1378)
        at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:599)
        at com.fasterxml.jackson.core.base.ParserMinimalBase._reportUnexpectedChar(ParserMinimalBase.java:520)
        at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._handleUnexpectedValue(ReaderBasedJsonParser.java:1387)
        at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextToken(ReaderBasedJsonParser.java:678)
        at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:2834)
        at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:2781)
        at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:1942)
        at si.mazi.rescu.JSONUtils.getJsonObject(JSONUtils.java:64)
        ... 8 more


Title: Re: ATP [Advanced Trading Platform]
Post by: jhk753 on June 15, 2013, 04:55:00 PM
Thanks for this.

Just a little question where is the xml config files on MAX OS 10.8

I wanted to try it but I got an error:

"BTCE returned an error: invalid nonce parameter"

So I wanted to use another key/secret, but I don't find the xml and I don't want to go through all the questions each time I change something.

Do you have an idea where it is ?

Thanks a lot


Title: Re: ATP [Advanced Trading Platform]
Post by: Aido on June 15, 2013, 05:12:47 PM
On Windows config is stored in the registry, on Mac its stored in .plist files in ~/Library, and on Linux and friends its stored in ~/.java


Title: Re: ATP [Advanced Trading Platform]
Post by: jhk753 on June 15, 2013, 05:21:28 PM
On Windows config is stored in the registry, on Mac its stored in .plist files in ~/Library, and on Linux and friends its stored in ~/.java

Thanks

Edit: Actually I don't see any .plist in ~/Library ... :(


Title: Re: ATP [Advanced Trading Platform]
Post by: jhk753 on June 15, 2013, 05:28:40 PM
Ok I found it in ~/Library/Preferences/org.aido.atp.plist



Title: Re: ATP [Advanced Trading Platform]
Post by: jhk753 on June 15, 2013, 06:09:38 PM
Aido,

Could you explain a bit more how your arbitrage algorithm work ?

From what I understand from simulation, you compare changing real currency 1 to real currency 2 through bitcoin and through regular trading ?

So we don't actually make money with this right ? How do we benefit from this.

Example if my local currency is USD, if at t=1 I have an arbitrage with Euro
I trade through bitcoin and get euro. But then if I don't have reverse arbitrage to get back to USD for a while, depending on trends of USD/EURO I may loose money.

Am I wrong ? or did I miss something ?

thanks for your help


Title: Re: ATP [Advanced Trading Platform]
Post by: Askit2 on June 15, 2013, 06:37:04 PM
Aido,

Could you explain a bit more how your arbitrage algorithm work ?

From what I understand from simulation, you compare changing real currency 1 to real currency 2 through bitcoin and through regular trading ?

So we don't actually make money with this right ? How do we benefit from this.

Example if my local currency is USD, if at t=1 I have an arbitrage with Euro
I trade through bitcoin and get euro. But then if I don't have reverse arbitrage to get back to USD for a while, depending on trends of USD/EURO I may loose money.

Am I wrong ? or did I miss something ?

thanks for your help

The points you make seem to be correct. I see another problem with arbitrage in that the currencies do not have to actually be at their correct value unless you took them to a different place to trade them back. It was said in the other thread that a wrong assumption was made and arbitrage could lose money. Likely the arbitrage engine isn't a good idea to use.


Title: Re: ATP [Advanced Trading Platform]
Post by: Aido on June 15, 2013, 07:48:01 PM
The arbitrage algorithm is Novas work and perhaps he can explain it better than I can. But here is his recent thoughts on it:

24hr performance with the Arbitrage bot was terrible, so much so that I decided to debug the algorithm step by step and realized several key assumptions in it are in fact invalid.  I think it will probably need to be scraped.

Just make sure to disable the Arbitrage Trader because it has some major issues.

I don't fully understand how Nova's algorithm works so I had rewritten the original Isis ATP arbitrage algorithm to use a Bellman-Ford Shortest Path /  Edge-weighted digraph algorithm. In tests I found that this made the same trades as Nova's simpler algorithm so I scrapped mine.

I had given the arbitrage code a total overhaul and implemented a Bellman-Ford algorithm (http://algs4.cs.princeton.edu/44sp/) to calculate opportunities. From my brief testing, it found the same opportunities as the original code so I re-implemented the original again.


Title: Re: ATP [Advanced Trading Platform]
Post by: jhk753 on June 15, 2013, 07:52:10 PM
Ok thx.
I found an error while testing following trend.

org.codehaus.commons.compiler.CompileException: Line 0, Column 0: Unexpected token "End-Of-File" in primary

It happened when the ticker size was above the minimum I set


Really strange


Title: Re: ATP [Advanced Trading Platform]
Post by: Aido on June 15, 2013, 07:56:46 PM
Really strange

Maybe not.

I would say there is a problem with your trading logic. A rogue character or misspelling maybe?


Title: Re: ATP [Advanced Trading Platform]
Post by: jhk753 on June 15, 2013, 07:58:58 PM
Hum.

Maybe.

What's your advice on bid and ask logic ?


Title: Re: ATP [Advanced Trading Platform]
Post by: Aido on June 15, 2013, 08:12:47 PM
What's your advice on bid and ask logic ?

I advise using bid and ask logic that will make a profit  ;D


Title: Re: ATP [Advanced Trading Platform]
Post by: jhk753 on June 15, 2013, 08:15:40 PM
What's your advice on bid and ask logic ?

I advise using bid and ask logic that will make a profit  ;D

Right ! ^^

have you tested some things yet ?


Title: Re: ATP [Advanced Trading Platform]
Post by: Aido on June 15, 2013, 08:52:19 PM
Sorry, sometimes I just can't resist a smart ass comment.

Have a read through the thread.

e.g.

The vwapcross algo actually has decent performance and regular revenue generation in a static market.
You need to set the algorithm to high risk (when the market is flat like it's been), set the minimum currency trade size to 0.01, the minimum BTC to the exchange minimum for MtGox this is 0.001, the max local currency to 1, the max BTC to 0.1 ($10 is a lot of money to me and BTC is currently $120ish). Max loss tolerance of 0.25 (this translates to a risk of between 1 penny and 1 quarter).
Then you need to enable trading across multiple currencies such as GBP, EUR & USD. (I've got all currencies enabled, but performance seems to be in those 3).


Title: Re: ATP [Advanced Trading Platform]
Post by: jhk753 on June 16, 2013, 08:47:44 AM
I'll let the code answer this:

https://github.com/aido/AidoATP/blob/master/src/main/java/org/aido/atp/TrendTradingAgent.java#L267

Code:
if (currentBid.isGreaterThan(vwap)) {
tradeIndicator.put("VWAPCross_Up",true);
} else if (currentAsk.isLessThan(vwap)) {
tradeIndicator.put("VWAPCross_Down",true);
}

So, VWAPCross_Up is true when last price > VWAP (i.e. current price has crossed up above VWAP, up trend) and VWAPCross_Down is true when last price < VWAP (i.e. current price has crossed down below VWAP, down trend).

Maybe Probably my choice of terms 'up' and 'down' was not the best.

The VWAP Cross indicator should probably be used in tandem with one of the other indicators.

Although, looking at the code now my description in the README isn't quite accurate. It uses current bid and current ask instead of last; a slight difference.

This taken into consideration if I want to use vwapcross algo correctly should my ask and bid logic look like this:

ask_logic: ADS_Down && VWAPCross_Down
bid_logic: ADS_Up && VWAPCross_Up

Or did I completely misunderstand the readme:

Quote
The trend observer functionality constantly monitors the market for trends. A combination of the Advance/Decline Spread, SMA and EMA algorithms decide what way the market is trending.

Market Trending Down = Look at buying
Market Trending Up = Look at selling
Once it is decided the trend is up (ask) or down (bid) it then compares the last transaction to the VWAP.

The ratio of last price versus VWAP is used as a waterline to make the final determination that we will take an action.

If trend = down & last < VWAP then buy
If trend = up & last > VWAP then sell


Title: Re: ATP [Advanced Trading Platform]
Post by: Ianwhitbread on June 16, 2013, 09:32:31 PM
sigh

why does MTgox have to make changes or go offline so often

got this error


2013-06-16 22:21:16,785 : WARNING: Testing connection to exchange MtGox
Exception in thread "Thread-3" com.xeiam.xchange.ExchangeException: Error calling getAccountInfo(): CONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error.
   at com.xeiam.xchange.mtgox.v2.service.polling.MtGoxPollingAccountService.getAccoun tInfo(MtGoxPollingAccountService.java:89)
   at org.aido.atp.AccountManager.refreshAccounts(AccountManager.java:121)
   at org.aido.atp.AccountManager.run(AccountManager.java:101)
   at java.lang.Thread.run(Thread.java:722)

im sure its not ATP  as I cant even login on the website

roll on other support for different platforms

hope all is well with you Aido, you have been kinda silent lately



Title: Re: ATP [Advanced Trading Platform]
Post by: Askit2 on June 16, 2013, 09:40:28 PM
Same error just slightly different debug.

Code:

2013-06-16 15:31:24,034 ←[1;31m:←[0;39m ERROR: Caught unexpected exception, shutting down MtGox trend following trading agent now!
. Details are listed below.
com.xeiam.xchange.ExchangeException: Error calling getAccountInfo(): CONF Redis is configured to save RDB snapshots, but is curren
tly not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the
 error.
        at com.xeiam.xchange.mtgox.v2.service.polling.MtGoxPollingAccountService.getAccountInfo(MtGoxPollingAccountService.java:89
)
        at org.aido.atp.AccountManager.refreshAccounts(AccountManager.java:121)
        at org.aido.atp.AccountManager.getBalance(AccountManager.java:105)
        at org.aido.atp.TrendTradingAgent.evalAsk(TrendTradingAgent.java:394)
        at org.aido.atp.TrendTradingAgent.run(TrendTradingAgent.java:344)
        at java.lang.Thread.run(Unknown Source)


I really wish MTGoX was a little more reliable.


Title: Re: ATP [Advanced Trading Platform]
Post by: Ianwhitbread on June 16, 2013, 09:47:47 PM
Yeah Tell me about it just when the ATP has behaving its self so well and BANG!  pop goes mtgox

Im sure Mtgox does it on purpose if not changing the API more times then I have hot dinners  then they simple go offline

just to note I can not even login  on the website

so totally frozen out


really makes me angry as I was doing well

now when I start the atp  who knows what it will do, sell or buy!  because the collected data will be out of sync

and grrrrrrrrrrrrrrrrrrr

just so bloody angry!!!!



Title: Re: ATP [Advanced Trading Platform]
Post by: Ianwhitbread on June 16, 2013, 10:09:47 PM
Back online now


Title: Re: ATP [Advanced Trading Platform]
Post by: Ianwhitbread on June 16, 2013, 10:17:11 PM
bloody prime example

just gone back online

last trade before the going offline

sold at $99

first trade going back online buy at $100

sorry just had to get that off my chest

if the ATP was online all the time  no way would it done that trade

it has been 3 days without a duff trade. now this happens

Thank you MTGOX

sorry Aido and Nova



Title: Re: ATP [Advanced Trading Platform]
Post by: Aido on June 17, 2013, 12:35:12 AM
hope all is well with you Aido, you have been kinda silent lately

All is well Ianwhitbread, thanks for asking. I'm just quietly plotting the next move in my world domination masterplan!  :)

I've been toying with the idea of using the TA-Lib Technical Analysis Library (http://ta-lib.org/) in AidoATP. Once the library has been integrated into the code it will give easy access to over 200 indicators (http://ta-lib.org/function.html) such as ADX, MACD, RSI, Stochastic, Bollinger Bands etc.

I'm not sure yet, it would take a bit of work and its summertime in the northern hemisphere.


Title: Re: ATP [Advanced Trading Platform]
Post by: Ianwhitbread on June 17, 2013, 06:17:30 AM
My goodness me

Who thinks of the names on this list

Think I better go back to school to find out
What all of these name do!  Lol

Yes very hard to sit behind a computer when the sun is out
Even harder if you live near a beach or park

At least we all know your not a vampire now
It's good to get a bit of sun, keeps us all happy. :)



Title: Re: ATP [Advanced Trading Platform]
Post by: Nova! on June 18, 2013, 12:10:30 AM
bloody prime example

just gone back online

last trade before the going offline

sold at $99

first trade going back online buy at $100

sorry just had to get that off my chest

if the ATP was online all the time  no way would it done that trade

it has been 3 days without a duff trade. now this happens

Thank you MTGOX

sorry Aido and Nova

It should not have done that.  If it's been offline for an hour or more the old ticks should have completely expired out and it should have gone back into observation mode.
Can you post your configuration sans any secret bits like MtGox API key?  I'm curious as to why it would have executed like that.  Also how much did you lose on that trade?


Title: Re: ATP [Advanced Trading Platform]
Post by: Nova! on June 18, 2013, 12:11:39 AM
hope all is well with you Aido, you have been kinda silent lately

All is well Ianwhitbread, thanks for asking. I'm just quietly plotting the next move in my world domination masterplan!  :)

I've been toying with the idea of using the TA-Lib Technical Analysis Library (http://ta-lib.org/) in AidoATP. Once the library has been integrated into the code it will give easy access to over 200 indicators (http://ta-lib.org/function.html) such as ADX, MACD, RSI, Stochastic, Bollinger Bands etc.

I'm not sure yet, it would take a bit of work and its summertime in the northern hemisphere.

That's actually an awesome little library.  I'll get it into ATPx right away too.


Title: Re: ATP [Advanced Trading Platform]
Post by: Ianwhitbread on June 18, 2013, 07:03:49 AM
Yes sure nova

I will try to do it this morning

Thank you

Ian



Title: Re: ATP [Advanced Trading Platform]
Post by: Askit2 on June 18, 2013, 07:01:51 PM
Any news on the streaming ticker?

I only ask because (I can afford to lose the money) I get buys from ATP frequently but virtually never a sell. Its like the 2-5 minute breaks in prices cover all the best prices. Are the buys profitable? Sure If I sat on MTGoX to sell when it dropped enough.


Title: Re: ATP [Advanced Trading Platform]
Post by: ewibit on June 18, 2013, 07:09:43 PM
the problem are the high fees on gox...


Title: Re: ATP [Advanced Trading Platform]
Post by: Aido on June 18, 2013, 07:14:29 PM
Any news on the streaming ticker?

Due to big changes made to the XChange 1.7.0 methods for creating a streaming ticker it is now a bit more difficult to implement one in AidoATP than it was previously. It is on my TODO list but I'm working on a a couple of other things at the moment. e.g. I have totally rewritten the arbitrage code which I hope to commit to Github over the next few days. After that I plan to implement TA-Lib. After these two changes are in a somewhat working shape I will then look at the streaming ticker again.


Title: Re: ATP [Advanced Trading Platform]
Post by: Askit2 on June 18, 2013, 07:42:24 PM
I appreciate all your hard work.

With the max tick set to 120 and the polling set to 30 I have a USD ticker size of 100..... in a perfect world I should have 240 ticks. In the real world I am not sure I should be under 50% but MTGoXs ticker doesn't reliably give me a response twice a minute or even once a minute. Setting max tick to 60 gave me even worse trades.

I like ATP and think that without the missing data I might actually see a profit. Today I get to trade back from -7%. This isn't the worst day ATP has had. and likely will not be the worst day it ever has. Since ATP trades me 100% or as close as it can into fiat if the market ever goes up I get huge losses. This would usually be counteracted by selling around the trend but for the life of me I have found only one way to make it sell. Risk algo 3 and max loss 1 when the market is down big or at least down often. I can't watch it 24/7 to swap algorithms and I don't think it should have as much trouble selling.

I know the weighting system is likely what I am running into. Short of having 30$ it won't sell anything. My balance isn't high enough to keep that much of a slush fund. So I see losses and trade manually back out of them.


Title: Re: ATP [Advanced Trading Platform]
Post by: Aido on June 18, 2013, 08:17:03 PM
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  :)


Title: Re: ATP [Advanced Trading Platform]
Post by: Nova! on June 18, 2013, 09:14:08 PM
Any news on the streaming ticker?

Due to big changes made to the XChange 1.7.0 methods for creating a streaming ticker it is now a bit more difficult to implement one in AidoATP than it was previously. It is on my TODO list but I'm working on a a couple of other things at the moment. e.g. I have totally rewritten the arbitrage code which I hope to commit to Github over the next few days. After that I plan to implement TA-Lib. After these two changes are in a somewhat working shape I will then look at the streaming ticker again.

I've been looking closer at TA-Lib and probably won't be putting it into ATPx.  There's no javadoc I could find on it, the forums don't seem to be working on my end and the last release was 2007.  I just don't see a way to integrate this library.

ATPx also won't be using the eXchange API from ATP.  The library is making too many assumptions I don't like and if MtGox or any other places changes something we are hosed until they put in a patch to the lib.  I'm working on a new interface that uses the streaming sockets API for MtGox.


Title: Re: ATP [Advanced Trading Platform]
Post by: Nova! on June 18, 2013, 09:50:12 PM
Aido what do you think about us implementing something like this for trading logic?
http://www.eclipsetrader.org/wiki/JavaScriptReference

Signals in ATPx will likely all be individual modules registered with a "SignalManager" object which itself is a tick consumer.
When a tick comes in from the exchange it would notify the SignalManager which would then notify the individual signal modules.

Trading logic would register itself with all the relevant signal modules, and be notified when a signal changes state or value.  It would then check to see if the current state of signals demands a trade. 

If we implement the programmable trading logic as javascript, anyone could write their own trade logic and modify it on the fly if necessary.
 



Title: Re: ATP [Advanced Trading Platform]
Post by: Nova! on June 18, 2013, 09:50:47 PM
And of course I posted that to the wrong thread.  Sorry.


Title: Re: ATP [Advanced Trading Platform]
Post by: Ianwhitbread on June 18, 2013, 10: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







Title: Re: ATP [Advanced Trading Platform]
Post by: Nova! on June 18, 2013, 10: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. 


Title: Re: ATP [Advanced Trading Platform]
Post by: Askit2 on June 19, 2013, 08: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  :)


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.


Title: Re: ATP [Advanced Trading Platform]
Post by: Aido on June 19, 2013, 10:13:12 AM
Understood.

I will look into the Streaming ticker code when I get a chance.


Title: Re: ATP [Advanced Trading Platform]
Post by: Askit2 on June 19, 2013, 10: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.


Title: Re: ATP [Advanced Trading Platform]
Post by: Aido on June 20, 2013, 12:21:47 AM
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


Title: Re: ATP [Advanced Trading Platform]
Post by: Aido on June 20, 2013, 12:34:46 AM
reserved

?


Title: Re: ATP [Advanced Trading Platform]
Post by: dwolfman on June 20, 2013, 02:00:46 AM

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.


Title: Re: ATP [Advanced Trading Platform]
Post by: Nova! on June 20, 2013, 07: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.


Title: Re: ATP [Advanced Trading Platform]
Post by: Ianwhitbread on June 20, 2013, 07: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






Title: Re: ATP [Advanced Trading Platform]
Post by: Aido on June 20, 2013, 08: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.


Title: Re: ATP [Advanced Trading Platform]
Post by: Nova! on June 20, 2013, 03:14:48 PM
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.


Title: Re: ATP [Advanced Trading Platform]
Post by: Aido on June 20, 2013, 04:27:24 PM
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.


Title: Re: ATP [Advanced Trading Platform]
Post by: daybyter on June 20, 2013, 04:33:23 PM
That's why I use a single OrderBook in my code to send orders to exchanges.


Title: Re: ATP [Advanced Trading Platform]
Post by: Nova! on June 21, 2013, 01:37:20 AM
Java 6 was EOL'd today.  Guess we should move the build target to JDK7.


Title: Re: ATP [Advanced Trading Platform]
Post by: Aido on June 21, 2013, 07: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.


Title: Re: ATP [Advanced Trading Platform]
Post by: Nova! on June 21, 2013, 09: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 :)
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.


Title: Re: ATP [Advanced Trading Platform]
Post by: Nova! on June 21, 2013, 12:07:56 PM
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


Title: Re: ATP [Advanced Trading Platform]
Post by: Ianwhitbread on June 21, 2013, 02:21:39 PM
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



Title: Re: ATP [Advanced Trading Platform]
Post by: Aido on June 21, 2013, 03:48:36 PM
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.


Title: Re: ATP [Advanced Trading Platform]
Post by: Ianwhitbread on June 23, 2013, 07:51:46 PM
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



Title: Re: ATP [Advanced Trading Platform]
Post by: Ianwhitbread on June 23, 2013, 08:02:03 PM
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




Title: Re: ATP [Advanced Trading Platform]
Post by: Askit2 on June 24, 2013, 08:59:58 PM
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.


Title: Re: ATP [Advanced Trading Platform]
Post by: Aido on June 24, 2013, 11:52:08 PM
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.


Title: Re: ATP [Advanced Trading Platform]
Post by: Askit2 on June 25, 2013, 09:34:56 AM
So if I want less then a 60M average I need a max ticker size that is lower.

It really responds far to slow for what I am trying to do either EMA or SMA. Well unless the market went up really slowly and had a really flat top before trading back down.

I was looking for logic that would give me a specific signal quickly after the market started down. Actually in a larger trading window EMA and SMA may work but with a 2$ swing it really doesn't. By the time they cross the Long average I am back below or nearly below the VWAP.

Maybe since MACD can be tailored I can get that working better.

Thanks for the code section. I had hoped it was the ticks for starting trading not the whole window averaged.

Also my ticker hit 80 USD ticks with 30S poll and 60M max ticks. It wasn't the 120 it should be in a perfect world but it had far less misses either way.


Title: Re: ATP [Advanced Trading Platform]
Post by: joesmoe2012 on June 25, 2013, 04:34:22 PM
I'm just trying to run in arbitrage mode, using only one exchange, btc-e, and here's what I'm getting (same error in both sim and live mode).

Thanks for the great work!

2013-06-25 16:34:23,603 ←[34m:←[0;39m Aido ATP has started successfully
2013-06-25 16:34:23,619 ←[34m:←[0;39m Using arbitrage to decide some trades.
2013-06-25 16:34:24,196 ←[34m:←[0;39m Connecting to BTC-e Exchange
2013-06-25 16:34:25,257 ←[34m:←[0;39m BTC-e AccountInfo as String: AccountInfo [username=null, wallets=[Wallet [currency
=USD, balance=USD 397.60105849], Wallet [currency=BTC, balance=BTC 2.22266382], Wallet [currency=LTC, balance=LTC 3432.7
1777202], Wallet [currency=NMC, balance=NMC 499.00000001], Wallet [currency=RUR, balance=RUR 312.8380495], Wallet [curre
ncy=EUR, balance=EUR 0], Wallet [currency=NVC, balance=NVC 0], Wallet [currency=TRC, balance=TRC 449.10000001], Wallet [
currency=PPC, balance=PPC 1896.20000001], Wallet [currency=FTC, balance=FTC 0], Wallet [currency=CNC, balance=CNC 0]]]
2013-06-25 16:34:25,584 ←[34m:←[0;39m Attempting to open market data file C:\Users\Administrator\Documents\GitHub\AidoAT
P\bin/BTC-e_USD.dat
2013-06-25 16:34:25,600 ←[34m:←[0;39m Attempting to open market data file C:\Users\Administrator\Documents\GitHub\AidoAT
P\bin/BTC-e_RUR.dat
2013-06-25 16:34:25,616 ←[34m:←[0;39m Attempting to open market data file C:\Users\Administrator\Documents\GitHub\AidoAT
P\bin/BTC-e_EUR.dat
2013-06-25 16:34:25,881 ←[34m:←[0;39m Arbitrage Engine cannot find an arbitrage opportunity on BTC-e at this time.
2013-06-25 16:34:25,943 ←[34m:←[0;39m Arbitrage Engine has detected an after fee profit opportunity of 9,999.6% on curre
ncy pair USD/RUR on BTC-e
2013-06-25 16:34:26,177 ←[1;31m:←[0;39m ERROR: Caught unexpected exception, shutting down BTC-e arbitrage engine now!. D
etails are listed below.
java.lang.UnsupportedOperationException: Market orders not supported by BTCE API.
        at com.xeiam.xchange.btce.service.polling.BTCEPollingTradeService.placeMarketOrder(BTCEPollingTradeService.java:
70)
        at org.aido.atp.ArbitrageEngine.executeTrade(ArbitrageEngine.java:189)
        at org.aido.atp.ArbitrageEngine.run(ArbitrageEngine.java:119)
        at java.lang.Thread.run(Unknown Source)
2013-06-25 16:34:26,177 ←[34m:←[0;39m Arbitrage Engine has detected an after fee profit opportunity of 9,999.6% on curre
ncy pair EUR/USD on BTC-e
2013-06-25 16:34:26,302 ←[31m:←[0;39m WARNING: Testing connection to BTC-e exchange


Title: Re: ATP [Advanced Trading Platform]
Post by: Aido on June 25, 2013, 05:24:54 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.


Title: Re: ATP [Advanced Trading Platform]
Post by: Askit2 on June 25, 2013, 06:17:25 PM
I'm just trying to run in arbitrage mode, using only one exchange, btc-e, and here's what I'm getting (same error in both sim and live mode).

Thanks for the great work!

2013-06-25 16:34:23,603 ←[34m:←[0;39m Aido ATP has started successfully
2013-06-25 16:34:23,619 ←[34m:←[0;39m Using arbitrage to decide some trades.
2013-06-25 16:34:24,196 ←[34m:←[0;39m Connecting to BTC-e Exchange
2013-06-25 16:34:25,257 ←[34m:←[0;39m BTC-e AccountInfo as String: AccountInfo [username=null, wallets=[Wallet [currency
=USD, balance=USD 397.60105849], Wallet [currency=BTC, balance=BTC 2.22266382], Wallet [currency=LTC, balance=LTC 3432.7
1777202], Wallet [currency=NMC, balance=NMC 499.00000001], Wallet [currency=RUR, balance=RUR 312.8380495], Wallet [curre
ncy=EUR, balance=EUR 0], Wallet [currency=NVC, balance=NVC 0], Wallet [currency=TRC, balance=TRC 449.10000001], Wallet [
currency=PPC, balance=PPC 1896.20000001], Wallet [currency=FTC, balance=FTC 0], Wallet [currency=CNC, balance=CNC 0]]]
2013-06-25 16:34:25,584 ←[34m:←[0;39m Attempting to open market data file C:\Users\Administrator\Documents\GitHub\AidoAT
P\bin/BTC-e_USD.dat
2013-06-25 16:34:25,600 ←[34m:←[0;39m Attempting to open market data file C:\Users\Administrator\Documents\GitHub\AidoAT
P\bin/BTC-e_RUR.dat
2013-06-25 16:34:25,616 ←[34m:←[0;39m Attempting to open market data file C:\Users\Administrator\Documents\GitHub\AidoAT
P\bin/BTC-e_EUR.dat
2013-06-25 16:34:25,881 ←[34m:←[0;39m Arbitrage Engine cannot find an arbitrage opportunity on BTC-e at this time.
2013-06-25 16:34:25,943 ←[34m:←[0;39m Arbitrage Engine has detected an after fee profit opportunity of 9,999.6% on curre
ncy pair USD/RUR on BTC-e
2013-06-25 16:34:26,177 ←[1;31m:←[0;39m ERROR: Caught unexpected exception, shutting down BTC-e arbitrage engine now!. D
etails are listed below.
java.lang.UnsupportedOperationException: Market orders not supported by BTCE API.
        at com.xeiam.xchange.btce.service.polling.BTCEPollingTradeService.placeMarketOrder(BTCEPollingTradeService.java:
70)
        at org.aido.atp.ArbitrageEngine.executeTrade(ArbitrageEngine.java:189)
        at org.aido.atp.ArbitrageEngine.run(ArbitrageEngine.java:119)
        at java.lang.Thread.run(Unknown Source)
2013-06-25 16:34:26,177 ←[34m:←[0;39m Arbitrage Engine has detected an after fee profit opportunity of 9,999.6% on curre
ncy pair EUR/USD on BTC-e
2013-06-25 16:34:26,302 ←[31m:←[0;39m WARNING: Testing connection to BTC-e exchange


Xchange is the underlying system for connecting to the exchanges only supports market orders. Ironically BTCE doesn't support market orders at all.
BTCe Will not work with ATP. It is a known issue and short of ATP being redone for limit orders ATP will not work on BTCe.


Title: Re: ATP [Advanced Trading Platform]
Post by: joesmoe2012 on June 25, 2013, 08:07:28 PM
Great, thanks for the heads up. I don't know if i already have them or not, but if you give joesmoe @ github access to your github, i'll update the ReadMe some to help avoid some of these questions. I'm no programmer, but i can certainly pitch in for the documentation effort!


Title: Re: ATP [Advanced Trading Platform]
Post by: Simonsays on June 25, 2013, 10:54:05 PM
Great, thanks for the heads up. I don't know if i already have them or not, but if you give joesmoe @ github access to your github, i'll update the ReadMe some to help avoid some of these questions. I'm no programmer, but i can certainly pitch in for the documentation effort!


Would be good to have in the Readme. There are hints to this when reading through the original ATP and this ATP post that MtGox is the only usable exchange with the ATP as it currently stands due to making market orders.  Certainly it is not as clear as it should be.


Title: Re: ATP [Advanced Trading Platform]
Post by: daybyter on June 26, 2013, 11:46:56 AM
hmmh...why not handle market order at the API implementation level? If the implementation grabs the current price and then places an order at that price?


Title: Re: ATP [Advanced Trading Platform]
Post by: Askit2 on June 26, 2013, 06:57:07 PM
hmmh...why not handle market order at the API implementation level? If the implementation grabs the current price and then places an order at that price?

Because it isn't ATP talking directly to the exchange. Xchange is handling the communication. So ATP communicates with xchange's code to the exchanges that xchange works with. Some exchanges are not fully supported by xchange. So when someone tries to use BTCe (I used to trade on there a lot) they get ticker data, and account data but can not trade as BTCe doesn't allow market orders.

As far as the API handling it the API code isn't provided by ATP developers. So if you can't do something it isn't ATP directly that is the cause. The request does go to the API.

The error for BTCe on a denied trade isn't about the API, its about BTCe not allowing market orders.


Title: Re: ATP [Advanced Trading Platform]
Post by: daybyter on June 26, 2013, 07:13:20 PM
Yup...

Replace xchange with another API implementation and add the code there.

I could add an order type for market orders, but my code doesn't use this feature yet...


Title: Re: ATP [Advanced Trading Platform]
Post by: Askit2 on June 30, 2013, 07:39:19 PM
I really wish MtGoX would stop cloudflaring the API. It crashed a few currency pairs overnight.
Thanks MTGox.

Aido is there a way to not fault currency pairs into not working when MTGoX gets overrun rather then losing that pair entirely?


Title: Re: ATP [Advanced Trading Platform]
Post by: scibe on July 01, 2013, 03:51:15 PM
Anyone that is looking into backtesting their algos might take a look at this Goomboo's Journal entry that outlines how he pulls historical data from bitcoincharts.com into the free version of NinjaTrader. The whole topic is a good read and informative.

https://bitcointalk.org/index.php?topic=60501.msg776354#msg776354 (https://bitcointalk.org/index.php?topic=60501.msg776354#msg776354)


Title: Re: ATP [Advanced Trading Platform]
Post by: MobGod on July 05, 2013, 04:46:26 PM
can someone point my in the right direction to compile this on a mac or try to compile it?


Title: Re: ATP [Advanced Trading Platform]
Post by: Ianwhitbread on July 05, 2013, 04:48:38 PM
You don't need too

Just run in the terminal

Make sure you download java 1.7

And make sure you read the read me

It will be made all clear


Title: Re: ATP [Advanced Trading Platform]
Post by: MobGod on July 05, 2013, 04:51:20 PM
You don't need too

Just run in the terminal

Make sure you download java 1.7

And make sure you read the read me

It will be made all clear
I have read the read me but don't see anything on how to get it going i got the git but thats about it i also have java 1.7 could you point out what to do next btw thanks for the quick answer


Title: Re: ATP [Advanced Trading Platform]
Post by: MobGod on July 05, 2013, 05:20:08 PM
ok can anyone tell me how to fix this issue now??
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/aido/atp/Application : Unsupported major.minor version 51.0
   at java.lang.ClassLoader.defineClass1(Native Method)
   at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
   at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
   at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
   at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
   at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
   at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:247)


Title: Re: ATP [Advanced Trading Platform]
Post by: daybyter on July 05, 2013, 05:25:17 PM
Use a recent java version.


Title: Re: ATP [Advanced Trading Platform]
Post by: Aido on July 05, 2013, 06:02:55 PM
I have read the read me but don't see anything on how to get it going i got the git but thats about it i also have java 1.7 could you point out what to do next btw thanks for the quick answer

You don't need the entire git repository. Just download the jar file aidoatp.jar (https://github.com/aido/AidoATP/raw/master/bin/aidoatp.jar) and follow the readme using Java 1.7.

Another user has this working on Mac so it should be fairly straightforward.


Title: Re: ATP [Advanced Trading Platform]
Post by: MobGod on July 05, 2013, 06:14:44 PM
I have read the read me but don't see anything on how to get it going i got the git but thats about it i also have java 1.7 could you point out what to do next btw thanks for the quick answer

You don't need the entire git repository. Just download the jar file aidoatp.jar (https://github.com/aido/AidoATP/raw/master/bin/aidoatp.jar) and follow the readme using Java 1.7.

Another user has this working on Mac so it should be fairly straightforward.
Can you point me to this user so I can ask him or her what was done to get it working ?


Title: Re: ATP [Advanced Trading Platform]
Post by: MobGod on July 05, 2013, 06:15:24 PM
Use a recent java version.
I have the latest just downloaded from the site


Title: Re: ATP [Advanced Trading Platform]
Post by: Aido on July 05, 2013, 06:48:07 PM
Can you point me to this user search this forum for the word "Mac" for me  ;) so I can ask him or her what was done to get it working ?

yes I got adioATP working on a mac

you can install 1.7  from oracle


Title: Re: ATP [Advanced Trading Platform]
Post by: MobGod on July 05, 2013, 07:28:25 PM
Can you point me to this user search this forum for the word "Mac" for me  ;) so I can ask him or her what was done to get it working ?

yes I got adioATP working on a mac

you can install 1.7  from oracle
ok i've done that but i don't see how to get it working on the MAC.. Ianwhibreak can you tell me what you did maybe ?


Title: Re: ATP [Advanced Trading Platform]
Post by: daybyter on July 05, 2013, 10:11:12 PM
Use a recent java version.
I have the latest just downloaded from the site

Problem might be that you still have the previously installed version selected as default. On linux use java-config to select the version you want.


Title: Re: ATP [Advanced Trading Platform]
Post by: MobGod on July 06, 2013, 12:11:35 AM
Use a recent java version.
I have the latest just downloaded from the site

Problem might be that you still have the previously installed version selected as default. On linux use java-config to select the version you want.
I'm on a Mac so not sure what to do to get it working


Title: Re: ATP [Advanced Trading Platform]
Post by: daybyter on July 06, 2013, 08:20:56 AM
http://www.java.com/en/download/help/mac_controlpanel.xml


Title: Re: ATP [Advanced Trading Platform]
Post by: MobGod on July 06, 2013, 08:32:12 AM
http://www.java.com/en/download/help/mac_controlpanel.xml
I'll try that thanks


Title: Re: ATP [Advanced Trading Platform]
Post by: MobGod on July 06, 2013, 09:38:27 PM
ok if someone can help i tried this again and not i get this
java -jar aidoatp.jar
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/aido/atp/Application : Unsupported major.minor version 51.0
   at java.lang.ClassLoader.defineClass1(Native Method)
   at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
   at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
   at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
   at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
   at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
   at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:247)


Title: Re: ATP [Advanced Trading Platform]
Post by: daybyter on July 06, 2013, 11:15:21 PM
java -version

returns what version?


Title: Re: ATP [Advanced Trading Platform]
Post by: MobGod on July 07, 2013, 12:24:22 AM
java -version

returns what version?
java -version
java version "1.6.0_51"
Java(TM) SE Runtime Environment (build 1.6.0_51-b11-457-11M4509)
Java HotSpot(TM) 64-Bit Server VM (build 20.51-b01-457, mixed mode)
also look here i did what you told me
https://i.imgur.com/lMDd78e.png


Title: Re: ATP [Advanced Trading Platform]
Post by: Askit2 on July 07, 2013, 01:49:04 AM
java -version

returns what version?
java -version
java version "1.6.0_51"
Java(TM) SE Runtime Environment (build 1.6.0_51-b11-457-11M4509)
Java HotSpot(TM) 64-Bit Server VM (build 20.51-b01-457, mixed mode)
also look here i did what you told me
https://i.imgur.com/lMDd78e.png

Unless it has been changed ATP requires java 1.7. I would say that lacking 1.7 is the problem.


Title: Re: ATP [Advanced Trading Platform]
Post by: MobGod on July 07, 2013, 02:06:37 AM
java -version

returns what version?
java -version
java version "1.6.0_51"
Java(TM) SE Runtime Environment (build 1.6.0_51-b11-457-11M4509)
Java HotSpot(TM) 64-Bit Server VM (build 20.51-b01-457, mixed mode)
also look here i did what you told me
https://i.imgur.com/lMDd78e.png

Unless it has been changed ATP requires java 1.7. I would say that lacking 1.7 is the problem.
i've installed it did you see the pic i posted?


Title: Re: ATP [Advanced Trading Platform]
Post by: daybyter on July 07, 2013, 09:15:11 AM
So you have java 6 and java 7 installed, but you use java 6 for aido.



Title: Re: ATP [Advanced Trading Platform]
Post by: dwolfman on July 07, 2013, 09:58:56 AM
Looks like it's time to uninstall all Javas and reinstall just 1.7.


Title: Re: ATP [Advanced Trading Platform]
Post by: MobGod on July 07, 2013, 02:31:29 PM
So you have java 6 and java 7 installed, but you use java 6 for aido.


I don't want to use 6 lol how do I get it to see 7


Title: Re: ATP [Advanced Trading Platform]
Post by: daybyter on July 07, 2013, 04:03:57 PM
Uase java-config to set the default java version. Or maybe it's enough to set JAVA_HOME to java 7. I don't know this mac stuff, sorry.

Google says:

http://www.java.com/en/download/help/mac_controlpanel.xml


Title: Re: ATP [Advanced Trading Platform]
Post by: dwolfman on July 07, 2013, 06:18:29 PM
I know Windows isn't the same as Mac, but I've had to completely remove all traces of Java before just to get the right version to then load and work.  Setting the default in the control panel or through an env variable wasn't enough.


Title: Re: ATP [Advanced Trading Platform]
Post by: MobGod on July 07, 2013, 06:51:42 PM
Where is the guy that got it to work on osx maybe he can shed some light on this for me


Title: Re: ATP [Advanced Trading Platform]
Post by: MobGod on July 07, 2013, 07:25:25 PM
question anyway to add another exchange? I want to trade alt-coins but not sure how i would add it help


Title: Re: ATP [Advanced Trading Platform]
Post by: Askit2 on July 11, 2013, 09:26:46 AM
Any news on the ticker crashing front?
I put it in a batch file and it does restart if ATP crashes completely. If a ticker drops not so much.


Title: Re: ATP [Advanced Trading Platform]
Post by: Naruby on July 11, 2013, 11:06:27 AM
Where is the guy that got it to work on osx maybe he can shed some light on this for me

You rang my Lord?
I'm running Aido on my Rasberry Pi, should be more or less the same for osx.

Try this: http://stackoverflow.com/questions/12757558/installed-java-7-on-mac-os-x-but-terminal-is-still-using-version-6 (http://stackoverflow.com/questions/12757558/installed-java-7-on-mac-os-x-but-terminal-is-still-using-version-6)

Or add this on your ~/.bash_profile file
Code:
alias java7='/Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java'
And start Aido with java7 -jar aidoatp.jar


Title: Re: ATP [Advanced Trading Platform]
Post by: MaxSan on July 11, 2013, 05:02:19 PM
What is Big Logic and Ask Logic? Cant I just put to make money? :P


Title: Re: ATP [Advanced Trading Platform]
Post by: MobGod on July 11, 2013, 05:27:10 PM
How do we get this to work for alt-coins on
https://www.cryptsy.com/


Title: Re: ATP [Advanced Trading Platform]
Post by: daybyter on July 11, 2013, 06:21:13 PM
API is here:

https://www.cryptsy.com/pages/api

Maybe I'm the only one trying to implement it so far. At least the #cryptsy channel at freenode is very quiet so far...


Title: Re: ATP [Advanced Trading Platform]
Post by: Nova! on July 11, 2013, 07:17:48 PM
API is here:

https://www.cryptsy.com/pages/api

Maybe I'm the only one trying to implement it so far. At least the #cryptsy channel at freenode is very quiet so far...


Looks a lot like BTC-e API.  I can probably modify the BTC-e exchange module to communicate with cryptsy if you'd like to see it as a module.


Title: Re: ATP [Advanced Trading Platform]
Post by: Nova! on July 11, 2013, 07:18:25 PM
Crap wrong product, sorry.  Consider it added to my TODO list on the ATPx/ Expressvest product.


Title: Re: ATP [Advanced Trading Platform]
Post by: MobGod on July 11, 2013, 07:58:00 PM
Ok so it doesn't work correct? Your going to try and get it working?


Title: Re: ATP [Advanced Trading Platform]
Post by: Askit2 on July 12, 2013, 08:09:33 AM
Well I know it should work out eventually but the bot has purchased me into the wrong side of the trade at MTGoX pretty badly. Compounding my frustration is the fact that I can't seem to log in to gox. So even as I watch the ticker climb 20$ in 2 days I can't manage to get on to stop the losses manually.

I know this bot can make money in an up market. Well sort of as there will be some periods that are not just up. Ironically when it looks like a rocket to the stars not as much. The bot works and I really don't want to complain about what it does well. It buys a ton of Fiat. Ironically that looks great heading down. If only I could get it to blow out of the Fiat closer to the bottom. But if it sells any the weight drops off. This makes smaller sales. Then the market heads up. I guess a bigger problem isn't that it heads down, but that I don't get enough trades in at a 15% gain to make any difference when the market heads up. Manually I would expect at 10%+ gains it would be prudent to take a profit on half of what is in fiat. I have no idea how to give the ATP trading logic that would do that. well aside from risk 3 and max loss 1.0. I can't leave the bot like that as it will buy the same way compounding the issue.

I guess another option would be a fork that had some logic to detect a Fiat gain % and start increasing the weight more as the gain was higher. Then again that would be against the logic of the ATP currently in that it tries not to make multiple trades into a down market or at least not increasingly larger trades. I get not trading excessively into an up market. I also understand that in the ~24 hours Gox was down the bot had ample opportunity to trade enough had the ticker stayed up more then a couple hours of the day for me.

Is there a way to force a sell of all of a position? I can use the API but keep being cloud flaired by gox. Oddly some part of Gox is working correctly. Just not a part I can force a trade with.

Not sure if it would work but if I remove all logic to buy in theory it should only get true for selling. Maybe I can force a sale but it still wouldn't be able to be left on. At this point I want to stop the bleeding. Maybe I will try it. At worst I get another crash. This one not Gox related.

EDIT: It doesn't fatally crash on no ask logic. It does print a ton of errors. I expected that so far euro is fixed waiting for USD to pull back a little.

EDIT2: Conflicting logic serves the same purpose without errors. Just telling the bot to wait for an impossible situation is enough to stop trading.


Title: Re: ATP [Advanced Trading Platform]
Post by: jago25_98 on July 12, 2013, 11:35:32 AM
Let's say we have the message:

"Arbitrage Engine has detected an after fee profit opportunity of 123.15897301% on currency pair RUR/EUR on BTC-e"

How would one take best advantage of that?

The other messages are interesting in that they conflict :D

Code:
2013-07-12 12:27:51,200 : MtGox Advance/Decline Spread algorithm has determined that the USD market is trending down.
2013-07-12 12:27:51,201 : MtGox VWAP Cross algorithm has determined that the USD market is trending flat.
2013-07-12 12:27:51,208 : MtGox Trend following trading agent has decided no USD action will be taken at this time.

ah, a nonce in the works!

Code:
2013-07-12 12:32:12,137 : Arbitrage could not trade with a balance of RUR 0 on BTC-e
2013-07-12 12:32:12,257 : ERROR: Caught unexpected exception, shutting down BTC-e trend following trading agent now!. Details are listed below.
com.xeiam.xchange.ExchangeException: BTCE returned an error: invalid nonce parameter; 66521328 66521328
at com.xeiam.xchange.btce.service.polling.BTCEBasePollingService.checkResult(BTCEBasePollingService.java:71)
at com.xeiam.xchange.btce.service.polling.BTCEPollingAccountService.getAccountInfo(BTCEPollingAccountService.java:53)
at org.aido.atp.AccountManager.refreshAccounts(AccountManager.java:121)
at org.aido.atp.AccountManager.getBalance(AccountManager.java:105)
at org.aido.atp.TrendTradingAgent.evalBid(TrendTradingAgent.java:494)
at org.aido.atp.TrendTradingAgent.run(TrendTradingAgent.java:346)
at java.lang.Thread.run(Thread.java:722)


Title: Re: ATP [Advanced Trading Platform]
Post by: Aido on July 12, 2013, 03:29:54 PM
Let's say we have the message:

"Arbitrage Engine has detected an after fee profit opportunity of 123.15897301% on currency pair RUR/EUR on BTC-e"

How would one take best advantage of that?

Arbitrage code in develop branch is very much experimental and the message is not true. As part of testing I hardcoded a very high profit percentage to make sure a trade would take place regardless of the true value.


Title: Re: ATP [Advanced Trading Platform]
Post by: jago25_98 on July 12, 2013, 04:32:19 PM
Let's say we have the message:

"Arbitrage Engine has detected an after fee profit opportunity of 123.15897301% on currency pair RUR/EUR on BTC-e"

How would one take best advantage of that?

Arbitrage code in develop branch is very much experimental and the message is not true. As part of testing I hardcoded a very high profit percentage to make sure a trade would take place regardless of the true value.

No worries, I'm not trading live (actually opened some empty new accounts just for testing). I do love it though, gives me some satisfaction seeing saying something even if it does give a worrying counter to another trade strategy elsewhere...

Couldn't see that hard coding commented in:
https://github.com/aido/AidoATP/blob/master/src/main/java/org/aido/atp/ArbitrageEngine.java
but then I don't do java and I could have missed it.

My question though, and this was aimed more at the traders here rather than programmers was more about how to trade manually to take advantage of an arbitrage situation in general and that was meant as an example primarily. I see a scenario earlier in this thread but the person is using the example of 2 people who are friends and trust each other.

One way I can see if we have a signal for RUR/USD would be to go to a forex broker and click buy on that. But really for arb I was thinking more about Bitcoin and then it gets complicated with transaction delays and costs in for example sending USD from Bitstamp to USD.

Of course, http://bitcoin-analytics.com/ does alot of it for us... but for a fee. There are also other arb bots... but I don't see how they work without sending funds from one exchange to the other



Title: Re: ATP [Advanced Trading Platform]
Post by: Askit2 on July 12, 2013, 06:41:32 PM
You can always manually send them after the arbitrage.


Title: Re: ATP [Advanced Trading Platform]
Post by: jago25_98 on July 12, 2013, 11:44:49 PM
You can always manually send them after the arbitrage.

Yes of course, that's what I'd like to envisage... but how would you best do that t for a EUR/RUR buy signal? - and also bearing in mind getting funds to the various exchanges is often a problem too (btc-e?)


Title: Re: ATP [Advanced Trading Platform]
Post by: Aido on July 13, 2013, 04:01:26 AM
Couldn't see that hard coding commented in:
https://github.com/aido/AidoATP/blob/master/src/main/java/org/aido/atp/ArbitrageEngine.java

Your link is for the master branch on github. The message about "Arbitrage Engine has detected an after fee profit opportunity of 123.15897301% on currency pair RUR/EUR on BTC-e" is from the develop branch  (https://github.com/aido/AidoATP/blob/develop/src/main/java/org/aido/atp/aribtrage/ArbitrageEngine.java#L99)

Code:
// Temporary value for testing purposes until I figure out how the hell to calculate profit
double profit = 100;

but then I don't do java

Then that would make two of us  :)

but I don't see how they work without sending funds from one exchange to the other

For the record, AidoATP (and it's parent IsisATP) uses intra-exchange arbitrage not inter-exchange. So no funds sent between exchanges.

However, as rough as the arbitrage code is, it should still signal an opportunity that may be profitable if acted upon manually.


Title: Re: ATP [Advanced Trading Platform]
Post by: Askit2 on July 15, 2013, 09:06:11 PM
Is there a simple way to add 1 option to the ATP so that maybe the next version allows high risk without the exponential reduction system?
My thought would be add exponential reduction as an option that users could switch at runtime. This would add a question on first run and an option to the config or registry.

It isn't that the system is bad. It usually works great. Not much sold until the market changes etc. I ask because ATP seems to like trading me solidly into fiat as much as it can. I have increased my maximum local to far above what max BTC is set at now. It had been right on for it. I think, but can't really say for sure, that the weighting for my site or API or Gox issues will not get down as low below average as it gets above average. I am trying to say that although it buys (with much more logic required) and sells (simple logic) the Sales of bitcoin stack 2 deep at times but the buys for bitcoin only ever get to 1 in a row. This leads me to think that since the market fell below the last buy of bitcoins but the weight was low the exponential weighting system has limited me to 1 order in a row for sales.

I hope increasing the maximum local will help correct this. I think it will as the weight should be times the capped local amount. It isn't like the logic I have is bad. the logic itself works. Well for 2 of 3 types of markets. It works going down. It works going flat. It doesn't work so great going up. I can't find logic that would dump my fiat when the market heads up. I know its called a stop loss. What I am trying to setup is similar in idea except that you don't keep as much fiat. This limits my gains on the way down. But should radically curb my losses on the way up.

As an example. Using my old maximum local of 8 and max BTC of .1 I had ~8$ and .28BTC when the market headed down from 100+. I was there because I had decided to net out half my fiat earlier that day. The market went down to 68 ish. ATP didn't sell much apparently because after around 24 hours of being below 72 and trading flatish I had ~18$ and less bitcoins. I was still above a 13% gain though and really wanted to sell to cash in. MTGoX was being a douche so I kept seeing cloudflare and couldn't login to trade manually. Now the market over the next 2 days went up to 90 ish. I was sitting at a loss of 10% when it hit 90.

I know had the bot sold no BTC when the market was down I would have still had a gain. I also know that when it hit bottom and I was up ~15% I would have loved to sell manually. I waited for the bot being sure that if I can't have it manage things pretty well on its own I really haven't gotten things setup correctly. When the market was heading up I did try to correct the losses I was sure I would get. Cloudflare is my nemesis. Well as Jim Cramer says never turn a gain into a loss.

I have made two changes. I am now averaging over a much larger time period and I have increased maximum local. Hopefully I can see less fiat and more smart trades.


Title: Re: ATP [Advanced Trading Platform]
Post by: Aido on July 15, 2013, 09:22:00 PM
I suppose I could add an "extreme risk" option that would disable the the exponential reduction in trade amount as a trend continues i.e. trade all the way up or down a trend until you have either all BTC or all fiat (depending on trend direction). It should be fairly easy to code.

However, the sunshine outside is not conducive to coding and I cannot commit to when this will be done. If I have a bit of time later this evening I may have a look at it.


Title: Re: ATP [Advanced Trading Platform]
Post by: Askit2 on July 15, 2013, 09:38:09 PM
I think maybe my example was bad.
Extreme risk sounds like maximum risk.

What I was hoping for a separate setting that one could use with an already tuned risk profile. Like Conservative or high risk. But it would take more work now that I think about it. You would have to read in a value, run through a logical if, then have a variable in the final equation that would allow one if result to have exponential weighting and one to always return I would guess 0 ish.

I can keep using maximum risk as it will do something a little similar. I can't leave either on all the time likely but I was thinking that just disabling the exponential reduction for a working otherwise setup would give me a little more control on what I want the bot to do.

Enjoy the weather. If I get my weighting right this should be fairly un needed.


Title: Re: ATP [Advanced Trading Platform]
Post by: Aido on July 15, 2013, 10:26:15 PM
what I'm thinking is having 4 risk levels.

  • 1 = Low risk = current conservative risk
  • 2 = Medium risk = current high risk
  • 3 = High risk = current maximum risk
  • 4 = Maximum risk = current maximum risk with exponential reduction in trade amount disabled

This way, no change to existing users configuration as no change to risk levels 1 to 3. If someone wants to experiment with the additional risk level just edit their config and change risk level to 4.


Title: Re: ATP [Advanced Trading Platform]
Post by: Aido on July 15, 2013, 11:05:22 PM
New commit in develop branch (see previous post)

commit 1f3d28943ac40659de61dbb789930415a1a63977

    Added another level of risk



Title: Re: ATP [Advanced Trading Platform]
Post by: MobGod on July 16, 2013, 02:03:39 AM
any news on adding cryptsy ?


Title: Re: ATP [Advanced Trading Platform]
Post by: Askit2 on July 16, 2013, 04:30:51 AM
Aido
I didn't see anything in the changes to explain what I am seeing on the console.

On BTC selling calculations everything looks great.
Blah blah blah weight,
Blah amount less then minimum
BLah blah blah didn't trade

On buying bitcoins it looks wrong
Bah blah blah weight

I look in the log and I see a value of USD I have. It just never seems to calculate an amount of bitcoins to buy.

Switched back from development version with 4 options and Bam a buy on less weight then the other version. Odd

EDIT: am on strategy 2. Not sure if that helps or hinders but that is what I was on.

EDIT2: Aido I think I was wrong before about my logic being fine. I made an assumption that the max local wasn't the most ATP would calculate based on but a limit to how much it could use at once. It appears that I was a bit off in that. Either that or doubling the max had an unexpected side effect of allowing multiple buys in a row.


Title: Re: ATP [Advanced Trading Platform]
Post by: Aido on July 16, 2013, 07:17:28 AM
any news on adding cryptsy ?

AidoATP currently relies on the XChange library for all communications with the different exchanges. If cryptsy isn't supported by XChange then it won't be supported by AidoATP.

Cryptsy currently isn't supported by XChange


Title: Re: ATP [Advanced Trading Platform]
Post by: Ianwhitbread on July 22, 2013, 02:28:27 AM
MAN!! missed loads on this forum

was not getting emails about the updates

oh well

anyway

seems mtgox ticker gone funny again,   i guess they did a dodgy update again


Title: Re: ATP [Advanced Trading Platform]
Post by: Askit2 on July 23, 2013, 09:12:47 AM
Is this result about what I should expect from MTGoX Polling interval 20 seconds, Max tick age 480 and a USD ticker size of 207 with EUR sitting at 90?
I know the obvious answer is that it hasn't been running long enough. It has been running over 24 hours continuously. That should fill an 8 hour log.

I only ask because between cloudflare and the API having Less then 50% of the expected at a 60 Second interval I am concerned. I guess MTGoX is waiting for people to leave so their server can be responsive again. If a bot that I don't have to install another browser or OS for pops up I will happily drop MTGoX just to help them out. I am still hopeful on Profits. Right now I rack up losses because any moderate volume trading time makes me lose the API for a while the longest I have witnessed was 12 minutes.

If people with better experiences would also let me know maybe if paying enough fees to bump your account up makes it better I would be really happy. I don't think they would prioritize those accounts that pay them a lot of money. I just hope no ones results are as bad as mine.


Title: Re: ATP [Advanced Trading Platform]
Post by: Ianwhitbread on July 23, 2013, 09:53:06 AM
Btw any news on nova

I hope all is well and him and his car i guess he has been rescued?





Title: Re: ATP [Advanced Trading Platform]
Post by: Askit2 on July 31, 2013, 08:45:37 AM
Aido.
Not sure if this makes sense to you but it seems like using another API program on MTGoX has improved my ticker length. Nothing on my end changed except adding an API program so I can sell if the market turns against the bot. Anyways it went from a ticker of ~200 to >420.

It could be MTGoX has improved something but 2 crashes today suggests to me that whatever they might have tried fixing it didn't take as cloudflare keeps killing ATP.

Thanks for all you do.


Title: Re: ATP [Advanced Trading Platform]
Post by: Ianwhitbread on July 31, 2013, 09:06:39 AM
Yes my Atp

Is offline

Been stuck at 1 ticker

Been doing manual trades every 24 hours



Title: Re: ATP [Advanced Trading Platform]
Post by: Askit2 on November 14, 2013, 04:37:44 AM
Aido any progress on the Arbitrage code?

I am getting less and less hopeful that I can get logic to trade me out of the hole ATP manages to, because of MTGoX, trade me into.
To be honest I have tried so many pieces of logic that should work to make money.

I tried MACD, sig 9, short 10, long 21, have tried from 30 seconds to 2 hours between polls. It delays buying back my bitcoins. It will sell like there is a house fire. It just can't buy to save my cash. Buy was MACD_Positive and sell was MACD_negative. The trouble was no matter what I do I can't get the bitcoins back until its too late. I tried high and maximum risk. Max just goes stupid into every small change and bleeds me quickly at .01 per trade. High isn't better it delays so much that a 30$ swing becomes buying 3$ higher.

I tried VWAP with polling at 15s, 30s and a max tick length of 30m, 45m, 50m, 55m, 60m and 70m. Again selling my bitcoins it does great at. I used to run VWAP_Up for selling and VWAP_Down for buying. Firstly I had tons of sells. as soon as the price barely clears VWAP it sells. In theory it should eventually buy back the bitcoins. Trouble is that every tick after the sell increases the VWAP. This has two effects causing my lack of profits. 1. If the weight ever gets high enough to buy when the VWAP finally changes I generally see sell price + at least 1 dollar. 2. When the market heads up nothing happens that helps me. ATP stays all in FIAT. This upswing bleeds me the whole way up. Whats worse is that even if the trend reverses slightly short of a buy I am stuck I have a huge loss and until it buys back less then its last sell I can't get another sell that might be profitable.

That VWAP problem got me thinking Why sell VWAP up if it sells seemingly instantly when VWAP_Up = True. What would help a lot more was to sell when VWAP_Down was true (selling into the drop preferably early into it. Buy them back at least an hour later down 10+ dollars lower when VWAP_Up was true. The downside wasn't that the indicators wouldn't show up. They do. About half the time profitably at least 25% of the time quite profitably. The downside again was although it sells immediately on the VWAP_Down being true When a long time later VWAP_Up is true there is no weight. This system would fix both issues I have tried curtailing with other indicators in the past. If the market heads to the moon as the saying goes I should get bought out quickly and when the market moves down I should get a string of sells. previous testing left me assured this setup would only bleed me in a flat market and likely not a lot. Sadly what it does do is just that it bleeds me slightly in a flat market. What it doesn't do is make money in a choppy market. This is by design. Seemingly the weighting engine doesn't allow the spreads to be reversed. I get that by design this bot should using only VWAP buy down and sell up to even out the market. What I don't get is how to make it work.

Other experiments, I used EMA and SMA to give an offset around the average price making sure (I thought) that the buys and sells would be enough dollars apart to make money. I varied the short average a bit but only noticed that the larger the short got the less likely the indicator was caught up to the current trend.

I tried using MACD and VWAP it was worse then either alone.

I have tried ADS and VWAP and the 24 hour performance is lackluster for my 4 quadrant setup. I think maybe just 2 is better. This also will not buy me back out into an up market at a profit reliably. It did point out why I couldn't get any weight as the only way to see the items to calculate weight is to enable that indicator. Sadly VWAP up & down ADS down sell and VWAP up or down ADS up buy doesn't work.

I think it would work better somewhat as I have to use Max risk to buy anything back at (VWAPdown & ADS down sell) and (VWAP up and ADS up buy).

This isn't terribly helpful as because the weighting is backwards I either need a stop loss that works so when the market heads up I actually get stopped out not just get to watch my losses explode, or I need the weighting backwards so that it will sell early enough and buy way earlier.

The code change looks fairly trivial but compiling this exact setup I have never done.

Sadly a streaming ticker would have helped some. I started at .41 BTC I am down to .0341 BTC. It has beyond decimated my test money to get this far. And my only conclusion seemingly is to use everything backwards and force the trade when the indication says its time. End result enhanced losses in a flat market and maybe a gain when it goes lumpy. I guess its better then some losses in a flat market and a huge loss when it goes lumpy.

I'm sure I did many things wrong I just kept looking for something to fix the problems. If anyone has a suggestion I would appreciate it.


Title: Re: ATP [Advanced Trading Platform]
Post by: daybyter on November 14, 2013, 06:27:45 PM
Wow! It seems like you tried a lot of strategies in technical trading? I'm working to intergrate such strategies in my framework, too. Is it ok to contact you, once I got the methods integrated into my framework?

So we could discuss such strategies? Maybe come up with new ones?


Title: Re: ATP [Advanced Trading Platform]
Post by: Askit2 on November 14, 2013, 08:29:09 PM
Wow! It seems like you tried a lot of strategies in technical trading? I'm working to intergrate such strategies in my framework, too. Is it ok to contact you, once I got the methods integrated into my framework?

So we could discuss such strategies? Maybe come up with new ones?

You are welcome to discuss strategies with me. I would be more then happy to try helping. That having been said I would hope you would ask also for some discussion with someone like ianwhitbread who made money.


Title: Re: ATP [Advanced Trading Platform]
Post by: daybyter on November 14, 2013, 09:03:43 PM
Well, I also have a profitable bot. Profitable at a very small scale, as I have to admit. But it is making profit AFAIK.

Now I have to expand it's capabilities and it seems you have experiences in the field, that I want to explore.


Title: Re: ATP [Advanced Trading Platform]
Post by: Askit2 on November 14, 2013, 09:17:00 PM
Sadly the more I think about what went wrong the less I can think of a solution.

For example. Bot sells bitcoins too close to VWAP. Solution decrease weighting by lowering stop loss. Unintended side effect Bot has trouble getting enough weight to ever buy good price or not.

Another. Bot won't buy Calculated bitcoins on buy back are below minimum. Solution increase weight. Unintended side effect Bot sells bitcoins back way to close to VWAP.

A better solution to both issues would be separating the buy and sell requirements. For example If the bot is selling my bitcoins maybe I want a minimum sale of 0.014 (I didn't have many fractions of a bitcoin) so it waits for 0.014 to sell. The bot hits this weight easy. The problem is that on the down side (the place I normally lost the ticker for minutes) the weight never gets high enough for a 0.014 buy. It gets high enough for a 0.012 buy or a 0.01 buy. Now I wouldn't traditionally want .004 bitcoins sitting untradeable but it beats a high weight turn around and a price jump with 0.014 in.

Either separate weighting or separate minimums or both would improve my situation. In my first example I needed a sell maximum weight of 0.18 to get a reliable sell high enough I should make money. On the buy side I would need a maximum weight of 0.50 (I never went that high as the results get worse as the number went up.)

I guess what I am saying is that bots may need more tuning options. For example ATP lets you set your short moving averages but your long is whatever the ticker currently has in it. That is very hard to back test. Forward testing is likely even less reliable as the long moving average moves around for two reasons. Either the actual average should move because it has the same number of ticks but they now have different values by one leaving and one gaining or you have a differing number of ticks like it misses a 2 minute window so you miss one every 30 seconds totaling 4 ticks. Your long MA is now 4 shorter then it would be. Whats worse (you can't fix this part) is no matter what MA you use it will be somewhat altered by missing data. Having your long MA shorter then your total ticks would at least make it based on the same number of ticks.

Buy and sell logic is great it can be way different and that is a good thing. The actual amounts to buy and sell are calculated identically but the source of the weight is reversed. asks to bids. The trouble is that unless something went horribly wrong the buy logic will always try buying less. The reason? Its still based on what you have. I have reguardless of price more money generally in bitcoins. So the sell weight results in a radically different result then a similar weight would on the buy side since it is calculated off a smaller number.

Another thing that would at least save me some money would be instead of an exponential backing off system allow a minimum for bitcoins and maybe other currencies. Its unlikely that I would want to force money into a loss but someone else may want some dry powder if the market moved unexpectedly. I only point this out as it would have helped me not lose money fairly frequently. The main problem was the weighting system indirectly. Bot sells at lets say 105 because its enough above VWAP. market drops to 100. Bot buys because its below VWAP. Technically I made 3.4% in theory. Reality is somewhat different. Bot sold .03 at 105 and repurchased .01 at 100. So I have about a 1% gain currently. Now the problem. Market keeps going down. I know High Quality Problem I'm making money. So market drops down to 85. Bot sits on down for a long while. Weight is inadequate to buy again. Vwap Switches to up a few times. The last time it Sells a litte at 90 lets say .02. Now I have 0.04 with an average price of 97.50. The market heads up. This time it starts range trading at 110. I am now sitting on a loss. Market drops down a little to 108 and bot buys back .02 now I have made that loss permanent. But wait there is still .02 waiting to be bought. It can lose a virtually unlimited % as long as the market heads up. The numbers may have been off but that actually happened to me and I am fairly sure the amounts are not terribly far off.

The issue wasn't the logic. I really did want to sell high and buy low. And what it did buy or sell was at a profit in a way for the first part. The problem is that I couldn't see a way to make it reliably make good trades over the long term. If the market was range bound I could make money. Frequently did make a bit. If the market was going down it was simple to make money. When the market went up I lost a ton.


Title: Re: ATP [Advanced Trading Platform]
Post by: daybyter on November 14, 2013, 10:14:39 PM
If you make money in a market, that goes down, then it might help to just stop the bot when the market goes up? Just buy and hold? :)

I don't know the ATP sources, so I don't really understand your problem. In my concept, a strategy is just a list of rules. The buy and sell rule don't have to be coupled in any way. You could buy when EMA cross but then sell via arb or whatever (once the sources are complete).


Title: Re: ATP [Advanced Trading Platform]
Post by: Askit2 on November 15, 2013, 01:29:10 AM
If you make money in a market, that goes down, then it might help to just stop the bot when the market goes up? Just buy and hold? :)

I don't know the ATP sources, so I don't really understand your problem. In my concept, a strategy is just a list of rules. The buy and sell rule don't have to be coupled in any way. You could buy when EMA cross but then sell via arb or whatever (once the sources are complete).
Well that is the idea. I made several mistakes. One was just letting the bot run I guess. See when I watch it I can usually fix small things.

The down side is that by default ATP is setup to even out the market and make money doing it. It sells based on a weight calculated by the buying pressure. The more people that buy the Larger the Sell.

Similarly buying is reversed. As the market goes down you buy bitcoins back with the amount increasing with selling pressure.

My newest test doesn't work so well either. It isn't like it wont sell. It will. As soon as the values are true. But it wont buy it back as soon as the values are true. Not enough selling pressure as it heads up.

Apparently enough people buy as it goes down that I can still sell. Just as it rockets up I can't find enough buyers to sell. Likely the difference in value adds to the problem.

Essentially the bot works as designed. In my previous example I could have left the maximum weight very low and had a buy near the bottom. But in a fairly flat market (the three weeks before that) it would sell but never repurchase it. The amount was always below minimum. Now the issue leading up to my example I had several up 5 dollar days each one having some amount of fiat. Each sell compounds the problem. Any restarts cause an immediate clearing of the logic to avoid additional sells. So MTGoX gets  502 error and I get another sell. So I had been trying to around the days low put in a buy. I didn't have faith in the trend reversing after a few weeks of slow rising so I blew out of my losing position. After that a com issue and my script restarted the bot and from then on the story is correct basically. The trouble was two fold. One It had a sell then too small of a buy too early then no subsequent buy when the bot saw a 15% gain. All logic said it should buy except the amount was too low. Eventually it had another sell and I was hoping for a bigger buy before going up. While the bot was working MTGoX website was showing cloudflared at least to me. I couldn't fix the problem manually.

I currently use a separate API based bot that has no trending or automatic trading available really and I could in the same condition blow out of my position rather then watching losses pile up.


Title: Re: ATP [Advanced Trading Platform]
Post by: daybyter on November 15, 2013, 01:51:17 AM
I wrote you a PM. Just want to show you a screenshot and hear your opinion.


Title: Re: ATP [Advanced Trading Platform]
Post by: Askit2 on November 15, 2013, 06:43:22 AM
Another that may have partially led to the losses. I can't say it caused them but may have contributed at any rate. Again its MTGoXes ticker. Indirectly it how ATP handles low data. Sadly there is no way to keep enough data on some tickers to maintain trading. Now after it makes a sell I would hope that maybe it would maintain some monitoring. Again I want it to buy me out when the trend changes. I'm not sure how JPY suddenly hit 45 ticks then in 5 minutes dropped below 40. I had minimum set to 40 to keep GBP, JPY, CAD, and AUD from trading as they lack enough info reliably to get me in and out. Sadly when JPY was at 45 EUR was down to 35.... Some days you just can't win.

Possibly another idea to help make it a bit more reliable would be to prioritize currency pairs with more data or more recent data. Now I can't guarantee that it would make more money if it traded the longer and more reliable ticker only using shorter tickers after the best are used.

EDIT: Replied to PM with PM.


Title: Re: ATP [Advanced Trading Platform]
Post by: Askit2 on November 15, 2013, 11:43:09 PM
When I started I used the most simple logic I could think of. A bit of logic that would duplicate my hand trading methodology. Something that if it was done all day every day should have no trouble making money. Except I am a human. I can notice things not being right or things going badly fast and correct my mistake. I gave the bot no such abilities because I couldn't figure out how.

I started Ask VWAP_Up, Bid VWAP_Down, Ticker length 65 minutes, polling interval 15 seconds, initially I tried 5 seconds. I really wanted it to trade anytime it could make money. Max weight was 28 (later changed to 26) minimum was initially 0.01 maximum was at 0.1. Minimums changed bitcoin wise to .02 and .0118 Local was initially wrong at 5 max and 0.01 min I changed it to 15 max and 0.01 min. I didn't use anything else.

The problem with any adjustments are they all made it harder to buy back. As an example min bitcoin over 0.01 means local not only can get as high as 15$ worth but it has to buy what ever minimum bitcoin you set as well. I did notice that limiting weight didn't help me a lot.

My mistake was thinking that the bot would try for the best price not just a price that meets my logic. I also had initially thought maybe the first sell would be wrong but subsequent sells would be much more profitable. The problem was that by design you should try to make the lions share of money off the first trade. This led to first dropping the weight so that it wouldn't trade so easily. That much worked. The downside was it didn't slow the selling appreciably just the buying. Again not what I wanted. Eventually I put the weight back up (max loss) and started tinkering with the min bitcoin that seemed like it had potential. It did actually help some. Trades slightly higher into the curve but while watching the bot I noticed it missed a ton of oppertunities.

I added several things one at a time to try to encourage it to not sell right when VWAP_Up was true. To get it a little offset. All it needed was just enough above that it would more then pay for the fees one way and I would be set.

So I tried SMA. It uses an adjustable short. No adjustment on the long but I tried making it work. The problem was that it had a really solid long term average and try as I might I couldnt' get it to try to call a bottom. This was a mistake. It only went down at average price. I tried using it for direction. SMA_Down was added to my ask logic. In theory it would keep me from selling too early. I set the short to the default from way back and noticed it still sold me super early into an uptrend. The problem? Simple the SMA hadn't yet moved to up by the time VWAP_Up was true. This was befuddling to me. But the Logic was correct for selling. So I shortened the Short MA value. I believe the lowest I tried was 2. It would still play jump rope around the average.

I tried EMA. It didn't really work any different. The price for Long Average was different but the effect was the same.

Next I got to thinking that since VWAP and SMA and EMA never seemed to have the same value that I could cobble them together and make what I wanted happen. So Ask was VWAP_Up SMA_Up EMA_UP, Bid was VWAP_Down SMA_Down EMA_Down. This provided an offset. It really did make a range where the bot wouldn't trade. Sometimes this was 2 dollars sometimes only 1. I needed about 3. All short averages where set to 2 and changed to 1. Testing led to failure.

Next I tried MACD as it seemed to have the most configureable averages. I could finally set a long average. I used the 10/21 from goomboos journal with 9 for the signal line. I couldn't find a really good set of instructions on how to use it correctly so for a while I used conflicting logic and watched the values. I finally Used MACD_Positive and MACD_Up for bid and MACD_Negative and MACD_Down for ask. Now it should sell something everytime it figures the market heads down. It did. And It should buy back when the singal says the market is heading back up. It didn't. It would eventually buy. The problem was watching the prices on QT-Bitcoin trader I would sell and by for nearly the same price. Even at 0 fee I wouldn't make money on that strategy. Some trades are far worse but on longer downturns I got usually parity or close enough to it that it wouldn't average any profits. I tried max risk and 1 for max loss. Still delayed buying ate most of my profits. Compounding my frustration was that it now traded a lot in a flat market.

This led me back to thinking about my initial problems. Initially by the time a buy did happen the market had moved up so much I would lose money. Looking at the buys and sells I had a thought. Reverse those numbers and I would stop the bleeding on the way up and sell at a much more profitable price later. The Trouble with Ask VWAP_Down and Bid VWAP_Up is that it will still have trouble buying whent he logic dictates it should. This system took advantage of the VWAP moving around a bit at lower lengths like 60-90 minutes to try to curb errant trades and I could use risk 3 and max loss of 1. It would still not stop me out when the logic dictated. I noticed it was by design looking through the code files. While there I noticed weight was effectively controlled by ADS or at least most of weights calcs are from values used to figure out ADS.

This led me to my next plan VWAP_Down and ADS_Down for Ask and VWAP_Up and ADS_Up for buying. I could watch why it wouldn't buy but I couldn't fix it. It really wasn't an improvement from VWAP up and down. I got to thinking and overly complicated this by trying to make a 4 quadrant trading system (I don't think that is the right term) I needed up a bit going up a lot down a bit and down a lot. So I had ask logic of VWAP_Up and ADS_Down also I had VWAP_Down and ADS_Down. For bid I used the opposite. VWAP_Down and ADS_Up also VWAP_Up and ADS_Up. Well not entirely the opposite. My hope had been that when ADS swapped it would sell and ride the trend down until ADS switched up. It didn't work. I also found logical nots. I traded VWAP_down and ADS_Down to VWAP_Up and !ADS_Up so if flat it could try to sell making an earlier sell. I did the same on bid for VWAP_Down ADS_up to VWAP_Down !ADS_Up. It wasn't an improvement either. I scrapped trying to get a better by and sell price. They didn't work reliably for me. More often then not the market went back to up up.

I have tried another setup over night and it provided no trades at all.... So far so good. It missed a ~20 dollar swing entirely. The upside is it didn't lose anything either. I may work on this one as see why... I may have something to post later with a victory. Personally if it works the more the merrier on it. Seriously it wouldn't make anything but pump and dumps expensive.

Using other indicators to shoe horn in trades was an epic failure for me. I really didn't likely understand how to set the weights etc to make money but there really isn't a guide I could find on what value changed what.

I know that testing would save money but the testing mode is infuriatingly devoid of helpful information. I would have to manually figure out each trade in theory what it should have gotten or sold figure in the fees etc. I'm not sure why the sim mode doesn't keep a book of what it simulated it did. It was fairly worthless as it didn't even keep track of what balances it should have so I would have to track each currency and make sure it could have paid for what it bid on. Also it doesn't account for delay in processing or transfer or slippage. Still logic that loses 12% in a day could be spotted quickly and abandoned with no losses.

If someone sees some tuning I missed on say VWAP could you let me know.