Bitcoin Forum
June 30, 2024, 09:17:40 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 [3] 4 5 6 7 8 9 »  All
  Print  
Author Topic: CryptoTrader.org - First Web-based Algorithmic Trading Platform for Bitcoin  (Read 37857 times)
pulsecat (OP)
Full Member
***
Offline Offline

Activity: 220
Merit: 100



View Profile WWW
July 19, 2013, 02:42:49 PM
 #41

wohoo, works :-)

Here's another one:
Say I would want to output some kind of additional statistics at the end of the simulation (total number of trades, trades triggererd by each mechanism, number of successful / unsuccessful trades etc..) I could add context.counter values for each of these.
Is there a method that gets called at the end of the simulation to finally output these values?

No, but i agree this is a feature worth adding.

CryptoTrader.org - Cloud-based Automated Trading on Bitstamp/BTC-E/CEX.IO/Bitfinex/Kraken | Discussion topic at Bitcointalk.org | Automated Trading Contest (Prize 2 BTC)
1Pakis
Full Member
***
Offline Offline

Activity: 227
Merit: 100



View Profile
July 20, 2013, 07:44:55 AM
 #42

check this
http://cryptotrader.org/backtests/tKzwFFGYRWXTMoNEB

Tips are welcome at this address 18DVZkpSwmejPjekX3QMKvRRtR8Bfx65LN.
pulsecat (OP)
Full Member
***
Offline Offline

Activity: 220
Merit: 100



View Profile WWW
July 20, 2013, 10:18:06 AM
Last edit: July 20, 2013, 12:37:03 PM by pulsecat
 #43

Update
- Support for 2H bars
- Web client reloads gracefully upon the server restart
- Fixed bug in portfolio that caused wrong calculations for balanced portfolios
- API: Finalize  - an optional hook method called after a simulation ends. Credit to Diabolicus for this idea.
- Documentation update

CryptoTrader.org - Cloud-based Automated Trading on Bitstamp/BTC-E/CEX.IO/Bitfinex/Kraken | Discussion topic at Bitcointalk.org | Automated Trading Contest (Prize 2 BTC)
ErebusBat
Hero Member
*****
Offline Offline

Activity: 560
Merit: 500

I am the one who knocks


View Profile
July 20, 2013, 01:11:50 PM
 #44

Very interesting, the H4 almost doubles return over H2. 

░▒▓█ Coinroll.it - 1% House Edge Dice Game █▓▒░ • Coinroll Thread • *FREE* 100 BTC Raffle

Signup for CEX.io BitFury exchange and get GHS Instantly!  Don't wait for shipping, mine NOW!
Diabolicus
Member
**
Offline Offline

Activity: 90
Merit: 10


View Profile
July 21, 2013, 04:22:52 PM
 #45

Very interesting, the H4 almost doubles return over H2. 

I think for the next few weeks / months we can still expect a bear market or at least a consolidation, so it doesn't make so much sense to backtest strategies on old data from pre bubble bull market times if your primary aim is to avoid losses rather than maximize profits. If you limit it to the past 2 months instead you will see that the H2 outperforms the H4 again, at least with your settings: http://cryptotrader.org/backtests/CaSqHQo4yMmWsfGDf
MusX
Full Member
***
Offline Offline

Activity: 175
Merit: 100


View Profile
July 22, 2013, 03:12:42 PM
 #46

what is the logical formula to estimate the price of executed buy/sell for particular buy/sell signals?

pulsecat (OP)
Full Member
***
Offline Offline

Activity: 220
Merit: 100



View Profile WWW
July 22, 2013, 04:25:06 PM
 #47

what is the logical formula to estimate the price of executed buy/sell for particular buy/sell signals?

If I got your question correctly:
Code:
Trade price = Close price for the current bar + Trading fee

Remember, this is only a simulation so the formula does not consider slippage and other real trading costs.

CryptoTrader.org - Cloud-based Automated Trading on Bitstamp/BTC-E/CEX.IO/Bitfinex/Kraken | Discussion topic at Bitcointalk.org | Automated Trading Contest (Prize 2 BTC)
MusX
Full Member
***
Offline Offline

Activity: 175
Merit: 100


View Profile
July 22, 2013, 07:26:07 PM
 #48

what is the logical formula to estimate the price of executed buy/sell for particular buy/sell signals?

If I got your question correctly:
Code:
Trade price = Close price for the current bar + Trading fee

Remember, this is only a simulation so the formula does not consider slippage and other real trading costs.
so I think you should alter this formula, when you got your buy/sell signal the current bar is already closed one (you cannot calculate signal for not closed period), so you get a signal while next bar is the "current bar", the more correct formula would be to use average price from the next bar, it is still not sure if you will be able to buy/sell all the BTC you are placing order during the time of the next bar, but it is the most correct estimation imo.

pulsecat (OP)
Full Member
***
Offline Offline

Activity: 220
Merit: 100



View Profile WWW
July 23, 2013, 03:49:43 PM
Last edit: July 23, 2013, 04:01:39 PM by pulsecat
 #49

what is the logical formula to estimate the price of executed buy/sell for particular buy/sell signals?

If I got your question correctly:
Code:
Trade price = Close price for the current bar + Trading fee

Remember, this is only a simulation so the formula does not consider slippage and other real trading costs.
so I think you should alter this formula, when you got your buy/sell signal the current bar is already closed one (you cannot calculate signal for not closed period), so you get a signal while next bar is the "current bar", the more correct formula would be to use average price from the next bar, it is still not sure if you will be able to buy/sell all the BTC you are placing order during the time of the next bar, but it is the most correct estimation imo.

Once the bar is closed, an algorithm handles it immediately. At this point:
- Close price is the most recent price (simulation engine uses it to calculate simulated purchase prices internally)
- The next bar is not calculated yet. Allowing an algorithm to access trading data from the future, contradicts the idea of technical analysis in my opinion.

By the way, we have an ongoing contest for those who are interested in algorithmic trading https://bitcointalk.org/index.php?topic=261086.0.

CryptoTrader.org - Cloud-based Automated Trading on Bitstamp/BTC-E/CEX.IO/Bitfinex/Kraken | Discussion topic at Bitcointalk.org | Automated Trading Contest (Prize 2 BTC)
MusX
Full Member
***
Offline Offline

Activity: 175
Merit: 100


View Profile
July 23, 2013, 10:25:20 PM
 #50

Once the bar is closed, an algorithm handles it immediately.
if you will have bars in 1min or 30s? it will not be as immediate as it is now.
you cannot buy for average price of current bar because that period is just closed, you buy on the next bar avg price, your trade is being aggregated to this next bar.
That's why you are counting the price as next bar. You can perform simulation based on real executed price of orders ~ estimated by both methods with lag/with no lag.

whydifficult
Sr. Member
****
Offline Offline

Activity: 287
Merit: 250



View Profile WWW
July 24, 2013, 10:54:09 AM
Last edit: July 24, 2013, 01:35:35 PM by whydifficult
 #51

Once the bar is closed, an algorithm handles it immediately.
if you will have bars in 1min or 30s? it will not be as immediate as it is now.
you cannot buy for average price of current bar because that period is just closed, you buy on the next bar avg price, your trade is being aggregated to this next bar.
That's why you are counting the price as next bar. You can perform simulation based on real executed price of orders ~ estimated by both methods with lag/with no lag.

When you have 30 minutes bar the engine will trigger when a bar closes, within a very short amount the engine will determine whether it needs to change the portfolio (and if to buy or sell to reflect this). This will all probably happen within 1 second after the bar closed, with the low liquidity in the BTC market I really don't think the effects are big. And if they are I don't see how the average price of the next bar is any better price indicator as a lot can happen after in the 29 minutes and 59 seconds after the decision (maybe the open of the next candle would be a little better but I really don't see it right now).

About the lag: I don't know if this data is available at all, but it is not going to help you much: when there is a 10 second lag it means the trading engine is lagging 10 seconds behind. All orders from between 10 seconds ago and now are queued and they are probably not available, so they are unknown at the time you make your decision (not 100% sure, maybe there are in the order book already).

If I got your question correctly:
Code:
Trade price = Close price for the current bar + Trading fee

Remember, this is only a simulation so the formula does not consider slippage and other real trading costs.

I don't agree on your price calculation: While the trading fee obviously needs to be payed while ordering, the alpha (EMA/MACD indicator) is only responsible for detecting the trend, you are now manipulating the data so that trends happening do not get properly detected IMO (difference is pretty small, but it's there).

This is a hard problem because the current alpha (a simple trend indicator) can't tell you anything about how long a trend will probably last (statistically) or how much the price will change. If you would have a model predicting this you can better determine if you should reposition your portfolio while taking fees into account. My bot only uses the fees to simulate the profit, it does not use them to determine what position to take.


EDIT: It appears I failed to read properly.

Gekko a nodejs bitcoin trading bot!
Realtime Bitcoin Globe - visualizing all transactions and blocks
Tip jar (BTC): 1KyQdQ9ctjCrGjGRCWSBhPKcj5omy4gv5S
pulsecat (OP)
Full Member
***
Offline Offline

Activity: 220
Merit: 100



View Profile WWW
July 24, 2013, 12:51:58 PM
 #52

I don't agree on your price calculation: While the trading fee obviously needs to be payed while ordering, the alpha (EMA/MACD indicator) is only responsible for detecting the trend, you are now manipulating the data so that trends happening do not get properly detected IMO (difference is pretty small, but it's there).

This is a hard problem because the current alpha (a simple trend indicator) can't tell you anything about how long a trend will probably last (statistically) or how much the price will change. If you would have a model predicting this you can better determine if you should reposition your portfolio while taking fees into account. My bot only uses the fees to simulate the profit, it does not use them to determine what position to take.

I think there has been misunderstanding about my explanation, as i tried to explain how internal calculation of a simulated purchase is done, but not how trends are detected. By default EMA is calculated based on Close price as it is suggested in TA-lib documenation:
Code:
instrument = data.btc_usd
result = talib.EMA
  startIdx: 0
  endIdx: instrument.close.length-1
  inReal: instrument.close
  optInTimePeriod: period
value = _.last(result)

However, in your algorithm at Cryptotrader you can use any market data from the past as the inputs for TA-Lib functions.

CryptoTrader.org - Cloud-based Automated Trading on Bitstamp/BTC-E/CEX.IO/Bitfinex/Kraken | Discussion topic at Bitcointalk.org | Automated Trading Contest (Prize 2 BTC)
MusX
Full Member
***
Offline Offline

Activity: 175
Merit: 100


View Profile
July 24, 2013, 01:11:05 PM
 #53

Once the bar is closed, an algorithm handles it immediately.
if you will have bars in 1min or 30s? it will not be as immediate as it is now.
you cannot buy for average price of current bar because that period is just closed, you buy on the next bar avg price, your trade is being aggregated to this next bar.
That's why you are counting the price as next bar. You can perform simulation based on real executed price of orders ~ estimated by both methods with lag/with no lag.

When you have 30 minutes bar the engine will trigger when a bar closes, within a very short amount the engine will determine whether it needs to change the portfolio (and if to buy or sell to reflect this). This will all probably happen within 1 second after the bar closed, with the low liquidity in the BTC market I really don't think the effects are big. And if they are I don't see how the average price of the next bar is any better price indicator as a lot can happen after in the 29 minutes and 59 seconds after the decision (maybe the open of the next candle would be a little better but I really don't see it right now).

About the lag: I don't know if this data is available at all, but it is not going to help you much: when there is a 10 second lag it means the trading engine is lagging 10 seconds behind. All orders from between 10 seconds ago and now are queued and they are probably not available, so they are unknown at the time you make your decision (not 100% sure, maybe there are in the order book already).

If I got your question correctly:
Code:
Trade price = Close price for the current bar + Trading fee

Remember, this is only a simulation so the formula does not consider slippage and other real trading costs.

I don't agree on your price calculation: While the trading fee obviously needs to be payed while ordering, the alpha (EMA/MACD indicator) is only responsible for detecting the trend, you are now manipulating the data so that trends happening do not get properly detected IMO (difference is pretty small, but it's there).

This is a hard problem because the current alpha (a simple trend indicator) can't tell you anything about how long a trend will probably last (statistically) or how much the price will change. If you would have a model predicting this you can better determine if you should reposition your portfolio while taking fees into account. My bot only uses the fees to simulate the profit, it does not use them to determine what position to take.
first. by lag I meant lag of executing signal after time period is closed and ready to calculate.
second. I prefer to use next bar price from the very clear reason: your buy/sell action price will be aggregated to the next bar period, not to the previous on which signal was calculated. "Open" price of the next bar should be more correct in your case. Another thing you should keep in mind that signal calculations might be much more time consuming than just EMA crossing and would not be executed right after the period is closed.

whydifficult
Sr. Member
****
Offline Offline

Activity: 287
Merit: 250



View Profile WWW
July 24, 2013, 01:32:38 PM
 #54

I think there has been misunderstanding about my explanation, as i tried to explain how internal calculation of a simulated purchase is done, but not how trends are detected.

Oops my bad, I read it to quick probably Sad

Gekko a nodejs bitcoin trading bot!
Realtime Bitcoin Globe - visualizing all transactions and blocks
Tip jar (BTC): 1KyQdQ9ctjCrGjGRCWSBhPKcj5omy4gv5S
pulsecat (OP)
Full Member
***
Offline Offline

Activity: 220
Merit: 100



View Profile WWW
July 24, 2013, 02:11:06 PM
 #55

first. by lag I meant lag of executing signal after time period is closed and ready to calculate.
second. I prefer to use next bar price from the very clear reason: your buy/sell action price will be aggregated to the next bar period, not to the previous on which signal was calculated. "Open" price of the next bar should be more correct in your case. Another thing you should keep in mind that signal calculations might be much more time consuming than just EMA crossing and would not be executed right after the period is closed.

As most candlestick generators assume open price to be equal the close price from the previous bar, it turns out the algorithms at Cryptotrader handle market data correctly.

CryptoTrader.org - Cloud-based Automated Trading on Bitstamp/BTC-E/CEX.IO/Bitfinex/Kraken | Discussion topic at Bitcointalk.org | Automated Trading Contest (Prize 2 BTC)
whydifficult
Sr. Member
****
Offline Offline

Activity: 287
Merit: 250



View Profile WWW
July 24, 2013, 04:14:42 PM
 #56

As most candlestick generators assume open price to be equal the close price from the previous bar, it turns out the algorithms at Cryptotrader handle market data correctly.

In traditional trading (markets that open in the morning and close in the afternoon) it happens quite often that the close of the previous day is lower / higher than the open of the new day.



Markets like BTC/USD don't close at all but I have seen candles where the open and the close were not the same at all.

Gekko a nodejs bitcoin trading bot!
Realtime Bitcoin Globe - visualizing all transactions and blocks
Tip jar (BTC): 1KyQdQ9ctjCrGjGRCWSBhPKcj5omy4gv5S
pulsecat (OP)
Full Member
***
Offline Offline

Activity: 220
Merit: 100



View Profile WWW
July 31, 2013, 10:45:56 AM
Last edit: July 31, 2013, 01:21:06 PM by pulsecat
 #57

New update
  • fixed the problem with connection via websockets that caused poor performance and errors in many browser configurations.
  • Live mode that provides very basic support for Paper trading. Any backtested algorithm can be executed in Paper trading mode by clicking 'Live' button. Once started, an algorithm(trader) handles real-time market data to simulate trading and trigger alerts. Trading algorithms can be managed at https://cryptotrader.org/live page.
  • API: Email alerts -  allows email messages to be sent from your code.
Quote
sendEmail(message) (only Live mode)
Sends an email message to the user who started the algorithm in Live mode. The user's email address must be valid and verified. In the simulation mode does nothing.

Example:
Code:
# simple price alert
handle: (contex,data)->
  ...
  if data.btc_usd.price >= 100
    sendEmail 'The price hit $100'

CryptoTrader.org - Cloud-based Automated Trading on Bitstamp/BTC-E/CEX.IO/Bitfinex/Kraken | Discussion topic at Bitcointalk.org | Automated Trading Contest (Prize 2 BTC)
Diabolicus
Member
**
Offline Offline

Activity: 90
Merit: 10


View Profile
July 31, 2013, 01:09:15 PM
 #58

This is great!
Thanks

How do I set the name for a Trader?
Can you add something similar for Backtests as well, so one can have a collection of trading strategies? Right now bookmarking everything manually is kind of tedious ..
pulsecat (OP)
Full Member
***
Offline Offline

Activity: 220
Merit: 100



View Profile WWW
July 31, 2013, 05:43:04 PM
 #59

This is great!
Thanks

How do I set the name for a Trader?
Can you add something similar for Backtests as well, so one can have a collection of trading strategies? Right now bookmarking everything manually is kind of tedious ..

Thanks for feedback! The features you are asking for will be added in the next release.

CryptoTrader.org - Cloud-based Automated Trading on Bitstamp/BTC-E/CEX.IO/Bitfinex/Kraken | Discussion topic at Bitcointalk.org | Automated Trading Contest (Prize 2 BTC)
marvinrouge
Sr. Member
****
Offline Offline

Activity: 378
Merit: 250



View Profile
August 01, 2013, 07:10:56 PM
Last edit: August 01, 2013, 07:45:27 PM by marvinrouge
 #60

A simple idea (but I don't know if it's easy to make) : it could be great to have graphical representation of the BUY and SELL entry points, like this :



Would be a quick way to see if a strategy works
Pages: « 1 2 [3] 4 5 6 7 8 9 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!