Pages:
Author

Topic: Isis ATP [Automated Trading Platform] - Discussion - page 27. (Read 45225 times)

BCB
vip
Activity: 1078
Merit: 1002
BCJ
is this calculating for the gox fee.
full member
Activity: 154
Merit: 102
Remember this was the day there was a big dip that started the long climb we're on now.
This is not able to make any profit if the market trends one direction only. When the market is volatile, it reads trends and takes what advantage is available.

Market trending down = sell
Market trending up = buy

The net result is selling before a low, and buying before a high.

Close but backwards.

Market Trending Down = Look at buying
Market Trending Up = Look at selling

Once it's decided the trend is up (ask) or down (bid) it then compares the last transaction to the vwap.

The ratio of last vs 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

Once we have decided to buy or sell, then we look at the ask, bid and trend arrows.
This gives us an indication of how much momentum is in the current trend and is used to calculate a weight.

current balance (BTC or USD depending on Bid or Ask) * weight = how much we will be trading with.


For instance, if we have 100 ticks in our ticker...
If of those ticks 60 were up and 40 were down, the trendarrow will be +20, the market is now trending up.
During that same time there were 75 instances where the bidArrow went up and 25 where it went down, the bidArrow is now+50
The last trade was 10.25, the vwap is 10.20.
Now is a good time to sell because there is enormous pressure in the market to buy.

So how much do we sell?
Let's assume we have 100 BTC.
trendArrow / ticker.size = 20/100 = 0.2
bidArrow / ticker.size = 0.5

(0.2 * 0.5) =  10% of our 100 BTC balance.
100BTC * 0.1 = 10BTC

So now we sell 10 BTC at market price for 102.5 local currency

Now an hour later the market has taken a dip.
We have 100 ticks in our ticker.
60 were down, 40 were up the trendArrow is now -20
There were 75 instances where the askArrow went down and 25 where it went up.  The askArrow is now -50
The last trade was 10.20, the current vwap is 10.25

Our local currency balance is 102.5
(0.2 * 0.5) = 10% of our 102.5 local currency balance
102.5 * 0.1 = 10.25
We now buy 1.025 BTC for 10.25, this gives us a profit of 0.025BTC

Now imagine that each of these trends continue on average for about 30 minutes before reversing and during that time we place 10 trades essentially identical (since these conditions are really only present for about 10 minutes out of each 30 minute trend), this is a profit of 0.25BTC during that 30 minute period or .5BTC per hour.
24 * 0.5 BTC = 12 BTC or 12% profit in a day.

Hope that helps!

BTW new commit coming very soon, just trying to figure out how to cache the market profile to disk so I only have a single large commit today.


BCB
vip
Activity: 1078
Merit: 1002
BCJ
where is that in the code?
BCB
vip
Activity: 1078
Merit: 1002
BCJ
is isis calculating its own vwap? 

the vwap isis is reporting is not consistent with the actual mt.gox vwap.
full member
Activity: 154
Merit: 102
The first day it gained 350% (It managed to turn 1 BTC into 3.5 so don't take it to mean anything much.)

was this on option 1 high risk or option 2 conservative ?

High Risk was the only algorithm at that time.  Remember this was the day there was a big dip that started the long climb we're on now.
sr. member
Activity: 290
Merit: 250
Working great on my Mac.

I had 0 USD in my account (waiting on the 30 day dwolla thing) and just .12 BTC.

I'm confused by the PL lines

Sep 16, 2012 11:04:48 PM org.open.payment.alliance.isis.atp.TradingAgent marketOrder
INFO: Current P/L: BTC -0.20819411 %2193.00472300
Sep 16, 2012 11:04:48 PM org.open.payment.alliance.isis.atp.TradingAgent marketOrder
INFO: Current P/L: USD 2.95137 %0

I'm assuming they are incredibly screwed since I had 0 USD to start with.


full member
Activity: 154
Merit: 102
is it possible to show the current Balance in BTC and USD right after the P/L info ?

Code:
High: Ticker [timestamp=2012-09-17T02:25:37.637Z, last=USD 11.95, bid=USD 11.84597, ask=USD 11.94999, tradableIdentifier=BTC, volume=2410703771458]
Low: Ticker [timestamp=2012-09-17T01:45:06.213Z, last=USD 11.841, bid=USD 11.841, ask=USD 11.85, tradableIdentifier=BTC, volume=2429478613418]
Current: Ticker [timestamp=2012-09-17T02:43:40.584Z, last=USD 11.86, bid=USD 11.86, ask=USD 11.947, tradableIdentifier=BTC, volume=2423495794991]
VWAP: 11.84343
The market is trending up.


Sep 17, 2012 2:44:21 AM org.open.payment.alliance.isis.atp.TradingAgent evalAsk
INFO: Attempting to sell 0.00 of 0.51 BTC available
Sep 17, 2012 2:44:21 AM org.open.payment.alliance.isis.atp.TradingAgent evalAsk
INFO: 0.00 was less than the configured limit of 0.01
Increasing order size to 0.01
Sep 17, 2012 2:44:22 AM org.open.payment.alliance.isis.atp.TradingAgent marketOrder
INFO: Successfully sold 0.01 at current market price.
Sep 17, 2012 2:44:22 AM org.open.payment.alliance.isis.atp.TradingAgent marketOrder
INFO: Current P/L: BTC -0.09 %120.0
Sep 17, 2012 2:44:22 AM org.open.payment.alliance.isis.atp.TradingAgent marketOrder
INFO: Current P/L: USD 1.06091 %90.73600

Good Idea, I'll get that added while I'm in here.
full member
Activity: 154
Merit: 102
Thanks. 

How do I take this out of stimulation mode.  (it's currently building a market profile)



Start it with the --debug-live=true flag appended. Restart it if it's not set now.
If you built it, you can change the learn time to oneminute, or add your own constant.

My next commit will cause it to save the market profile periodically and load that profile at startup.
As long as the newest tick is less than 10 minutes old it will use that profile instead of trying to build a new one.

I don't recommend changing the constants.  There are lots of places that use them, and will be using them in the future, but you are free to modify the learnTime to 0.
Just remember the application really needs about an hour of market data to start making wise decisions and 10 minutes is about the least amount of current market data for it not to do crazy stuff like selling all your bitcoins at startup Wink
BCB
vip
Activity: 1078
Merit: 1002
BCJ
Thanks. 

How do I take this out of stimulation mode.  (it's currently building a market profile)

full member
Activity: 154
Merit: 102



cloned
configured
ran
collected data
traded ( in simulation mode)

Just tried to restart and got this:

Code:

forgot to add "--debug-live=true"
[/s]
Also are we messaging you trading data?

No you're not messaging any trading data or data of any kind.  I'd like you to give me a a daily P/L just so I can see how it performs on different accounts and different account sizes.  But it's up to you and you have to post it, I don't have a way of getting it.

I had considered allowing the bots to message each other with trade info, but I think it's more effort than it's worth.  Plus it may run afoul of laws against collusion & price fixing, but honestly I'm not sure.
BCB
vip
Activity: 1078
Merit: 1002
BCJ



cloned
configured
ran
collected data
traded ( in simulation mode)

Just tried to restart and got this:

Code:

forgot to add "--debug-live=true"
[/s]
Also are we messaging you trading data?
BCB
vip
Activity: 1078
Merit: 1002
BCJ
For fun I decided to create a new branch and modify the application to look at crosspair arbitrage.
It can now arbitrage trade across all 16 currency pairs, simultaneously.

You will need at least 32BTC you are willing to risk, if you want to fully test arbitrage.


*How Arbitrage Works*

Quite frequently there is a difference in the price of BTC in different currency pairs.

For instance USD/BTC rate at this moment is $11.80 whereas the EUR/BTC rate is 9.14

At the same time the USD/EUR rate is 0.77... and the EUR/USD rate is 1.29

According to the math, as of this moment, you could buy BTC in USD, then turn around and sell that same BTC back into EUR and make a tidy little profit of 0.52 EUR.  Next you buy BTC with all the 0.52EUR profit you just made and sell that BTC back to USD for a profit of 0.67USD

1 BTC = 11.80USD
1 BTC = 9.14EUR

1USD = 0.76EUR
1EUR = 1.29USD

For our purposes, the arbitrage engine would use the current trading algorithm to find the highest profit place to sell when it detects that the market conditions are right to sell.  

Buys would take place as normal, but only do so on the pair with the lowest cost real cost (BTCAsk * normalizing factor (pair1/pair2))

Let me know if anyone is interested in testing this branch.  





I'd be interested
sr. member
Activity: 252
Merit: 250
Inactive
Sep 16, 2012 11:52:52 PM org.open.payment.alliance.isis.atp.TradingAgent marketOrder
INFO: Current P/L: BTC -0.47275185 %4827.51850000
Sep 16, 2012 11:52:52 PM org.open.payment.alliance.isis.atp.TradingAgent marketOrder
INFO: Current P/L: USD 5.49177 %0.75600

my first profit was 0.00336317 btc after the bot stopped working due to 0 balance

i added more btc

The PL calculator had the wrong formula.  I'm about to fix it.  The algorithm is naive though and doesn't understand the concept of a deposit.  You mustve added 4 BTC hence the %4800 increase.

I'm about to upload a new binary that addresses the formula, but if you're going to make a deposit you will need to stop and restart the app.

Thanks for the numbers though!

Thanks for the interesting software!
full member
Activity: 154
Merit: 102
Sep 16, 2012 11:52:52 PM org.open.payment.alliance.isis.atp.TradingAgent marketOrder
INFO: Current P/L: BTC -0.47275185 %4827.51850000
Sep 16, 2012 11:52:52 PM org.open.payment.alliance.isis.atp.TradingAgent marketOrder
INFO: Current P/L: USD 5.49177 %0.75600

my first profit was 0.00336317 btc after the bot stopped working due to 0 balance

i added more btc

The PL calculator had the wrong formula.  I'm about to fix it.  The algorithm is naive though and doesn't understand the concept of a deposit.  You mustve added 4 BTC hence the %4800 increase.

I'm about to upload a new binary that addresses the formula, but if you're going to make a deposit you will need to stop and restart the app.

Thanks for the numbers though!
full member
Activity: 154
Merit: 102
I am interested. Can it use euro for profit taking intersect USD

Yeah it'll just use whatever you've got configured as your local currency for profit taking.
I could probably add a prefered currency, but it seems kinda pointless.
legendary
Activity: 1358
Merit: 1002
I am interested. Can it use euro for profit taking intersect USD
full member
Activity: 154
Merit: 102
For fun I decided to create a new branch and modify the application to look at crosspair arbitrage.
It can now arbitrage trade across all 16 currency pairs, simultaneously.

You will need at least 32BTC you are willing to risk, if you want to fully test arbitrage.


*How Arbitrage Works*

Quite frequently there is a difference in the price of BTC in different currency pairs.

For instance USD/BTC rate at this moment is $11.80 whereas the EUR/BTC rate is 9.14

At the same time the USD/EUR rate is 0.77... and the EUR/USD rate is 1.29

According to the math, as of this moment, you could buy BTC in USD, then turn around and sell that same BTC back into EUR and make a tidy little profit of 0.52 EUR.  Next you buy BTC with all the 0.52EUR profit you just made and sell that BTC back to USD for a profit of 0.67USD

1 BTC = 11.80USD
1 BTC = 9.14EUR

1USD = 0.76EUR
1EUR = 1.29USD

For our purposes, the arbitrage engine would use the current trading algorithm to find the highest profit place to sell when it detects that the market conditions are right to sell.  

Buys would take place as normal, but only do so on the pair with the lowest cost real cost (BTCAsk * normalizing factor (pair1/pair2))

Let me know if anyone is interested in testing this branch.  



full member
Activity: 154
Merit: 102
I evaluated the PL calculation by running the numbers by hand and it was incorrect.
This is why the stop loss wasn't working.  But I gutted the stop loss, so I will need to reimplement it soon.

I've now fixed the PL calculation and will be uploading shortly.  But other than stop loss the PL really isn't used for anything except maybe bragging rights.

I'm also cutting the learnTime to 10 minutes instead of an hour.  This is because trends are fairly short things and an hour can mean a huge difference in actual prices, thus increasing the probability of a loss if the system had to be restarted.
full member
Activity: 154
Merit: 102
i know some very basic java but i dont really know what i am doing. i get this error everytime i try to run isis-atp in eclipse on windows.


Code:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.155s
[INFO] Finished at: Sun Sep 16 14:02:35 CEST 2012
[INFO] Final Memory: 4M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format : or :[:]:. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-site, site, post-site, site-deploy, pre-clean, clean, post-clean. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoGoalSpecifiedException


and if i run it as a normal java project :
Code:
No config file could be found.
Beginning Interactive Mode
No console could be found, exiting application.


You need to add
 
--debug-live=true
zaj
member
Activity: 103
Merit: 10
i know some very basic java but i dont really know what i am doing. i get this error everytime i try to run isis-atp in eclipse on windows.


Code:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.155s
[INFO] Finished at: Sun Sep 16 14:02:35 CEST 2012
[INFO] Final Memory: 4M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format : or :[:]:. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-site, site, post-site, site-deploy, pre-clean, clean, post-clean. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoGoalSpecifiedException


and if i run it as a normal java project :
Code:
No config file could be found.
Beginning Interactive Mode
No console could be found, exiting application.
Pages:
Jump to: