Bitcoin Forum
May 12, 2024, 08:04:22 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 [10] 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 »
  Print  
Author Topic: Gekko - a javascript trading bot and backtesting platform  (Read 147807 times)
whydifficult (OP)
Sr. Member
****
Offline Offline

Activity: 287
Merit: 250



View Profile WWW
July 30, 2013, 08:34:53 AM
 #181

Hi,

Using MtGox, I get NaN errors when using EUR...
USD seems to be working fine.

Enabled verbose to check what's going on. With USD I get:
Code:
2013-07-30 09:59:29 (DEBUG):    calced EMA properties for new candle:
2013-07-30 09:59:29 (DEBUG):             short ema 101.048
2013-07-30 09:59:29 (DEBUG):             long ema 101.037
2013-07-30 09:59:29 (DEBUG):             diff ema 0.010
2013-07-30 09:59:29 (DEBUG):    fetching new trades for new bucket at Mt. Gox
2013-07-30 09:59:31 (DEBUG):    calculated candle: 0
2013-07-30 09:59:31 (DEBUG):    calced EMA properties for new candle:
2013-07-30 09:59:31 (DEBUG):             short ema 101.038
2013-07-30 09:59:31 (DEBUG):             long ema 101.033
2013-07-30 09:59:31 (DEBUG):             diff ema 0.005
2013-07-30 09:59:31 (DEBUG):    we are currently not in an up or down trend @ 100.981 (0.005)

When changing to EUR, I get something like:
Code:
2013-07-30 10:04:03 (DEBUG):    calculated candle: 1
2013-07-30 10:04:03 (DEBUG):    calced EMA properties for new candle:
2013-07-30 10:04:03 (DEBUG):             short ema NaN
2013-07-30 10:04:03 (DEBUG):             long ema NaN
2013-07-30 10:04:03 (DEBUG):             diff ema NaN
2013-07-30 10:04:03 (DEBUG):    fetching new trades for new bucket at Mt. Gox
2013-07-30 10:04:04 (DEBUG):    calculated candle: 0
2013-07-30 10:04:04 (DEBUG):    calced EMA properties for new candle:
2013-07-30 10:04:04 (DEBUG):             short ema NaN
2013-07-30 10:04:04 (DEBUG):             long ema NaN
2013-07-30 10:04:04 (DEBUG):             diff ema NaN
2013-07-30 10:04:04 (DEBUG):    we are currently not in an up or down trend @ 75.500 (NaN)

This is the config I changed:
Code:
config.normal = {
  enabled: true,
  exchange: 'MtGox', // 'MtGox', 'BTCe' or 'Bitstamp'
  currency: 'EUR',
  asset: 'BTC',
  tradingEnabled: false,
Simply changed the currency in there - and then the error appears.


Anybody had this issue?


What is the interval you have set? The volatility is very low at the moment, any time Gekko encouters an interval in which there were no trades this happens. So al small interval will trigger this sooner. See below:

Code:
realtime-candle-fetcher.js:98
    throw 'Failed to load historical trades from ' + this.watcher.name;
                                                   ^
Failed to load historical trades from bitcoincharts

I have been getting this all weekend for Bitstamp too.  

Gekko is currently not dependent on external factors (besides the exchange APIs and bitcoincharts for BTC-e), this is great and I want to keep it like this for as long as possible. But with the recent problems I am facing I am going to calculate candles on my server expose those to Gekko/the world (it stays optional).

This solves a lot of small issues:

  • No 'failed to load data from exchange X'
  • No sudden API changes exposed to Gekko
  • Able to keep track of a lot of exchanges, even those without a historical data API. This finally means altcoins as well!
  • Way more efficient: This way the candles are only calculated once and everyone uses that directly

Problems:

  • If for whatever reason I can't fetch the candles no one using Gekko is able to (paper) trade
  • Central point of failure
  • I have to pay for the server / bandwidth, if I can't it will be shutdown
  • It's going to be hard to offer different non-standard intervals

I set up a script that is watching a bunch of exchanges with different currency pairs at the moment.Those can all be exposed to Gekko (assuming the exchanges have trading APIs) I am currently watching:

Code:
> show collections
bit2c_BTC/NIS
bitstamp_BTC/USD
btcchina_BTC/CNY
btce_BTC/EUR
btce_BTC/RUR
btce_BTC/USD
btce_EUR/USD
btce_FTC/BTC
btce_LTC/BTC
btce_LTC/RUR
btce_NMC/BTC
btce_NVC/BTC
btce_PPC/BTC
btce_TRC/BTC
btce_USD/RUR
bter_BQC/BTC
bter_BQC/CNY
bter_BQC/LTC
bter_BTB/BTC
bter_BTC/CNY
bter_CNC/BTC
bter_CNC/CNY
bter_CNC/LTC
bter_FRC/BTC
bter_FRC/CNY
bter_FRC/LTC
bter_FTC/BTC
bter_FTC/CNY
bter_FTC/LTC
bter_LTC/BTC
bter_LTC/CNY
bter_MYMINER/BTC
bter_NMC/BTC
bter_NME/LTC
bter_PPC/BTC
bter_PPC/CNY
bter_PPC/LTC
bter_TRC/BTC
bter_TRC/CNY
bter_TRC/LTC
bter_WDC/BTC
bter_WDC/CNY
bter_WDC/LTC
bter_YAC/BTC
bter_YAC/CNY
cryptsy_ALF/BTC
cryptsy_AMC/BTC
cryptsy_ANC/BTC
cryptsy_ARG/BTC
cryptsy_BQC/BTC
cryptsy_BTB/BTC
cryptsy_BTE/BTC
cryptsy_BTG/BTC
cryptsy_CAP/BTC
cryptsy_CGB/BTC
cryptsy_CNC/BTC
cryptsy_CRC/BTC
cryptsy_CSC/BTC
cryptsy_DBL/LTC
cryptsy_DGC/BTC
cryptsy_DMD/BTC
cryptsy_DVC/LTC
cryptsy_ELC/BTC
cryptsy_EMD/BTC
cryptsy_EZC/LTC
cryptsy_FLO/LTC
cryptsy_FRC/BTC
cryptsy_FRK/BTC
cryptsy_FST/BTC
cryptsy_FTC/BTC
cryptsy_GLD/LTC
cryptsy_HYC/BTC
cryptsy_IFC/LTC
cryptsy_IXC/BTC
cryptsy_JKC/LTC
cryptsy_KGC/BTC
cryptsy_LKY/BTC
cryptsy_LTC/BTC
cryptsy_MEC/BTC
cryptsy_MEM/LTC
cryptsy_MNC/BTC
cryptsy_MST/LTC
cryptsy_NAN/BTC
cryptsy_NBL/BTC
cryptsy_NMC/BTC
cryptsy_NRB/BTC
cryptsy_NVC/BTC
cryptsy_PPC/BTC
cryptsy_PXC/BTC
cryptsy_QRK/BTC
cryptsy_RYC/LTC
cryptsy_SBC/BTC
cryptsy_TRC/BTC
cryptsy_WDC/BTC
cryptsy_XNC/LTC
cryptsy_XPM/BTC
cryptsy_YAC/BTC
fxbtc_BTC/CNY
fxbtc_LTC/BTC
fxbtc_LTC/CNY
mtgox_BTC/AUD
mtgox_BTC/BTC
mtgox_BTC/CAD
mtgox_BTC/CHF
mtgox_BTC/CNY
mtgox_BTC/CZK
mtgox_BTC/DKK
mtgox_BTC/EUR
mtgox_BTC/GBP
mtgox_BTC/HKD
mtgox_BTC/JPY
mtgox_BTC/NOK
mtgox_BTC/NZD
mtgox_BTC/PLN
mtgox_BTC/RUB
mtgox_BTC/SEK
mtgox_BTC/SGD
mtgox_BTC/THB
mtgox_BTC/USD
mtgox_USD/BTC
vircurex_BTC/DGC
vircurex_BTC/DVC
vircurex_BTC/FRC
vircurex_BTC/FTC
vircurex_BTC/IXC
vircurex_BTC/LTC
vircurex_BTC/NMC
vircurex_BTC/NVC
vircurex_BTC/PPC
vircurex_BTC/RUR
vircurex_BTC/TRC
vircurex_BTC/USD
vircurex_BTC/XPM
virwox_BTC/SLL

It's been running for a day or something and I currently have 120k trades stored (this does not include historical data).

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

Posts: 1715501062

View Profile Personal Message (Offline)

Ignore
1715501062
Reply with quote  #2

1715501062
Report to moderator
1715501062
Hero Member
*
Offline Offline

Posts: 1715501062

View Profile Personal Message (Offline)

Ignore
1715501062
Reply with quote  #2

1715501062
Report to moderator
1715501062
Hero Member
*
Offline Offline

Posts: 1715501062

View Profile Personal Message (Offline)

Ignore
1715501062
Reply with quote  #2

1715501062
Report to moderator
The network tries to produce one block per 10 minutes. It does this by automatically adjusting how difficult it is to produce blocks.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715501062
Hero Member
*
Offline Offline

Posts: 1715501062

View Profile Personal Message (Offline)

Ignore
1715501062
Reply with quote  #2

1715501062
Report to moderator
ErebusBat
Hero Member
*****
Offline Offline

Activity: 560
Merit: 500

I am the one who knocks


View Profile
July 30, 2013, 12:29:37 PM
 #182

Code:
realtime-candle-fetcher.js:98
    throw 'Failed to load historical trades from ' + this.watcher.name;
                                                   ^
Failed to load historical trades from bitcoincharts

I have been getting this all weekend for Bitstamp too.  

Gekko is currently not dependent on external factors (besides the exchange APIs and bitcoincharts for BTC-e), this is great and I want to keep it like this for as long as possible. But with the recent problems I am facing I am going to calculate candles on my server expose those to Gekko/the world (it stays optional).

This solves a lot of small issues:

  • No 'failed to load data from exchange X'
  • No sudden API changes exposed to Gekko
  • Able to keep track of a lot of exchanges, even those without a historical data API. This finally means altcoins as well!
  • Way more efficient: This way the candles are only calculated once and everyone uses that directly

Problems:

  • If for whatever reason I can't fetch the candles no one using Gekko is able to (paper) trade
  • Central point of failure
  • I have to pay for the server / bandwidth, if I can't it will be shutdown
  • It's going to be hard to offer different non-standard intervals

I set up a script that is watching a bunch of exchanges with different currency pairs at the moment.Those can all be exposed to Gekko (assuming the exchanges have trading APIs) I am currently watching:

Code:
> show collections
bit2c_BTC/NIS
bitstamp_BTC/USD
btcchina_BTC/CNY
btce_BTC/EUR
btce_BTC/RUR
btce_BTC/USD
btce_EUR/USD
btce_FTC/BTC
btce_LTC/BTC
btce_LTC/RUR
btce_NMC/BTC
btce_NVC/BTC
btce_PPC/BTC
btce_TRC/BTC
btce_USD/RUR
bter_BQC/BTC
bter_BQC/CNY
bter_BQC/LTC
bter_BTB/BTC
bter_BTC/CNY
bter_CNC/BTC
bter_CNC/CNY
bter_CNC/LTC
bter_FRC/BTC
bter_FRC/CNY
bter_FRC/LTC
bter_FTC/BTC
bter_FTC/CNY
bter_FTC/LTC
bter_LTC/BTC
bter_LTC/CNY
bter_MYMINER/BTC
bter_NMC/BTC
bter_NME/LTC
bter_PPC/BTC
bter_PPC/CNY
bter_PPC/LTC
bter_TRC/BTC
bter_TRC/CNY
bter_TRC/LTC
bter_WDC/BTC
bter_WDC/CNY
bter_WDC/LTC
bter_YAC/BTC
bter_YAC/CNY
cryptsy_ALF/BTC
cryptsy_AMC/BTC
cryptsy_ANC/BTC
cryptsy_ARG/BTC
cryptsy_BQC/BTC
cryptsy_BTB/BTC
cryptsy_BTE/BTC
cryptsy_BTG/BTC
cryptsy_CAP/BTC
cryptsy_CGB/BTC
cryptsy_CNC/BTC
cryptsy_CRC/BTC
cryptsy_CSC/BTC
cryptsy_DBL/LTC
cryptsy_DGC/BTC
cryptsy_DMD/BTC
cryptsy_DVC/LTC
cryptsy_ELC/BTC
cryptsy_EMD/BTC
cryptsy_EZC/LTC
cryptsy_FLO/LTC
cryptsy_FRC/BTC
cryptsy_FRK/BTC
cryptsy_FST/BTC
cryptsy_FTC/BTC
cryptsy_GLD/LTC
cryptsy_HYC/BTC
cryptsy_IFC/LTC
cryptsy_IXC/BTC
cryptsy_JKC/LTC
cryptsy_KGC/BTC
cryptsy_LKY/BTC
cryptsy_LTC/BTC
cryptsy_MEC/BTC
cryptsy_MEM/LTC
cryptsy_MNC/BTC
cryptsy_MST/LTC
cryptsy_NAN/BTC
cryptsy_NBL/BTC
cryptsy_NMC/BTC
cryptsy_NRB/BTC
cryptsy_NVC/BTC
cryptsy_PPC/BTC
cryptsy_PXC/BTC
cryptsy_QRK/BTC
cryptsy_RYC/LTC
cryptsy_SBC/BTC
cryptsy_TRC/BTC
cryptsy_WDC/BTC
cryptsy_XNC/LTC
cryptsy_XPM/BTC
cryptsy_YAC/BTC
fxbtc_BTC/CNY
fxbtc_LTC/BTC
fxbtc_LTC/CNY
mtgox_BTC/AUD
mtgox_BTC/BTC
mtgox_BTC/CAD
mtgox_BTC/CHF
mtgox_BTC/CNY
mtgox_BTC/CZK
mtgox_BTC/DKK
mtgox_BTC/EUR
mtgox_BTC/GBP
mtgox_BTC/HKD
mtgox_BTC/JPY
mtgox_BTC/NOK
mtgox_BTC/NZD
mtgox_BTC/PLN
mtgox_BTC/RUB
mtgox_BTC/SEK
mtgox_BTC/SGD
mtgox_BTC/THB
mtgox_BTC/USD
mtgox_USD/BTC
vircurex_BTC/DGC
vircurex_BTC/DVC
vircurex_BTC/FRC
vircurex_BTC/FTC
vircurex_BTC/IXC
vircurex_BTC/LTC
vircurex_BTC/NMC
vircurex_BTC/NVC
vircurex_BTC/PPC
vircurex_BTC/RUR
vircurex_BTC/TRC
vircurex_BTC/USD
vircurex_BTC/XPM
virwox_BTC/SLL

It's been running for a day or something and I currently have 120k trades stored (this does not include historical data).

This is very interesting indeed...  Will the server be open source too so we can run our own instances?  I think this is especially important for people who want to use non-standard candles.   Also will it be able to be used for the backtesting too?

░▒▓█ 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!
whydifficult (OP)
Sr. Member
****
Offline Offline

Activity: 287
Merit: 250



View Profile WWW
July 30, 2013, 12:57:27 PM
 #183

This is very interesting indeed...  Will the server be open source too so we can run our own instances?  I think this is especially important for people who want to use non-standard candles.   Also will it be able to be used for the backtesting too?

Thanks. I am planning on hosting all standard candle intervals (15min, 1h, 4h, 1d, etc.) for all those markets and providing them for free (as long as I can afford it).  I could open source it all but storing all the data is not something as small as running a Gekko instance, there is a lot of trade data flowing from all exchanges. Take a look at the mtgox sqlite database for example, it is over 4GB already.

I am now thinking of maybe turning this into a service where all standard candles for all those markets can be retrieved by everyone (free). And maybe I can see what other stuff can be calculated easily. I am thinking about things like spread graphs between different BTC/LTC (or other pure crypto) markets for arbitrage or maybe realtime datastreams to popular charting software like sierrachart. Right now I am just exploring all the different things I can do with this stuff.

--

This will be an optional solution for Gekko, in no way will this be forced upon Gekko's users because nobody can easily check whether the candle data is not messed with.

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

Activity: 560
Merit: 500

I am the one who knocks


View Profile
July 30, 2013, 02:30:52 PM
 #184

This will be an optional solution for Gekko, in no way will this be forced upon Gekko's users because nobody can easily check whether the candle data is not messed with.
Thanks for the info whydifficult.... however some of us would still like the option, especially if you decide that it isn't worth hosting one day.

Thanks. I am planning on hosting all standard candle intervals (15min, 1h, 4h, 1d, etc.) for all those markets and providing them for free (as long as I can afford it).  I could open source it all but storing all the data is not something as small as running a Gekko instance, there is a lot of trade data flowing from all exchanges. Take a look at the mtgox sqlite database for example, it is over 4GB already.
It isn't the standard candles that I am worried about Smiley   Nor am I worried about data storage.  However my interest really only expands *if* this data could/would be used by the backtesting system.  Who knows what odd candle times might give us.   But I guess that depends on how your system works... if it does not store the raw trade data then calculating off-standard candles will be difficult. 

I see it very much like an electrum server... they are a PIA to setup and take up a lot of space, but some users would like to do that.

That being said.... it is your code and I respect your decision to do with it as you see fit, you have treated us great so far.  At the very lease would you consider releasing a bare bones reference implementation so others could do their own implementation?

░▒▓█ 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!
lky_svn
Newbie
*
Offline Offline

Activity: 45
Merit: 0



View Profile
July 30, 2013, 02:47:20 PM
 #185


What is the interval you have set? The volatility is very low at the moment, any time Gekko encouters an interval in which there were no trades this happens. So al small interval will trigger this sooner. See below:


Hi again,

Firstly, thanks for your help on this!
Realise that Gekko is dependent on external sources - don't get me wrong, I wasn't complaining about Gekko at all, just thought I'd help with a bugreport... Fully understand that it might be external sources. But since it works with USD, it is a bit strange, I thought...

As I said, it's working absolutely fine with USD... Only when I change the currency to EUR, then I get this issue.
Tried it with JPY and SEK as well (just changing the conf) to try out other pairs - doesn't seem to be working either, only USD so far for me...

The issue already appears at the start of gekko. Interval is at 30mins at the moment. Running well with USD...
Let me know if I can help somehow to enable/simplify/troubleshoot a fix. I'm on windows, if it helps. Can't find the logs anywhere though...

Hosting standard candle intervals would be interesting. But realise that this might cost you time/money/effort, so thanks for considering it!
whydifficult (OP)
Sr. Member
****
Offline Offline

Activity: 287
Merit: 250



View Profile WWW
July 30, 2013, 06:54:51 PM
 #186

Hi again,

Firstly, thanks for your help on this!
Realise that Gekko is dependent on external sources - don't get me wrong, I wasn't complaining about Gekko at all, just thought I'd help with a bugreport... Fully understand that it might be external sources. But since it works with USD, it is a bit strange, I thought...

As I said, it's working absolutely fine with USD... Only when I change the currency to EUR, then I get this issue.
Tried it with JPY and SEK as well (just changing the conf) to try out other pairs - doesn't seem to be working either, only USD so far for me...

The issue already appears at the start of gekko. Interval is at 30mins at the moment. Running well with USD...
Let me know if I can help somehow to enable/simplify/troubleshoot a fix. I'm on windows, if it helps. Can't find the logs anywhere though...

Hosting standard candle intervals would be interesting. But realise that this might cost you time/money/effort, so thanks for considering it!

Hi,

Sorry if I came across as trying to push the issues to external dependencies, I meant that in most markets besides USD there is little volatility. Currently when Gekko tries to calculate a candle which doesn't have any trade, you'll get NaN for the rest of the time (so also for all other candles that come after it). I'll fix this bug but I don't know how to handle situations where candles don't have any trades at all.

Right now you could set the interval to something higher than 30 minutes to lessen the chance that a candle will have 0 trades, but I'll patch it ASAP so that it will still work.

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

Activity: 52
Merit: 0


View Profile
July 30, 2013, 08:53:47 PM
 #187

Does this still use BTC-e historical data from bitcoincharts?

My concern is Bitcoincharts downtime/recently they missed a bunch of data from BTC-e
whydifficult (OP)
Sr. Member
****
Offline Offline

Activity: 287
Merit: 250



View Profile WWW
July 30, 2013, 10:34:00 PM
 #188

Does this still use BTC-e historical data from bitcoincharts?

My concern is Bitcoincharts downtime/recently they missed a bunch of data from BTC-e

At the moment it does, however I am in the process of storing all trade data on my server, precalculating most standard candles and exposing them through an API. Though this still is a central point of failure.

Sneak peak:

Code:
> db.stats()
{
"db" : "coindata",
"collections" : 144,
"objects" : 151908,
"avgObjSize" : 85.47955341390842,
"dataSize" : 12985028,
"storageSize" : 32378880,
"numExtents" : 329,
"indexes" : 285,
"indexSize" : 12476576,
"fileSize" : 201326592,
"nsSizeMB" : 16,
"dataFileVersion" : {
"major" : 4,
"minor" : 5
},
"ok" : 1
}

(currently watching different 144 markets, got 150k+ trades stored). I suspect it may take a while before this is stable enough to be included in Gekko.

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

Activity: 50
Merit: 0



View Profile
August 02, 2013, 02:47:29 PM
 #189

Hi, thank you for your wonderful project! Smiley
I have a small question. How often should Gekko to send email ?
I have received only one letter after the start.

email
Code:
Gekko is watching the bitcoin market and has detected a new trend, advice is to SELL
The current BTC price is 95.520

Additional information:

@ 95.520 (-0.445)

config.js
Code:
// Exponential Moving Averages settings:
config.EMA = {
  // timeframe per candle
  interval: 60, // in minutes
  // EMA weight (α)
  // the higher the weight, the more smooth (and delayed) the line
  short: 10,
  long: 21,
  // amount of candles to remember and base initial EMAs on
  candles: 30,
  // the difference between the EMAs (to act as triggers)
  sellTreshold: -0.25,
  buyTreshold: 0.25
};
....

// Monitor the live market
config.normal = {
  enabled: true,
  exchange: 'BTCe', // 'MtGox', 'BTCe' or 'Bitstamp'
  currency: 'USD',
  asset: 'BTC',
  tradingEnabled: false,
  key: '',
  secret: '',
}
...
config.debug = true; // for additional logging / debugging

EDIT:
Gekko is running now through forever on my server with Ubuntu 12.04, node v0.10.5
Code:
data:    [1] euny /usr/local/bin/node gekko.js  4628    4630 /home/jeka/.forever/euny.log 0:7:24:8.894  


juve4v
Hero Member
*****
Offline Offline

Activity: 505
Merit: 500


View Profile
August 02, 2013, 04:36:47 PM
Last edit: August 02, 2013, 07:22:52 PM by juve4v
 #190

I'm trying to start it and here's what I get:  "Failed to load historical trades from Bitstamp". Any suggestions?
whydifficult (OP)
Sr. Member
****
Offline Offline

Activity: 287
Merit: 250



View Profile WWW
August 03, 2013, 02:35:17 AM
 #191

Hi, thank you for your wonderful project! Smiley
I have a small question. How often should Gekko to send email ?
I have received only one letter after the start.

Gekko sends an email when a change in the market is detected. With the default setup it uses EMA to detect such a change on an hourly basis. When there is a lot of volatility Gekko will probably report a couple of times a day (max) but more realistically you should expect it once a day.

If something is wrong Gekko currently only logs it (when you enable debug = true, as you did), if you are using forever use `forever list` to find the logfile, you can read it by typing `tail [name of logfile]` (or use  `cat` if you want to read the whole thing).

I'm trying to start it and here's what I get:  "Failed to load historical trades from Bitstamp". Any suggestions?

I am currently working on a solution for this as this is a big problem, what you can try for now: lessen the `candles` in the settings, lessen the `interval` in the settings. Note that setting `candles` to a lower number will decrease the trend detection performance in the start (until it build up the history it can't fetch right now). If you are only using paper trading this means it's better to ignore the first couple of days. If you lessen the `interval` Gekko will look at smaller timeframes (so it will detect trends on a smaller timescale so to say).

This problem is not present at Mt. Gox right now btw.

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

Activity: 50
Merit: 0



View Profile
August 03, 2013, 04:43:02 AM
 #192

Hi, thank you for your wonderful project! Smiley
I have a small question. How often should Gekko to send email ?
I have received only one letter after the start.

Gekko sends an email when a change in the market is detected. With the default setup it uses EMA to detect such a change on an hourly basis. When there is a lot of volatility Gekko will probably report a couple of times a day (max) but more realistically you should expect it once a day.

If something is wrong Gekko currently only logs it (when you enable debug = true, as you did), if you are using forever use `forever list` to find the logfile, you can read it by typing `tail [name of logfile]` (or use  `cat` if you want to read the whole thing).

Thanks for the answer! In fact the price has not changed enough to trigger the advice sender. Gekko continues to work well!
Code:
2013-08-03 08:29:43 (DEBUG):	fetching new trades for new bucket at bitcoincharts
2013-08-03 08:29:45 (DEBUG): calculated candle: 0
2013-08-03 08:29:45 (DEBUG): calced EMA properties for new candle:
2013-08-03 08:29:45 (DEBUG): short ema 95.775
2013-08-03 08:29:45 (DEBUG): long ema 95.767
2013-08-03 08:29:45 (DEBUG): diff ema 0.008
2013-08-03 08:29:45 (DEBUG): we are currently not in an up or down trend @ 95.503 (0.008)
juve4v
Hero Member
*****
Offline Offline

Activity: 505
Merit: 500


View Profile
August 03, 2013, 08:49:52 AM
 #193

Hi, thank you for your wonderful project! Smiley
I have a small question. How often should Gekko to send email ?
I have received only one letter after the start.

Gekko sends an email when a change in the market is detected. With the default setup it uses EMA to detect such a change on an hourly basis. When there is a lot of volatility Gekko will probably report a couple of times a day (max) but more realistically you should expect it once a day.

If something is wrong Gekko currently only logs it (when you enable debug = true, as you did), if you are using forever use `forever list` to find the logfile, you can read it by typing `tail [name of logfile]` (or use  `cat` if you want to read the whole thing).

I'm trying to start it and here's what I get:  "Failed to load historical trades from Bitstamp". Any suggestions?

I am currently working on a solution for this as this is a big problem, what you can try for now: lessen the `candles` in the settings, lessen the `interval` in the settings. Note that setting `candles` to a lower number will decrease the trend detection performance in the start (until it build up the history it can't fetch right now). If you are only using paper trading this means it's better to ignore the first couple of days. If you lessen the `interval` Gekko will look at smaller timeframes (so it will detect trends on a smaller timescale so to say).

This problem is not present at Mt. Gox right now btw.


I tried to lower values but this is what I got now:' 'Calculating EMA on historical data...''  and just reports that without actually going to the next step.Could you suggest the values for candles and interval to get it started? Anything above 4 min in interval gives me first error, while setting it to 4 min just hangs...Ty for your answer !
whydifficult (OP)
Sr. Member
****
Offline Offline

Activity: 287
Merit: 250



View Profile WWW
August 03, 2013, 09:53:49 AM
 #194

I tried to lower values but this is what I got now:' 'Calculating EMA on historical data...''  and just reports that without actually going to the next step.Could you suggest the values for candles and interval to get it started? Anything above 4 min in interval gives me first error, while setting it to 4 min just hangs...Ty for your answer !

Ah, that probably means it is working and checking every hour but has nothing to report so far. I agree that the messaging needs to be improved to indicate that it is checking.

If you want to be sure you can turn on debug at the bottom of the config, this way Gekko will spit out a lot more information (and errors).

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

Activity: 2955
Merit: 1049


View Profile
August 07, 2013, 04:11:13 PM
 #195

any chance that Bitstamp is working again?

Code:
e02bddc..78589c9  master     -> origin/master
Already up-to-date.

Code:
/methods/realtime-candle-fetcher.js:98
    throw 'Failed to load historical trades from ' + this.watcher.name;
                                                   ^
Failed to load historical trades from Bitstamp
whydifficult (OP)
Sr. Member
****
Offline Offline

Activity: 287
Merit: 250



View Profile WWW
August 08, 2013, 02:18:12 PM
 #196

any chance that Bitstamp is working again?

Code:
e02bddc..78589c9  master     -> origin/master
Already up-to-date.

Code:
/methods/realtime-candle-fetcher.js:98
    throw 'Failed to load historical trades from ' + this.watcher.name;
                                                   ^
Failed to load historical trades from Bitstamp

I am working on my own candle platform that will be available through an API so this problem will be fixed, no matter how often the API changes. You can currently use these solutions.

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

Activity: 560
Merit: 500

I am the one who knocks


View Profile
August 09, 2013, 08:55:26 PM
 #197

Backtesting bug?

Here is my log:
Quote
2013-08-07 09:02:24 (INFO):   I'm gonna make you rich, Bud Fox.
2013-08-07 09:02:24 (INFO):   Let me show you some Exponential Moving Averages.


2013-08-07 09:02:24 (INFO):   Preparing backtester to test strategy against historical data.
2013-08-07 09:02:24 (INFO):   Profit reporter active on simulated balance
2013-08-07 09:02:24 (INFO):   Calculating EMA on historical data...
2013-08-07 09:02:24 (INFO):   calculated initial EMA, simulating remaining candles
2013-08-07 09:02:24 (INFO):   ADVICE is to SELL @ 144.000 (-15.292)   at    2013-04-28 18:00:00
2013-08-07 09:02:24 (INFO):   ADVICE is to BUY @ 98.100 (2.663)   at    2013-05-02 18:00:00
2013-08-07 09:02:24 (INFO):   ADVICE is to SELL @ 123.500 (-1.375)   at    2013-05-16 18:00:00
2013-08-07 09:02:24 (INFO):   ADVICE is to BUY @ 111.000 (2.609)   at    2013-06-06 18:00:00
2013-08-07 09:02:24 (INFO):   ADVICE is to SELL @ 101.484 (-0.493)   at    2013-07-28 18:00:00


2013-08-07 09:02:24 (INFO):      WARNING: BACKTESTING FEATURE NEEDS PROPER TESTING
2013-08-07 09:02:24 (INFO):      WARNING: ACT ON THESE NUMBERS AT YOUR OWN RISK!


2013-08-07 09:02:24 (INFO):   (PROFIT REPORT) start time:          2013-04-27 18:00:00
2013-08-07 09:02:24 (INFO):   (PROFIT REPORT) end time:          2013-08-05 18:00:00
2013-08-07 09:02:24 (INFO):   (PROFIT REPORT) timespan:          100 days

2013-08-07 09:02:24 (INFO):   (PROFIT REPORT) start price:          93.07
2013-08-07 09:02:24 (INFO):   (PROFIT REPORT) end price:          106.76002
2013-08-07 09:02:24 (INFO):   (PROFIT REPORT) Buy and Hold profit:       14.709%

2013-08-07 09:02:24 (INFO):   (PROFIT REPORT) amount of trades:       5
2013-08-07 09:02:24 (INFO):   (PROFIT REPORT) original simulated balance:    2.500 undefined
2013-08-07 09:02:24 (INFO):   (PROFIT REPORT) current simulated balance:    3.766 undefined
2013-08-07 09:02:24 (INFO):   (PROFIT REPORT) simulated profit:       1.266 undefined (50.646%)
2013-08-07 09:02:24 (INFO):   (PROFIT REPORT) simulated yearly profit:    4.508 undefined (180.301%)

But if we look at the bitcoincharts for the same period: http://bitcoincharts.com/charts/mtgoxUSD#rg60zigDailyzczsg2013-04-18zeg2013-08-05ztgSza1gEMAzm1g5za2gEMAzm2g50zv

I see only two crossovers, not 5.  What am I missing?

░▒▓█ 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!
ErebusBat
Hero Member
*****
Offline Offline

Activity: 560
Merit: 500

I am the one who knocks


View Profile
August 09, 2013, 09:05:49 PM
 #198

Backtesting bug?

I see only two crossovers, not 5.  What am I missing?

nm...  looks like even at 100 it was not enough to calculate 'accurate' EMAs, running from Jan-1 and examining the period shows what one would expect from the bitcoincharts source:
Quote
2013-08-09 15:01:17 (INFO):   I'm gonna make you rich, Bud Fox.
2013-08-09 15:01:17 (INFO):   Let me show you some Exponential Moving Averages.


2013-08-09 15:01:17 (INFO):   Preparing backtester to test strategy against historical data.
2013-08-09 15:01:17 (INFO):   Profit reporter active on simulated balance
2013-08-09 15:01:17 (INFO):   Calculating EMA on historical data...
2013-08-09 15:01:17 (INFO):   calculated initial EMA, simulating remaining candles
2013-08-09 15:01:17 (INFO):   ADVICE is to BUY @ 14.237 (4.098)   at    2013-01-11 17:00:00
.. snip ..
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 134.444 (25.786)   at    2013-04-27 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 144.000 (26.609)   at    2013-04-28 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 139.227 (25.759)   at    2013-04-29 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 116.380 (20.081)   at    2013-04-30 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 106.250 (13.674)   at    2013-05-01 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 98.100 (7.107)   at    2013-05-02 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 112.900 (6.415)   at    2013-05-03 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 115.980 (6.671)   at    2013-05-04 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 112.250 (5.793)   at    2013-05-05 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 109.600 (4.466)   at    2013-05-06 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 113.200 (4.489)   at    2013-05-07 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 112.799 (4.339)   at    2013-05-08 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 117.700 (5.445)   at    2013-05-09 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 115.640 (5.547)   at    2013-05-10 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 114.820 (5.328)   at    2013-05-11 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 117.980 (5.916)   at    2013-05-12 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 111.400 (4.546)   at    2013-05-13 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 114.220 (4.323)   at    2013-05-14 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 118.210 (5.138)   at    2013-05-15 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 123.500 (6.896)   at    2013-05-16 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 123.211 (7.829)   at    2013-05-17 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 122.500 (8.137)   at    2013-05-18 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 122.020 (8.107)   at    2013-05-19 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 122.890 (8.184)   at    2013-05-20 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 123.800 (8.337)   at    2013-05-21 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 126.300 (8.908)   at    2013-05-22 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 133.100 (10.710)   at    2013-05-23 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 131.986 (11.430)   at    2013-05-24 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 133.500 (12.058)   at    2013-05-25 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 129.770 (11.461)   at    2013-05-26 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 129.000 (10.751)   at    2013-05-27 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 132.250 (10.872)   at    2013-05-28 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 128.799 (10.034)   at    2013-05-29 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 128.815 (9.363)   at    2013-05-30 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 129.300 (8.916)   at    2013-05-31 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 122.500 (6.969)   at    2013-06-01 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 120.737 (5.202)   at    2013-06-02 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 121.400 (4.143)   at    2013-06-03 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 121.900 (3.524)   at    2013-06-04 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 118.970 (2.378)   at    2013-06-05 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to SELL @ 111.000 (-0.354)   at    2013-06-06 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 107.892 (-2.944)   at    2013-06-07 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 100.437 (-6.599)   at    2013-06-08 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 106.350 (-7.332)   at    2013-06-09 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 109.000 (-6.992)   at    2013-06-10 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 108.776 (-6.746)   at    2013-06-11 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 103.949 (-7.828)   at    2013-06-12 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 100.000 (-9.548)   at    2013-06-13 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 99.800 (-10.620)   at    2013-06-14 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 99.900 (-11.161)   at    2013-06-15 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 101.950 (-10.778)   at    2013-06-16 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 107.350 (-8.838)   at    2013-06-17 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 108.251 (-7.243)   at    2013-06-18 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 111.290 (-5.294)   at    2013-06-19 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 109.500 (-4.483)   at    2013-06-20 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 108.200 (-4.263)   at    2013-06-21 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 107.900 (-4.149)   at    2013-06-22 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 102.090 (-5.628)   at    2013-06-23 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 103.329 (-6.175)   at    2013-06-24 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 104.000 (-6.261)   at    2013-06-25 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 101.737 (-6.882)   at    2013-06-26 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 94.660 (-9.259)   at    2013-06-27 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 94.999 (-10.616)   at    2013-06-28 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 97.510 (-10.614)   at    2013-06-29 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 88.050 (-13.398)   at    2013-06-30 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 90.405 (-14.339)   at    2013-07-01 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 78.890 (-18.577)   at    2013-07-02 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 80.036 (-20.838)   at    2013-07-03 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 68.500 (-26.306)   at    2013-07-04 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 69.655 (-29.339)   at    2013-07-05 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 76.500 (-28.368)   at    2013-07-06 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 76.000 (-27.614)   at    2013-07-07 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 76.700 (-26.541)   at    2013-07-08 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 88.000 (-21.246)   at    2013-07-09 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 88.979 (-17.337)   at    2013-07-10 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 93.990 (-12.932)   at    2013-07-11 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 98.320 (-8.596)   at    2013-07-12 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 94.420 (-7.044)   at    2013-07-13 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 98.890 (-4.553)   at    2013-07-14 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 97.100 (-3.483)   at    2013-07-15 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 98.500 (-2.327)   at    2013-07-16 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 90.069 (-4.165)   at    2013-07-17 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 92.000 (-4.704)   at    2013-07-18 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 89.821 (-5.688)   at    2013-07-19 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 91.998 (-5.555)   at    2013-07-20 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 91.601 (-5.527)   at    2013-07-21 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 95.559 (-4.173)   at    2013-07-22 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 95.090 (-3.407)   at    2013-07-23 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 96.950 (-2.294)   at    2013-07-24 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 96.020 (-1.845)   at    2013-07-25 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 94.400 (-2.035)   at    2013-07-26 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 98.780 (-0.780)   at    2013-07-27 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to BUY @ 101.484 (0.840)   at    2013-07-28 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 107.960 (3.742)   at    2013-07-29 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 106.212 (4.995)   at    2013-07-30 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 104.000 (5.093)   at    2013-07-31 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 104.501 (5.229)   at    2013-08-01 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 104.950 (5.370)   at    2013-08-02 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 105.120 (5.435)   at    2013-08-03 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 106.720 (5.848)   at    2013-08-04 18:00:00
2013-08-09 15:01:17 (INFO):   ADVICE is to HOLD @ 106.760 (6.042)   at    2013-08-05 18:00:00


2013-08-09 15:01:17 (INFO):      WARNING: BACKTESTING FEATURE NEEDS PROPER TESTING
2013-08-09 15:01:17 (INFO):      WARNING: ACT ON THESE NUMBERS AT YOUR OWN RISK!


2013-08-09 15:01:17 (INFO):   (PROFIT REPORT) start time:          2013-01-10 17:00:00
2013-08-09 15:01:17 (INFO):   (PROFIT REPORT) end time:          2013-08-05 18:00:00
2013-08-09 15:01:17 (INFO):   (PROFIT REPORT) timespan:          207 days

2013-08-09 15:01:17 (INFO):   (PROFIT REPORT) start price:          13.51001
2013-08-09 15:01:17 (INFO):   (PROFIT REPORT) end price:          106.76002
2013-08-09 15:01:17 (INFO):   (PROFIT REPORT) Buy and Hold profit:       690.229%

2013-08-09 15:01:17 (INFO):   (PROFIT REPORT) amount of trades:       3
2013-08-09 15:01:17 (INFO):   (PROFIT REPORT) original simulated balance:    2.500 undefined
2013-08-09 15:01:17 (INFO):   (PROFIT REPORT) current simulated balance:    2.702 undefined
2013-08-09 15:01:17 (INFO):   (PROFIT REPORT) simulated profit:       0.202 undefined (8.068%)
2013-08-09 15:01:17 (INFO):   (PROFIT REPORT) simulated yearly profit:    0.347 undefined (13.876%)

Anyone know off the top of their head how many back candles are really needed to prime the EMA for 'good' values?

░▒▓█ 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
August 10, 2013, 10:27:46 AM
 #199

Here's a little comparison:
3rd column = EMA(50), started January 1st
4th column = EMA(50), started 100 candles later (April 10th)
5th column = deviation 2nd <-> 1st EMA in %

It takes 48 days (May 28th) to bring the deviation down to 10%, and 110 days (July 29th) to get to less than 1%.

Timestamp   Weighted Price   50.00   50.00   Deviation
31.12.2012 00:00   13.48   0.00   0.00   
01.01.2013 00:00   13.34   0.52   0.00   100.00% << start 1st EMA
02.01.2013 00:00   13.31   1.02   0.00   100.00%
03.01.2013 00:00   13.36   1.51   0.00   100.00%
04.01.2013 00:00   13.42   1.98   0.00   100.00%
05.01.2013 00:00   13.45   2.43   0.00   100.00%
06.01.2013 00:00   13.46   2.86   0.00   100.00%
07.01.2013 00:00   13.51   3.28   0.00   100.00%
08.01.2013 00:00   13.72   3.69   0.00   100.00%
09.01.2013 00:00   13.74   4.08   0.00   100.00%
10.01.2013 00:00   14.05   4.47   0.00   100.00%
11.01.2013 00:00   14.11   4.85   0.00   100.00%
12.01.2013 00:00   14.17   5.21   0.00   100.00%
13.01.2013 00:00   14.11   5.56   0.00   100.00%
14.01.2013 00:00   14.26   5.90   0.00   100.00%
15.01.2013 00:00   14.20   6.23   0.00   100.00%
16.01.2013 00:00   14.52   6.55   0.00   100.00%
17.01.2013 00:00   15.17   6.89   0.00   100.00%
18.01.2013 00:00   15.68   7.24   0.00   100.00%
19.01.2013 00:00   15.46   7.56   0.00   100.00%
20.01.2013 00:00   15.72   7.88   0.00   100.00%
21.01.2013 00:00   16.38   8.21   0.00   100.00%
22.01.2013 00:00   17.15   8.56   0.00   100.00%
23.01.2013 00:00   17.22   8.90   0.00   100.00%
24.01.2013 00:00   17.75   9.25   0.00   100.00%
25.01.2013 00:00   16.66   9.54   0.00   100.00%
26.01.2013 00:00   17.15   9.84   0.00   100.00%
27.01.2013 00:00   17.65   10.15   0.00   100.00%
28.01.2013 00:00   18.34   10.47   0.00   100.00%
29.01.2013 00:00   19.17   10.81   0.00   100.00%
30.01.2013 00:00   19.48   11.15   0.00   100.00%
31.01.2013 00:00   20.58   11.52   0.00   100.00%
01.02.2013 00:00   20.73   11.88   0.00   100.00%
02.02.2013 00:00   19.47   12.18   0.00   100.00%
03.02.2013 00:00   20.26   12.49   0.00   100.00%
04.02.2013 00:00   20.42   12.80   0.00   100.00%
05.02.2013 00:00   20.57   13.11   0.00   100.00%
06.02.2013 00:00   21.09   13.42   0.00   100.00%
07.02.2013 00:00   21.61   13.74   0.00   100.00%
08.02.2013 00:00   22.42   14.08   0.00   100.00%
09.02.2013 00:00   23.24   14.44   0.00   100.00%
10.02.2013 00:00   23.42   14.79   0.00   100.00%
11.02.2013 00:00   24.13   15.16   0.00   100.00%
12.02.2013 00:00   25.09   15.55   0.00   100.00%
13.02.2013 00:00   25.48   15.94   0.00   100.00%
14.02.2013 00:00   25.46   16.31   0.00   100.00%
15.02.2013 00:00   26.99   16.73   0.00   100.00%
16.02.2013 00:00   27.16   17.14   0.00   100.00%
17.02.2013 00:00   26.40   17.50   0.00   100.00%
18.02.2013 00:00   26.76   17.87   0.00   100.00%
19.02.2013 00:00   28.19   18.27   0.00   100.00%
20.02.2013 00:00   29.47   18.71   0.00   100.00%
21.02.2013 00:00   29.68   19.14   0.00   100.00%
22.02.2013 00:00   30.46   19.58   0.00   100.00%
23.02.2013 00:00   29.05   19.96   0.00   100.00%
24.02.2013 00:00   29.78   20.34   0.00   100.00%
25.02.2013 00:00   30.07   20.72   0.00   100.00%
26.02.2013 00:00   31.01   21.13   0.00   100.00%
27.02.2013 00:00   31.22   21.52   0.00   100.00%
28.02.2013 00:00   32.69   21.96   0.00   100.00%
01.03.2013 00:00   34.24   22.44   0.00   100.00%
02.03.2013 00:00   33.87   22.89   0.00   100.00%
03.03.2013 00:00   34.13   23.33   0.00   100.00%
04.03.2013 00:00   35.47   23.81   0.00   100.00%
05.03.2013 00:00   39.35   24.42   0.00   100.00%
06.03.2013 00:00   45.18   25.23   0.00   100.00%
07.03.2013 00:00   40.93   25.85   0.00   100.00%
08.03.2013 00:00   43.16   26.52   0.00   100.00%
09.03.2013 00:00   45.44   27.27   0.00   100.00%
10.03.2013 00:00   46.84   28.03   0.00   100.00%
11.03.2013 00:00   47.62   28.80   0.00   100.00%
12.03.2013 00:00   43.70   29.39   0.00   100.00%
13.03.2013 00:00   46.41   30.05   0.00   100.00%
14.03.2013 00:00   47.31   30.73   0.00   100.00%
15.03.2013 00:00   47.03   31.37   0.00   100.00%
16.03.2013 00:00   46.86   31.98   0.00   100.00%
17.03.2013 00:00   47.40   32.58   0.00   100.00%
18.03.2013 00:00   48.98   33.23   0.00   100.00%
19.03.2013 00:00   55.39   34.09   0.00   100.00%
20.03.2013 00:00   62.02   35.19   0.00   100.00%
21.03.2013 00:00   69.07   36.52   0.00   100.00%
22.03.2013 00:00   70.65   37.86   0.00   100.00%
23.03.2013 00:00   62.67   38.83   0.00   100.00%
24.03.2013 00:00   68.92   40.01   0.00   100.00%
25.03.2013 00:00   74.25   41.35   0.00   100.00%
26.03.2013 00:00   77.25   42.76   0.00   100.00%
27.03.2013 00:00   84.87   44.41   0.00   100.00%
28.03.2013 00:00   87.41   46.10   0.00   100.00%
29.03.2013 00:00   88.78   47.77   0.00   100.00%
30.03.2013 00:00   91.72   49.50   0.00   100.00%
31.03.2013 00:00   92.70   51.19   0.00   100.00%
01.04.2013 00:00   100.04   53.11   0.00   100.00%
02.04.2013 00:00   107.61   55.24   0.00   100.00%
03.04.2013 00:00   127.89   58.09   0.00   100.00%
04.04.2013 00:00   131.61   60.97   0.00   100.00%
05.04.2013 00:00   139.22   64.04   0.00   100.00%
06.04.2013 00:00   142.16   67.11   0.00   100.00%
07.04.2013 00:00   154.26   70.52   0.00   100.00%
08.04.2013 00:00   181.49   74.88   0.00   100.00%
09.04.2013 00:00   214.67   80.36   0.00   100.00%
10.04.2013 00:00   184.65   84.45   7.24   91.43% << start 2nd EMA
11.04.2013 00:00   158.93   87.37   13.19   84.90%
12.04.2013 00:00   85.57   87.30   16.03   81.64%
13.04.2013 00:00   110.21   88.20   19.72   77.64%
14.04.2013 00:00   97.41   88.56   22.77   74.29%
15.04.2013 00:00   87.07   88.50   25.29   71.42%
16.04.2013 00:00   65.33   87.59   26.86   69.33%
17.04.2013 00:00   85.27   87.50   29.15   66.69%
18.04.2013 00:00   97.38   87.89   31.83   63.79%
19.04.2013 00:00   119.43   89.12   35.26   60.44%
20.04.2013 00:00   124.02   90.49   38.74   57.19%
21.04.2013 00:00   121.50   91.71   41.99   54.22%
22.04.2013 00:00   123.23   92.94   45.17   51.40%
23.04.2013 00:00   134.63   94.58   48.68   48.53%
24.04.2013 00:00   152.07   96.83   52.74   45.54%
25.04.2013 00:00   143.07   98.65   56.28   42.95%
26.04.2013 00:00   132.25   99.97   59.26   40.72%
27.04.2013 00:00   131.18   101.19   62.08   38.65%
28.04.2013 00:00   133.17   102.44   64.87   36.68%
29.04.2013 00:00   142.25   104.00   67.90   34.71%
30.04.2013 00:00   139.87   105.41   70.72   32.91%
01.05.2013 00:00   121.05   106.02   72.70   31.43%
02.05.2013 00:00   106.49   106.04   74.02   30.20%
03.05.2013 00:00   91.30   105.46   74.70   29.17%
04.05.2013 00:00   106.67   105.51   75.95   28.01%
05.05.2013 00:00   113.50   105.82   77.43   26.84%
06.05.2013 00:00   117.32   106.28   78.99   25.67%
07.05.2013 00:00   106.71   106.29   80.08   24.66%
08.05.2013 00:00   113.33   106.57   81.38   23.63%
09.05.2013 00:00   111.66   106.77   82.57   22.67%
10.05.2013 00:00   118.03   107.21   83.96   21.69%
11.05.2013 00:00   115.55   107.54   85.20   20.77%
12.05.2013 00:00   114.60   107.81   86.35   19.91%
13.05.2013 00:00   117.02   108.18   87.55   19.06%
14.05.2013 00:00   114.85   108.44   88.62   18.27%
15.05.2013 00:00   110.25   108.51   89.47   17.54%
16.05.2013 00:00   115.44   108.78   90.49   16.81%
17.05.2013 00:00   121.43   109.28   91.70   16.08%
18.05.2013 00:00   123.82   109.85   92.96   15.37%
19.05.2013 00:00   121.87   110.32   94.10   14.70%
20.05.2013 00:00   122.31   110.79   95.20   14.07%
21.05.2013 00:00   122.28   111.24   96.27   13.46%
22.05.2013 00:00   123.00   111.70   97.31   12.88%
23.05.2013 00:00   125.33   112.23   98.41   12.32%
24.05.2013 00:00   129.85   112.93   99.65   11.76%
25.05.2013 00:00   130.87   113.63   100.87   11.23%
26.05.2013 00:00   134.02   114.43   102.17   10.71%
27.05.2013 00:00   129.34   115.01   103.24   10.24%
28.05.2013 00:00   127.98   115.52   104.21   9.80% << below 10%
29.05.2013 00:00   130.37   116.10   105.23   9.36%
30.05.2013 00:00   129.41   116.63   106.18   8.96%
31.05.2013 00:00   128.15   117.08   107.04   8.57%
01.06.2013 00:00   128.41   117.52   107.88   8.21%
02.06.2013 00:00   121.96   117.70   108.43   7.87%
03.06.2013 00:00   119.01   117.75   108.85   7.56%
04.06.2013 00:00   121.07   117.88   109.33   7.26%
05.06.2013 00:00   121.46   118.02   109.80   6.96%
06.06.2013 00:00   119.68   118.08   110.19   6.69%
07.06.2013 00:00   112.08   117.85   110.26   6.44%
08.06.2013 00:00   108.81   117.49   110.21   6.20%
09.06.2013 00:00   98.01   116.73   109.73   6.00%
10.06.2013 00:00   105.49   116.29   109.56   5.78%
11.06.2013 00:00   106.98   115.92   109.46   5.58%
12.06.2013 00:00   109.27   115.66   109.45   5.37%
13.06.2013 00:00   105.24   115.25   109.29   5.18%
14.06.2013 00:00   100.64   114.68   108.95   5.00%
15.06.2013 00:00   100.45   114.12   108.62   4.83%
16.06.2013 00:00   99.93   113.57   108.27   4.66%
17.06.2013 00:00   100.93   113.07   107.99   4.50%
18.06.2013 00:00   107.40   112.85   107.96   4.33%
19.06.2013 00:00   107.87   112.65   107.96   4.17%
20.06.2013 00:00   111.26   112.60   108.09   4.00%
21.06.2013 00:00   111.34   112.55   108.22   3.85%
22.06.2013 00:00   108.53   112.39   108.23   3.70%
23.06.2013 00:00   107.49   112.20   108.20   3.56%
24.06.2013 00:00   103.29   111.85   108.01   3.44%
25.06.2013 00:00   104.15   111.55   107.86   3.31%
26.06.2013 00:00   104.11   111.26   107.71   3.19%
27.06.2013 00:00   102.08   110.90   107.49   3.07%
28.06.2013 00:00   96.81   110.34   107.07   2.97%
29.06.2013 00:00   96.69   109.81   106.66   2.86%
30.06.2013 00:00   96.84   109.30   106.28   2.77%
01.07.2013 00:00   91.24   108.59   105.69   2.67%
02.07.2013 00:00   90.03   107.86   105.07   2.59%
03.07.2013 00:00   83.18   106.90   104.22   2.51%
04.07.2013 00:00   78.29   105.77   103.20   2.43%
05.07.2013 00:00   71.11   104.41   101.94   2.37%
06.07.2013 00:00   70.26   103.08   100.70   2.31%
07.07.2013 00:00   70.77   101.81   99.52   2.24%
08.07.2013 00:00   76.96   100.83   98.64   2.18%
09.07.2013 00:00   75.65   99.85   97.74   2.11%
10.07.2013 00:00   82.40   99.16   97.14   2.04%
11.07.2013 00:00   87.52   98.71   96.76   1.97%
12.07.2013 00:00   96.43   98.62   96.75   1.90%
13.07.2013 00:00   93.01   98.40   96.60   1.83%
14.07.2013 00:00   95.88   98.30   96.57   1.76%
15.07.2013 00:00   98.65   98.31   96.65   1.69%
16.07.2013 00:00   98.15   98.31   96.71   1.62%
17.07.2013 00:00   98.44   98.31   96.78   1.56%
18.07.2013 00:00   90.94   98.02   96.55   1.50%
19.07.2013 00:00   91.79   97.78   96.36   1.45%
20.07.2013 00:00   91.49   97.53   96.17   1.39%
21.07.2013 00:00   89.31   97.21   95.90   1.34%
22.07.2013 00:00   91.45   96.98   95.73   1.29%
23.07.2013 00:00   94.64   96.89   95.69   1.24%
24.07.2013 00:00   94.31   96.79   95.63   1.20%
25.07.2013 00:00   96.31   96.77   95.66   1.15%
26.07.2013 00:00   96.29   96.75   95.68   1.10%
27.07.2013 00:00   94.50   96.66   95.64   1.06%
28.07.2013 00:00   98.47   96.73   95.75   1.02%
29.07.2013 00:00   100.81   96.89   95.95   0.98% << below 1%
30.07.2013 00:00   103.81   97.17   96.26   0.94%
31.07.2013 00:00   108.03   97.59   96.72   0.90%
01.08.2013 00:00   105.29   97.89   97.05   0.86%
02.08.2013 00:00   105.07   98.17   97.37   0.82%
03.08.2013 00:00   103.80   98.40   97.62   0.79%
04.08.2013 00:00   104.86   98.65   97.90   0.76%
05.08.2013 00:00   106.41   98.95   98.24   0.72%
whydifficult (OP)
Sr. Member
****
Offline Offline

Activity: 287
Merit: 250



View Profile WWW
August 10, 2013, 01:42:55 PM
 #200

nm...  looks like even at 100 it was not enough to calculate 'accurate' EMAs, running


[..]

Anyone know off the top of their head how many back candles are really needed to prime the EMA for 'good' values?

Glad you got it sorted, if you got any feedback on ways to make the backtesting easier / better I am all ears Smiley

Here's a little comparison:
3rd column = EMA(50), started January 1st
4th column = EMA(50), started 100 candles later (April 10th)
5th column = deviation 2nd <-> 1st EMA in %

It takes 48 days (May 28th) to bring the deviation down to 10%, and 110 days (July 29th) to get to less than 1%.

This is very variable information, thanks! Do note that due to the nature of EMA this number should be lower when using lower EMA values (like both 21 and 10). But I can't really tell if 1% is the number we should aim for.

Gekko a nodejs bitcoin trading bot!
Realtime Bitcoin Globe - visualizing all transactions and blocks
Tip jar (BTC): 1KyQdQ9ctjCrGjGRCWSBhPKcj5omy4gv5S
Pages: « 1 2 3 4 5 6 7 8 9 [10] 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 »
  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!