pulsecat (OP)
|
|
October 23, 2013, 12:05:17 PM Last edit: October 23, 2013, 12:20:34 PM by pulsecat |
|
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. 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: 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.
|
|
|
|
San1ty
|
|
October 24, 2013, 01:17:30 PM |
|
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)
|
|
October 24, 2013, 04:40:25 PM |
|
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.
|
|
|
|
itod
Legendary
Offline
Activity: 1974
Merit: 1077
^ Will code for Bitcoins
|
|
October 25, 2013, 03:09:47 PM |
|
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: data.portfolio - Portfolio object (see below) and below is only mentioned in example as: portfolio.positions.usd.amount
|
|
|
|
pulsecat (OP)
|
|
October 26, 2013, 01:14:34 PM |
|
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: data.portfolio - Portfolio object (see below) and below is only mentioned in example as: portfolio.positions.usd.amount It is a good point. Actually, every Instrument object has 'fee' property, though it is not documented yet. Example: debug "Current fee = #{data.instruments[0].fee}%"
|
|
|
|
itod
Legendary
Offline
Activity: 1974
Merit: 1077
^ Will code for Bitcoins
|
|
October 26, 2013, 05:04:24 PM |
|
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: data.portfolio - Portfolio object (see below) and below is only mentioned in example as: portfolio.positions.usd.amount It is a good point. Actually, every Instrument object has 'fee' property, though it is not documented yet. Example: debug "Current fee = #{data.instruments[0].fee}%"
Thanks! Now is enough documented to use it 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
|
|
October 29, 2013, 08:54:23 AM Last edit: October 29, 2013, 09:12:58 AM by ZirconiumX |
|
Is something broken with talib.MFI? I keep getting NaNs for some reason. https://cryptotrader.org/backtests/u8FLvdu5dYpg5vLZkAlso, 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
Activity: 1974
Merit: 1077
^ Will code for Bitcoins
|
|
October 29, 2013, 10:14:48 AM |
|
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
Activity: 1974
Merit: 1077
^ Will code for Bitcoins
|
|
October 29, 2013, 10:39:05 AM |
|
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
Activity: 2955
Merit: 1050
|
|
October 29, 2013, 12:37:59 PM |
|
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)
|
|
November 01, 2013, 05:34:18 PM |
|
Is something broken with talib.MFI? I keep getting NaNs for some reason. https://cryptotrader.org/backtests/u8FLvdu5dYpg5vLZkAlso, 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. volumes - array of volume values, volume - is a current volume Example of valid usage https://cryptotrader.org/backtests/HKbTJsagtZhQTvaX3npm 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
|
|
|
|
pulsecat (OP)
|
|
November 03, 2013, 05:40:12 PM |
|
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.
|
|
|
|
itod
Legendary
Offline
Activity: 1974
Merit: 1077
^ Will code for Bitcoins
|
|
November 03, 2013, 05:57:49 PM |
|
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)
|
|
November 04, 2013, 05:56:04 PM |
|
|
|
|
|
Jessi
|
|
November 24, 2013, 12:40:10 PM |
|
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
|
|
|
|
Jessi
|
|
November 24, 2013, 03:23:05 PM |
|
Thank you very much. I´ll give it a try.
|
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
|
|
November 24, 2013, 03:51:08 PM |
|
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
Activity: 12
Merit: 0
|
|
December 24, 2013, 12:17:23 AM Last edit: December 24, 2013, 01:09:20 AM by jasonxion |
|
... 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
Activity: 17
Merit: 0
|
|
December 27, 2013, 07:42:19 AM |
|
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?
|
|
|
|
|