Bitcoin Forum
September 19, 2024, 08:54:45 PM *
News: Latest Bitcoin Core release: 27.1 [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 37881 times)
pulsecat (OP)
Full Member
***
Offline Offline

Activity: 220
Merit: 100



View Profile WWW
October 23, 2013, 12:05:17 PM
Last edit: October 23, 2013, 12:20:34 PM by pulsecat
 #121

The latest release introduced few minor API changes:

To make it possible to write algorithms in a more universal way, Instrument objects can be accessed via array indexing.
Code:
  handle: (contex,data)->
     instrument = data.instruments[0] # More universal way than data['btc_usd']

Also buy/sell functions now use callback notification to handle successful trade. For example:
Code:
  instrument = data.instruments[0]
  buy instrument,null,->
    debug 'BUY order traded'
For backward compatibility, the old approach when trade functions return order id is still supported as well, but only for simulation mode.

In other words, if you are going to trade on BTC-E using any existing algorithms, review source code first and replace references like data['btc_usd'] in accordance with new approach.

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)
San1ty
Sr. Member
****
Offline Offline

Activity: 462
Merit: 250


View Profile
October 24, 2013, 01:17:30 PM
 #122

I know what a pain it is to correctly aggregate data from poorly coded API's so good job!

A couple of remarks:
- Some people don't like coffeescript (like myself), so maybe you could give us the possibility to write oldschool JS?
- I have a feeling you wrote this in Node.JS? Would you be interested in open sourcing your data collection module for bitstamp? I'd like to see how you make your candlesticks using bitstamps API :-).

Found my posts helpful? Consider buying me a beer :-)!:
BTC - 1San1tyUGhfWRNPYBF4b6Vaurq5SjFYWk NXT - 17063113680221230777
pulsecat (OP)
Full Member
***
Offline Offline

Activity: 220
Merit: 100



View Profile WWW
October 24, 2013, 04:40:25 PM
 #123

I know what a pain it is to correctly aggregate data from poorly coded API's so good job!

A couple of remarks:
- Some people don't like coffeescript (like myself), so maybe you could give us the possibility to write oldschool JS?
- I have a feeling you wrote this in Node.JS? Would you be interested in open sourcing your data collection module for bitstamp? I'd like to see how you make your candlesticks using bitstamps API :-).

Thanks for complement. I'll consider to add JS as on option. As regards releasing server side code to open source, right now i do not have plans to do this, though may change mind in the future. By the way, some client code is available at Github https://github.com/pulsecat/cryptrade the repository includes core library on which Cryptotrader based + tool for automated trading in standalone manner.


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)
itod
Legendary
*
Offline Offline

Activity: 1974
Merit: 1077


^ Will code for Bitcoins


View Profile
October 25, 2013, 03:09:47 PM
 #124

Is there some parameter that holds the trading fee for the current simulation? Needed to properly calculate, without actually buying, Buy&Hold correct amount at the end. I can always hardcode something like multiplying with 0.9945 (gives a correct amount, I've tried with demo B&H example), but is there a nicer way?

BTW, 'data.portfolio' would need some documentation, in current docs it says:
Code:
data.portfolio - Portfolio object (see below)
and below is only mentioned in example as:
Code:
portfolio.positions.usd.amount
pulsecat (OP)
Full Member
***
Offline Offline

Activity: 220
Merit: 100



View Profile WWW
October 26, 2013, 01:14:34 PM
 #125

Is there some parameter that holds the trading fee for the current simulation? Needed to properly calculate, without actually buying, Buy&Hold correct amount at the end. I can always hardcode something like multiplying with 0.9945 (gives a correct amount, I've tried with demo B&H example), but is there a nicer way?

BTW, 'data.portfolio' would need some documentation, in current docs it says:
Code:
data.portfolio - Portfolio object (see below)
and below is only mentioned in example as:
Code:
portfolio.positions.usd.amount

It is a good point. Actually, every Instrument object has 'fee' property, though it is not documented yet.
Example:
Code:
  debug "Current fee = #{data.instruments[0].fee}%"

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)
itod
Legendary
*
Offline Offline

Activity: 1974
Merit: 1077


^ Will code for Bitcoins


View Profile
October 26, 2013, 05:04:24 PM
 #126

Is there some parameter that holds the trading fee for the current simulation? Needed to properly calculate, without actually buying, Buy&Hold correct amount at the end. I can always hardcode something like multiplying with 0.9945 (gives a correct amount, I've tried with demo B&H example), but is there a nicer way?

BTW, 'data.portfolio' would need some documentation, in current docs it says:
Code:
data.portfolio - Portfolio object (see below)
and below is only mentioned in example as:
Code:
portfolio.positions.usd.amount

It is a good point. Actually, every Instrument object has 'fee' property, though it is not documented yet.
Example:
Code:
  debug "Current fee = #{data.instruments[0].fee}%"

Thanks! Now is enough documented to use it  Wink Would be nice to know if there are some useful goodies in data.portfolio, I've tried looking in the https://github.com/pulsecat/cryptrade repo for some more information but haven't found anything.
ZirconiumX
Full Member
***
Offline Offline

Activity: 286
Merit: 100



View Profile
October 29, 2013, 08:54:23 AM
Last edit: October 29, 2013, 09:12:58 AM by ZirconiumX
 #127

Is something broken with talib.MFI? I keep getting NaNs for some reason.

https://cryptotrader.org/backtests/u8FLvdu5dYpg5vLZk

Also, what happened to the automatic data update feature it had before? You used to just change the dates and periods, and whatever, and hit Backtest. Now you have to hit refresh, losing your buy/sell markers on the data, then get prompted with a window containing information you already know.

Matthew:out

itod
Legendary
*
Offline Offline

Activity: 1974
Merit: 1077


^ Will code for Bitcoins


View Profile
October 29, 2013, 10:14:48 AM
 #128

Also, what happened to the automatic data update feature it had before? You used to just change the dates and periods, and whatever, and hit Backtest. Now you have to hit refresh, losing your buy/sell markers on the data, then get prompted with a window containing information you already know.

Noticed that. Since a few days ago also happens that Backtest doesn't show all the debug data in the log, happened that the start of the simulation is missing from the log, both the text "Simulation started. Balance: XXXX USD" and some of the debug data after that were missing.
itod
Legendary
*
Offline Offline

Activity: 1974
Merit: 1077


^ Will code for Bitcoins


View Profile
October 29, 2013, 10:39:05 AM
 #129

Is something broken with talib.MFI? I keep getting NaNs for some reason.

https://cryptotrader.org/backtests/u8FLvdu5dYpg5vLZk

Seems the problem is that 'volume' array's length is 1, all others are preloaded with 100. They all have to be the same length:
https://cryptotrader.org/backtests/xmBfZWP4sj95Bb5Nr
ewibit
Legendary
*
Offline Offline

Activity: 2955
Merit: 1050


View Profile
October 29, 2013, 12:37:59 PM
 #130

Code:
npm ERR! 
npm ERR! Failed at the talib@0.2.12 preinstall script.
npm ERR! This is most likely a problem with the talib package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     cd ./src/lib && node build.js && cd ../../ && node-gyp configure && node-gyp build
npm ERR! You can get their info via:
npm ERR!     npm owner ls talib
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.11.0-12-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install"
pulsecat (OP)
Full Member
***
Offline Offline

Activity: 220
Merit: 100



View Profile WWW
November 01, 2013, 05:34:18 PM
 #131

Is something broken with talib.MFI? I keep getting NaNs for some reason.

https://cryptotrader.org/backtests/u8FLvdu5dYpg5vLZk

Also, what happened to the automatic data update feature it had before? You used to just change the dates and periods, and whatever, and hit Backtest. Now you have to hit refresh, losing your buy/sell markers on the data, then get prompted with a window containing information you already know.

Matthew:out



Agreed. This is annoying usability issue.

Also, what happened to the automatic data update feature it had before? You used to just change the dates and periods, and whatever, and hit Backtest. Now you have to hit refresh, losing your buy/sell markers on the data, then get prompted with a window containing information you already know.

Noticed that. Since a few days ago also happens that Backtest doesn't show all the debug data in the log, happened that the start of the simulation is missing from the log, both the text "Simulation started. Balance: XXXX USD" and some of the debug data after that were missing.

If you notice this problem again, please pm to me link to backtest session.

Is something broken with talib.MFI? I keep getting NaNs for some reason.

https://cryptotrader.org/backtests/u8FLvdu5dYpg5vLZk

Seems the problem is that 'volume' array's length is 1, all others are preloaded with 100. They all have to be the same length:
https://cryptotrader.org/backtests/xmBfZWP4sj95Bb5Nr

volumes - array of volume values, volume - is a current volume
Example of valid usage https://cryptotrader.org/backtests/HKbTJsagtZhQTvaX3

Code:
npm ERR! 
npm ERR! Failed at the talib@0.2.12 preinstall script.
npm ERR! This is most likely a problem with the talib package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     cd ./src/lib && node build.js && cd ../../ && node-gyp configure && node-gyp build
npm ERR! You can get their info via:
npm ERR!     npm owner ls talib
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.11.0-12-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install"

At this time command line tool is not supported officially. If you wish to run automated trading bots please consider our subscription service https://cryptotrader.org/plans

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)
pulsecat (OP)
Full Member
***
Offline Offline

Activity: 220
Merit: 100



View Profile WWW
November 03, 2013, 05:40:12 PM
 #132

Also, what happened to the automatic data update feature it had before? You used to just change the dates and periods, and whatever, and hit Backtest. Now you have to hit refresh, losing your buy/sell markers on the data, then get prompted with a window containing information you already know.

Noticed that. Since a few days ago also happens that Backtest doesn't show all the debug data in the log, happened that the start of the simulation is missing from the log, both the text "Simulation started. Balance: XXXX USD" and some of the debug data after that were missing.

Looking into the backtest results you sent to me i realized that this happened because the log size exceeds limit of 1000 records. This is needed to control amount of traffic sent to client, though i think the limit value can be increased.

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)
itod
Legendary
*
Offline Offline

Activity: 1974
Merit: 1077


^ Will code for Bitcoins


View Profile
November 03, 2013, 05:57:49 PM
 #133

Also, what happened to the automatic data update feature it had before? You used to just change the dates and periods, and whatever, and hit Backtest. Now you have to hit refresh, losing your buy/sell markers on the data, then get prompted with a window containing information you already know.

Noticed that. Since a few days ago also happens that Backtest doesn't show all the debug data in the log, happened that the start of the simulation is missing from the log, both the text "Simulation started. Balance: XXXX USD" and some of the debug data after that were missing.

Looking into the backtest results you sent to me i realized that this happened because the log size exceeds limit of 1000 records. This is needed to control amount of traffic sent to client, though i think the limit value can be increased.

OK, pulsecat, but it would be nice if the log record limit would be synchronized with the limit we hit on green refresh button right to "start at / end at" fields. If the refresh button gives us candle data this data should also fit in log IMHO. Thanks for looking into this issue.
pulsecat (OP)
Full Member
***
Offline Offline

Activity: 220
Merit: 100



View Profile WWW
November 04, 2013, 05:56:04 PM
 #134

The discussion continues here https://bitcointalk.org/index.php?topic=324871.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)
Jessi
Sr. Member
****
Offline Offline

Activity: 333
Merit: 250


View Profile WWW
November 24, 2013, 12:40:10 PM
 #135

Anybody got a simple stop loss coffeescript?

I am looking for that, too. Someone solved it already?

www.Bitcoin-Tools.de - Price Alert & Calculator [OUTDATED!]
A little tool to keep you informed or wake you up, if Mt.Gox reaches a defined price level and a calculator to convert  BTC or USD based on live Prices. It´s not working any more, because of Mt.Gox... but it was fun to code that time... keeping this link just for reminding... Thanks to everyone for donations done that time!
BTC: 1BQTankpeCZict849JRHxxYFnwZARV3YX7 | LTC: LecEsSJMYZK7wk493QvyNzA4BxHpXviAEA | PPC: PQdjfxTbjnXThwJ5bbEgJkc9GZcKpib9DM
pulsecat (OP)
Full Member
***
Offline Offline

Activity: 220
Merit: 100



View Profile WWW
November 24, 2013, 01:18:35 PM
 #136

Anybody got a simple stop loss coffeescript?

I am looking for that, too. Someone solved it already?


Have a look https://cryptotrader.org/topics/107666/tutorial-bot-stop-loss

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)
Jessi
Sr. Member
****
Offline Offline

Activity: 333
Merit: 250


View Profile WWW
November 24, 2013, 03:23:05 PM
 #137

Thank you very much. I´ll give it a try. Smiley

www.Bitcoin-Tools.de - Price Alert & Calculator [OUTDATED!]
A little tool to keep you informed or wake you up, if Mt.Gox reaches a defined price level and a calculator to convert  BTC or USD based on live Prices. It´s not working any more, because of Mt.Gox... but it was fun to code that time... keeping this link just for reminding... Thanks to everyone for donations done that time!
BTC: 1BQTankpeCZict849JRHxxYFnwZARV3YX7 | LTC: LecEsSJMYZK7wk493QvyNzA4BxHpXviAEA | PPC: PQdjfxTbjnXThwJ5bbEgJkc9GZcKpib9DM
ZirconiumX
Full Member
***
Offline Offline

Activity: 286
Merit: 100



View Profile
November 24, 2013, 03:51:08 PM
 #138


Yay, pulsecat recommended my tutorial bot!

It's got a few bugs which need to be ironed out, but since it isn't meant for serious use, then it shouldn't matter greatly.

Matthew:out
jasonxion
Newbie
*
Offline Offline

Activity: 12
Merit: 0


View Profile
December 24, 2013, 12:17:23 AM
Last edit: December 24, 2013, 01:09:20 AM by jasonxion
 #139

Code:
        ...
        orderId = buy instrument # Spend all amount of cash for BTC
        if orderId
           # a buy was executed
           context.buy_price = instrument.price
           ...
I am trying to do something similar and build on a simple script.
However no matter what I do I can not keep the instrument.price stored.


#Simple buy and sell over price with EMA
init: (context)->
    context.buy_price = 0

handle: (context, data)->
    instrument = data.instruments[0]
    short = instrument.ema(9)
    long = instrument.ema(19)
    plot
        short: short
        long: long
    if short > long
        buy instrument #works up to here
        context.buy_price = instrument.price #The sell fails by not selling the instrument over the (purchased) price
    else if  context.buy_price > (instrument.price*1.01)
        orderId = sell instrument

I assume it has to do with the iff statements, because I can get the sell to work but then the buy just buys as soon as the script starts.
Thanks for any ideas and help.
berrycorp
Newbie
*
Offline Offline

Activity: 17
Merit: 0


View Profile
December 27, 2013, 07:42:19 AM
 #140

I was trying to upgrade my account and I got : We're sorry. New subscriptions are not available at this time.

How can i get a new subscription?
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!