Bitcoin Forum
June 16, 2024, 09:03:25 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: « 1 ... 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 [177] 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 »
3521  Economy / Speculation / Re: BITSTAMP eXchange wall Observer. second biggest and best exchange on: September 16, 2013, 03:04:16 PM
bids are building up (1k wall @ 123).

I am expecting some nice dumps on bitstamp.

Bids are building up and you think price will *drop*?

It's not impossible I guess, but not very likely IMO.


those 1 k walls are nothing in comparison to mtgox order book, but are big enough for bitstamp. remember that bitstamp is processing withdrawals.

we all know that volume on bitstamp is small, so we have this market depth, but with bids building slippage is smaller and you could actually effectively test the price.

last week somebody dumped 2 k btc, and brought the price to 115. today 2k dump would bring the price to 123.

For me to dump on bitstamp is now tempting .

That's a bold statement. Last time I checked, 30d volume on bitstamp was about 60% that of mtgox. That's not exactly small. But I agree with your comment on bitstamp market depth, it is way less than 60% of mtgox.

re: "dump looks tempting". Sure, and those dumps happened in the past. But my point was, in the past month or so, bid/ask ratio was a relatively reliable, leading(!) indicator for price movement. Pretty imprecise unfortunately (i.e. ratio change and price change aren't proportional), so I never traded directly on it, but as an indicator of the general direction, it seemed to work well.
3522  Economy / Speculation / Re: BITSTAMP eXchange wall Observer. second biggest and best exchange on: September 16, 2013, 12:26:17 PM
bids are building up (1k wall @ 123).

I am expecting some nice dumps on bitstamp.

Bids are building up and you think price will *drop*?

It's not impossible I guess, but not very likely IMO.
3523  Economy / Speculation / Re: BITSTAMP eXchange wall Observer. second biggest and best exchange on: September 16, 2013, 12:12:42 PM
In unrelated news (and more on topic of this thread), bid/ask ratio shot up in the last 24 hours, from 0.67 to 0.85 (source: coinorama).

In the recent past, this was usually followed by a noticeable increase in $/btc. Will be interesting to see if it holds this time.
3524  Economy / Speculation / Re: BITSTAMP eXchange wall Observer. second biggest and best exchange on: September 16, 2013, 12:07:05 PM
What a load of bullshit. Show me a source that says that bitstamp is "banning bots".

Their API page defines a request limit ("Do not make more than 600 request per 10 minutes or we will ban your IP address."), which rules out *high frequency trading*, but you can very much use bots on bitstamp.
3525  Economy / Service Discussion / Re: bitstamp not showing up as recently traded on bitcoincharts.com on: September 15, 2013, 08:59:02 PM
For fucks sake. This is getting ricidulous. Bitcoincharts never seems to answer to emails, so I'm not really surprised they're not responding now.

Any suggestions what to use as an alternative? Ideally something that has the wide range of indicators that bitcoincharts has. Did anyone here ever use clark moody's rtbtc website? I head good things about it, but didn't use it yet (15 days trial is a few dollars, guess I should give it a try.)
3526  Economy / Service Discussion / Re: bitstamp not showing up as recently traded on bitcoincharts.com on: September 14, 2013, 01:31:09 PM
@ShadowOfHarbringer

Whatever, still in the wrong thread! You are off topic here.
Please further discussion about "Does MtGox Own BitcoinCharts?" in this thread https://bitcointalk.org/index.php?topic=270584.0
I am finished with the discussion, I already know the answer.

You're a self-important clown who thinks he knows the answer. /FTFY

Back to the topic: I already said it above, but what bothers me is not only that bitcoincharts isn't responding *at all*, as far as I can tell, but that bitstamp themselves don't seem to care much. I'm starting to get pretty pissed off about their attituded on this.
3527  Economy / Speculation / Re: Please tell the truth on: September 14, 2013, 01:26:52 PM
Sell moderately high, buy back pretty low. I usually succeed doing that, except when fear or greed takes over.
3528  Economy / Speculation / Re: BITSTAMP eXchange wall Observer. second biggest and best exchange on: September 13, 2013, 05:24:26 PM
Still no bitstamp data on bitcoincharts. Pretty annoying as well: bitstamp responded that, as far as they know, it's not their fault. bitcoincharts didn't even bother responding at all.
3529  Economy / Service Discussion / Re: bitstamp not showing up as recently traded on bitcoincharts.com on: September 13, 2013, 05:22:33 PM
I asked Bitstamp, they dont know.
Quote
Bitstamp: We currently have no information as to why Bitstamp is not shown on bitcoincharts, as our service is proceeding unhindered. As our support regarding 3rd party sites is limited, we kindly suggest you contact bitcoincharts directly.

I wonder a bit, that they dont care about bitcoincharts. I understand, that they can't every 3rd party site! But bitcoincharts its "the" site for BTC markets! Or not?


My reaction is similar. I posted on their twitter page, and their response was basically "we don't think it's a problem on our side, maybe contact bitcoincharts yourself." A bit blase I have to say... bitcoincharts is one of the most imporant, if not *the* most important btc data site (apart from clarkmoody maybe). If I were them, I would (a) get in contact with them myself to fix it, and (b) let the world know that it's not their fault, and they did everything they could to solve it.
3530  Economy / Speculation / Re: Goomboo's Journal on: September 13, 2013, 04:49:44 PM
Oda, in your experience, how have 18/45 hourly held up? In my experience it's one of the most profitable, especially on BTCe.

I never tested anything on BTCe, but for mtgox:

I'm assuming 1% fee. Without treshold, poorly (minus 3%, on my May to August data).  With -0.2/0.2 treshold, pretty good, +30%. But lots of trade signals (25). Too much for my taste, I guess.
3531  Economy / Speculation / Re: BITSTAMP eXchange wall Observer. second biggest and best exchange on: September 11, 2013, 11:59:46 AM
Bitcoincharts doesn't show updated price data for bitstamp anymore. Not the first time this happened, as well. This is pretty annoying. At first I thought, no big deal, no feed for a few hours, but it's more than a day now. When will this be fixed?

To play devil's advocate for a second: could it have anything to do with the fact that bitcoincharts is owned by Tibanne Co., Ltd., the company that runs mtgox? Maybe give people a little incentive to keep trading on mtgox... I mean, who wants to trade on an exchange whose data isn't even properly displayed. Then again, it's not as if mtgox has anything to fear from bitstamp, their position as the dominant exchange is as stable as ever. Oh, wait.

What makes you think Tibanne owns them?  They host the site, but I don't think they own them.

You're right, I have no idea who *owns* bitcoincharts. I do know that the registrar of the domain is Tibanne according to whois
3532  Economy / Speculation / Re: Goomboo's Journal on: September 10, 2013, 11:48:34 PM
Oda.krell, thank you very much for the excellent post. I will take it into account for my own testing, but so far, it seems to hold up (using a different range for testing.) I have a quick question for you, though: when using Gekko, you state that you've set the initial number of candles to 1 for testing, but when actually using Gekko to advise/trade, what do you set that value to?

I should say that I don't directly trade based on any single EMA method, I'm doing it half algorithmic, half intuitive :P

But to get the signals for my EMA methods, I use gekko with the default 100 intitial candles... no reason not to, I only set it to 1 so that in my backtest buy and hold and ema method would start on equal grounds.
3533  Economy / Speculation / Re: Evaluating parameters for EMA crossover trading: A rigorous approach (kind of) on: September 10, 2013, 11:44:10 PM
Love the depth of the OP Smiley

I backtested Bitstamp data for 1 and 6 hours candles, didn't change the fee assumption even if there is a lot smaller fee to pay (0.4% vs 0.6%) but a bit more slippage that may compensate that. One thing I noticed, the "strange beast" EMA5/1 gives me negative results for 6 hours...

EMA 20/6 is still quite good even for 6 hours candles, while hourly candles are weak in general, as I would expect. Would like to test 2h intervals at some point.

Thanks Smiley

One thing: I wouldn't use the exact same parameters across different time intervals, that almost never gives good results in my experience. If at all, I would try if a rough "normalization" to the new interval size gives better results, e.g. 1d 5+1 becomes 6h 20+4, and then test values near that. I got some good results (in backtesting) like that. The reason is probably that the underlying trend following function is still the same, but the sensitivity is different (i.e. in the case of 1d --> 6h, it is increased somewhat). /2cents
3534  Economy / Speculation / Re: BITSTAMP eXchange wall Observer. second biggest and best exchange on: September 10, 2013, 11:32:33 PM
Bitcoincharts doesn't show updated price data for bitstamp anymore. Not the first time this happened, as well. This is pretty annoying. At first I thought, no big deal, no feed for a few hours, but it's more than a day now. When will this be fixed?

To play devil's advocate for a second: could it have anything to do with the fact that bitcoincharts is owned by Tibanne Co., Ltd., the company that runs mtgox? Maybe give people a little incentive to keep trading on mtgox... I mean, who wants to trade on an exchange whose data isn't even properly displayed. Then again, it's not as if mtgox has anything to fear from bitstamp, their position as the dominant exchange is as stable as ever. Oh, wait.
3535  Economy / Speculation / Re: Wall Observer - MtGoxUSD wall movement tracker - Hardcore on: September 09, 2013, 11:17:01 PM
I am tired of your bs. You are a real ray of sunshine and consistenty wrong. Do you ever grow tired of posting your negative garbage in this forum? Get out of your basement and talk to real people, try to develop positive relationships. You will be a much happier person in the long run. Welcome to ignore (my first).

I shouldn't feed the trolls. My bad.

I really don't think it is healthy to get angry about jaroslaw or any of his permutations. He has the low-effort trolling perfected to a T.
3536  Economy / Speculation / Evaluating parameters for EMA crossover trading: A rigorous approach (kind of) on: September 09, 2013, 12:04:35 PM
Preliminary note #1 I originally posted this in Goomboo's thread, which started out a long time ago as an introduction to the EMA20+10 crossover method, and has since then turned to the more general topic of backtesting (average based) trading strategies. If you're unsure about the basic idea behind EMA based trading strategies, read his thread. Goomboo wrote an excellent index for it a while ago, making it easy to navigate.

Preliminary note #2 This post should be self-contained, but I should make special mention of the software I used for backtesting: Gekko, available on github. It is easy to install and use, and highly recommended if you plan to use an EMA crossover strategy yourself. Among other things, it calculates the averages (and potential crossovers) in real-time, so you will receive trading signals without delay, and it allows you to set thresholds for the crossovers which is extremely important for the 1 hour variant of the EMA method. Many thanks to Mike van Rossum.

Preliminary note #3  This is going to be an extremely long post. One day I will be able to write and explain my ideas in a more concise manner. Today is not that day. Consider yourself warned. There's a summary at the end that contains all the important bits, feel free to skip the rest.


Introduction

The following test of different EMA strategies was based on a few simple assumptions that can be summarized as follows:

(1) Recent performance (i.e. the result of back-testing on recent historical data) is a much greater factor in determining future profits than performance on older historical data.

(2) The simple parameter search we employ seems to favor curve fitting, which makes future performance of the parameters doubtful. Therefore, we need to back-test across different time segments to confirm results found in recent history.

(3) Trading is more expensive than previously assumed. It is necessary to take into account not only the rather high trading fees itself, but also slippage while executing a trade, and possibly even the delay between the EMA method signaling a trade and the trader executing it, which tends to cut into profits.


Methodology

The obvious parts: I'm using Gekko for back-testing, performing a search for optimal parameters for EMA crossover methods, yadda yadda yadda. All of the following is based on mtgox data.

I didn't perform an exhaustive search across those main EMA parameters, but only plugged in those values that had been previously established as profitable in this thread. In particular, I need to thank ErebusBat for his August 10 post, highlighting the profitable parameter ranges.

I only tested *hourly* and *daily* variants of the EMA method. A very sloppy test on 12h interval gave pretty bad results. I suspect that a 2h version of EMA crossovers (with different parameters of course) might perform quite well. I chose '1 hour' and '1 day' because I wanted to see results from the usable range of time periods: faster than 1h is almost certainly too sensitive, slower than 1d probably is too slow for the pretty volatile Bitcoin market.

Time period(s)

Like I said above, I believe it makes sense to put more weight on recent performance when trying to find optimal parameters for an EMA crossover trading strategy. The reason is simple: say a method performed spectacularly well during 2011 and 2012, but fails to generate any profit in the current year. It would be rather naive to simply look at the aggregate profit and conclude that the method will perform with that (aggregate) profit on average in the *future*. Basically, it would be nice if our method would have generated money not only in the distant past but also the last few months, right?

I decided to start the primary backtest after the April 10 peak, for the reason that the (double?) exponential growth  during the weeks before April was unusual, even for the fast bitcoin price movement. So post-peak it is. I based the decision where to start exactly after the peak on Bollinger Bandwidth (2h interval). Volatility around and immediately after the April 10 peak (initial correction) was extremely high, but around May 4th it went back to normal. Well, bitcoin normal. So the "recent history" is 2013-05-04 to 2013-08-22 (110 days). Almost 4 months, enough data to chew on in my opinion.

In addition, I needed another period to backtest the backtesting results on. For that I chose approximately a time period going back 1 year from, so the "entire history" is: 2012-10-22 to 2013-08-22 (304 days). Yes, they overlap. Deal with it.

Benchmark

We need something to compare our results again, right? "Buy & hold" (from now on: B&H) is the obvious candidate. However, B&H is problematic. Why? You'll notice that when proponents of B&H on this forum talk about its profits, they assume you bought in at a really low price point, like in early January, or at the lowest point after the bubble burst in April. Which is bullshit of course. That's not "B&H", that's "magically knowing the local minimum", and if you can do that, you don't need trading advice anyway, you're already the richest guy on Earth.

So let's define B&H for our purposes: B&H profit is calculated as the volume weighted 12h price in the middle of the last day of our testing period, divided by the price halfway through the first day of the testing period.

Gekko settings

As I said, I think most parameter searches in here assumed slightly too low trading costs. An actual trading fee of 0.5% is quite normal on mtgox as far as I know. Also, some slippage usually occurs (unless you buy or sell only minimal amounts). Finally,unless you have a trading bot, there will be a delay between the EMA method signaling a trade and the trade being executed, which often reduces profits. So I decided to set the "fee" value to 1%, which includes all profit reducing factors mentioned above. Note that setting this value higher favors B&H on the one hand, and "slower" EMA methods (i.e.  methods that react slower to trends, and yields less trade signals) on the other.

The initial history setting defines the number of candles at the beginning of the data that are reserved to calculate the EMA methods initial average values. Default is 100, but this is a bad value for our purposes: the EMA methods would include all the volatile data for the initial history that I carefully excluded. So candles is set to 1, which essentially means the EMA method buys immediately. Which is good, because that's what B&H, our benchmark, does as well, so they start on equal grounds.


Results

Finally.

Anyone still reading this?

Congratulations. You must be really bored.


Hourly intervals

The list starts with the classical EMA20/10, since that's how Goomboo's thread started. You will notice it performs pretty bad.

The only other parameters I list below are the ones that performed best during backtesting. In particular, if a parameter combination didn't manage to outperform the B&H benchmark on the recent data (May to August), I immediately dismissed it (except for EMA20/10), based on my initial assumption that performance on recent data matters most.
  
Results are ranked by profit on recent history (h1), followed by profit on the entire history (h2), the 'long' and 'short' average parameter, the optimal 'threshold' values and finally, number of trades executed.

Code:
time periods
------------

h1: 2013-05-04 to 2013-08-22 (110 days)

h2: 2012-10-22 to 2013-08-22 (304 days)


EMA results
-----------

* 1h EMA20+10, -0.3/0.3
  h1: +2.5%, 41 trades
  
* 1h EMA24+15, -0.4/0.4
  h1: +32%, 19 trades
  h2: +518%
  
* 1h EMA29+18, -0.25/0.25
  h1: +38%, 23 trades
  h2: +850%

* 1h EMA28+18, -0.4/0.4
  h1: +42%, 15 trades
  h2: +823%
 
Code:
benchmark
---------

recent history (h1): 2013-05-04 to 2013-08-22 (110 days), B&H profit: +9.9%

entire history (h2): 2012-10-22 to 2013-08-22 (304 days), B&H profit: +945%

Pretty good recent profits for the hourly methods, huh? But did you notice that I didn't find a single hourly EMA method that outperforms B&H on recent data AND on the entire history? Some come close though, EMA29+18 gives +850% on h2 vs. B&H 945% on h2.

But as I said several times, I don't think performance on the older data is equally important. It mainly serves as a sanity check to protect us from too much curve fitting. Here's an example of such curve fitting: I found some parameter combinations that performed even better than the ones I listed when set to some very high threshold value, like -1.8/1.8, or some odd combination of threshold, like -0.2/1.8. If you test those parameters on the older history (h2) however, you'll see that it falls apart. That's a pretty good indicator that those parameters where the result of curve fitting.

In conclusion, several hourly parameter combinations drastically outperform B&H during h1, even with the rather high trading fee I chose. Those methods perform well enough on the entire history as well, so I expect them to be reasonably generalized and perform well enough in the (near) future.


Daily intervals

Thresholds were 0 for all of the daily results. The daily EMA crossover method is "cautious" enough already and doesn't benefit from thresholds, it seems.

Code:
EMA results
-----------

* 1d EMA21+20
  h1: +4%, 3 trades
  h2: +826%

* 1d EMA37+5
  h1: +6%, 5 trades
  h2: +288%

* 1d EMA24+15
  h1: +7%, 3 trades
  h2: +826%

* 1d EMA21+18
  h1: +9%, 3 trades
  h2: +847%

* 1d EMA29+12
  h1: +12%, 3 trades
  h2: +827%

* 1d EMA20+10
  h1: +17%, 3 trades
  h2: +366%
  
* 1d EMA5+1
  h1: +20%, 19 trades
  h2: +1339%
  
* 1d EMA20+1
  h1: +23%, 9 trades
  h2: +878%

* 1d EMA23+3
  h1: +24%, 5 trades
  h2: +564%

* 1d EMA24+2
  h1: +24%, 5 trades
  h2: +727%

* 1d EMA20+6
  h1: +32%, 3 trades
  h2: +676%

* 1d EMA16+4
  h1: +32%, 3 trades
  h2: +639%
 

Code:
benchmark
---------

recent history (h1): 2013-05-04 to 2013-08-22 (110 days), B&H profit: +9.9%

entire history (h2): 2012-10-22 to 2013-08-22 (304 days), B&H profit: +945%

As you can see, daily method profits on recent history are somewhat lower than those of the hourly variant, but the number of trades is much lower as well.

Also, I think I found the answer to a question that came up earlier in this thread. Marcus Antonius reported that daily EMA20+21 generated a spectacular 3533% profit over the entire history of trading. The h2 profit of that parameter in my own test confirm this, it is rather high at +826%. Applying this parameter to the recent data h1 however is much less spectacular, only +4% profit. It's up to you to decide of course, but I wouldn't trust a method, that once upon a time performed extremely well, but in the past months failed to generate any serious profits.

On to the better parameters: 20+6 for example performs very well on recent data (+32%) and reasonably well on the entire history (+676%, vs. B&H 945%).

One strange beast showed up in my search: EMA5+1 is a rather fast version of the daily method, compared to the other parameter combinations (see the high number of trades). It performs relatively well on recent data, and *extremely* well on the old data. I'm not sure what to make of it, but I suggest to watch how this combination performs in the future.


Summary / Conclusions

  • There seems to be a trade-off between "historical" performance and "recent" performance. My assumption was that recent performance is more important for future performance, but we also need to look at performance in the more distant past to check how consistently profitable the found parameters really are.


  • EMA20+10 is dead. At least with hourly interval size.


  • Hourly EMA crossovers absolutely need threshold values to be profitable, especially if we assume relatively high cost of trading (fees+slippage).


  • One of the best *hourly* parameters I found during my search: EMA28+18, threshold -0.4/0.4. Profit May to August: +42% (vs. B&H profit +9.9%). Parameters hold up well in the "historical" back-test as well.


  • Good *daily* parameters: EMA20+6, EMA16+4. Both generate +32% profit on recent data. Note that those profits were generated with very few trades (3), which could be important if you want to trade as seldom as possible, and if your trading volume is large enough that your profits are reduced by slippage.


  • Another profitable *daily* combination: EMA20+1. Profit May to August is +23% (less than the ones above), but still outperforms B&H during recent history. Note that this combination performed better on historical data, and it generated the recent history profit with a total of 9 trades, more than the parameters above, which increases the chance that future results are somewhat in line with historic results.[1]


  • Which interval is better, hourly or daily? Hourly EMA methods can generate higher total profits in principle, but there's a trade-off: hourly interval requires a much higher number of trades to reach this profit, which means more work for the trader, more fees, more chance for slippage and more room to make mistakes. Personally, I would recommend using methods with daily interval size.


  • Here's my attempt to answer the recurring question "Can a simple strategy like EMA crossover actually beat B&H?". Answer: it depends. If you have (a) enough time to trade often, and more importantly: trade as soon as you receive a crossover signal, and (b) trade with a relatively small volume so that slippage stays manageable, then the crossover method beats B&H by a significant margin. On the other hand, if your goal is to trade as little as possible, or your trading volume is large enough that it causes significant slippage on your exchange, then B&H might be the better choice. But even if you use B&H, I would still suggest to use one of the daily EMA crossovers to determine at which point to *buy in*, e.g. to avoid buying in in the middle of a big correction/downtrend.


  • Another caveat: there's always the risk that past performance and future performance diverge. As we've seen, testing different EMA parameters on different partitions of the historical data yields very different results. There is always the possibility that the EMA parameters you choose now, based on back-testing, will actually generate a loss in the future. In practice this means you should probably define a limit up to which you trust your method: if the parameters you chose are unprofitable for, say, 2 or 3 months in a row, it might be time to look for new parameters.


Addendum: Higher Volume, Higher Slippage

As was pointed out in a discussion by your friendly neighborhood whale, Rampion, my initial assumptions about cost per trade don't hold for trading with relatively high volume. While the exchange fee will go down, slippage will drastically increase. So I decided to repeat parts of my test assuming even higher costs per trade. In order to estimate the expected slippage percentage, I knew I had to write a program that reads in historic trading data and estimates slippage as a function of order volume and market depth. Then I thought, fuck it, that's way too much work, and decided to guess the percentage instead. Half-assedly, even.

First, let's establish which kind of volume we're talking about. The results I posted above should hold for traders with an order volume of up to 100 btc. Looking at the recent market depth seems to confirm that orders of up to 100 btc should be filled not further than 1%, maybe 2% away from market price. (Note that slippage is defined by the cost of the entire order, so even if part of the order is filled at a much higher/lower price than market price, some parts probably were filled closer to market price.) Let's say then that 'higher volume' means order volume well above 100 btc, and up to around 1000 btc. Anything bigger than that takes us into proper whale territory, and I'm going to guess that EMA crossover strategies are not their method of choice.

Looking at the candles of some recent high volume orders (half-assed, remember?) I estimate the slippage range for orders between 100 btc and 1000 btc to be between 2% and 4%. Obviously, slippage varies wildly from day to day, but usually it should be possible to stay in that range, maybe breaking up an order in half if necessary.  Given those values, I repeated the backtest on the 'recent history' (h1) period for the most profitable daily parameters. Note that I didn't bother repeating the backtest of hourly EMA parameters: a quick look at their number of trades will show you that they become completely pointless with that kind of slippage, and will incur heavy losses. The results:

Code:

* 1d EMA5+1
  h1, 2%: -0.2%
  
* 1d EMA20+1
  h1, 2%: +13%
  h1, 3%: +3%
  h1, 4%: -5%

* 1d EMA23+3
  h1, 2%: +11%
  h1, 3%: +6%
  h1, 4%: +1.2%

* 1d EMA24+2
  h1, 2%: +19%
  h1, 3%: +14%
  h1, 4%: +8%

* 1d EMA20+6
  h1, 2%: +29%
  h1, 3%: +26%
  h1, 4%: +23%

* 1d EMA16+4
  h1, 2%: +29%
  h1, 3%: +25%
  h1, 4%: +22%

Not surprisingly, the "fast" daily parameter 5+1 (with a high number of trades) is almost as bad as the hourly parameters under such high trading costs. Several other parameters (e.g. 20+10, not listed here) only barely outperformed B&H in the original test, so after applying higher trading costs, they now fall below B&H profit. But three of the parameter combinations that combine high profits with a relatively low number of trades stay profitable even when applying higher trading costs (2%, 3%), and the two most profitable combinations of the previous test (20+6, 16+4) substantially outperform B&H's +10% even with a very high cost per trade of 4%.

Note also: One advantage of using B&H as our benchmark is that we can think of B&H as a special case of an EMA crossover strategy in which all crossover signals are ignored by the trader. Practically this means that a trader with high volume could in principle resolve to follow a profitable (daily) EMA crossover strategy, but only execute those orders that will be filled reasonably close to market price. In the worst case, he won't execute any trades, in which case his strategy will effectively be B&H, but he will never perform *worse* than B&H if he sets limit orders within the profitable range (around 4% max).[2] You could think of the profit numbers above as "maximum profit" then.


All of the above summed up, in bright red letters:

If your bitcoin investment is still relatively small, and you want to trade aggressively to increase your coin stash (and you don't mind spending a lot of time on it), consider one of the high profit hourly EMA parameter combinations, like EMA29+18 (threshold: -0.25/0.25) or EMA28+18 (threshold: -0.4/0.4). Watch your costs per trade though!

If you already own a larger amount of coins (or want to invest a large amount of fiat) and you know you have to be careful about slippage, or if you simply don't want to waste all your time on trading, consider one of the daily parameter combinations, like EMA20+6 and EMA16+4. Trade by setting limit orders within the profitable range.

Important for everyone who uses EMA crossovers: profitability of parameters changes over time. Don't expect the parameters that perform well now to still be the best ones in a year from now.





Footnotes:

[1] That assumption is based on intuition, but if necessary, I can offer a (sloppy) proof sketch.

[2] Not entirely true. In the worst case, a high-volume trader would be able to *sell* btc near market price, but since the emphasis of B&H is on holding btc, we have to buy back at some point, and it is conceivable that all opportunities to buy back btc would incur high slippage.
3537  Economy / Speculation / Re: Goomboo's Journal on: September 08, 2013, 12:59:22 PM
Preparing an addendum on 'higher volume trading'. Not as systematic as I would like it to be maybe, but I crudely estimated a range of slippage for higher volume (up to 1000btc) and will re-run the most promising parameter combinations (daily only, hourly will be pointless) with that range. Will be interesting, not sure if EMA can still beat B&H. I'll also repost it in a new thread once I'm done with that.
3538  Economy / Speculation / Re: Goomboo's Journal on: September 08, 2013, 11:06:09 AM
Oda: excellent post. You really covered everything. It definitely needs a thread on its own.

While I was reading it I was going to reply that when deciding a strategy, its mandatory to factor also a) the amount of time you will need to invest in trading and b) your trading volume, which will influence the amount of slippage you will have... But you already covered that too, bravo!

Finally, in my opinion 0.5% slippage on average is currently achieved by trading a rather smallish volume,  but I guess that it is a good estimation for 90% of the readers in this forum.

Thanks. Means something coming from you.

Re: slippage. When I ran the tests above I thought 1% fee is already rather high. Then we had a discussion about slippage with higher volumes, I boasted I never had trouble with it, and wham, a few hours later I suffered a loss mainly due to slippage. If I run another backtest, I will a) try to find a way to estimate slippage percentage as a function of volume and then b) run  different backtests with different "fee" values, i.e. how a method performs for small traders (say around 1 btc), medium traders (100 btc?) big traders (1000 btc maybe)
3539  Economy / Speculation / Re: Goomboo's Journal on: September 08, 2013, 10:46:07 AM
Warning: This is going to be an extremely long post. One day I will be able to write and explain my ideas in a more concise manner. Today is not that day. Consider yourself warned. There's a summary at the end that contains all the important bits, feel free to skip the rest.


Introduction

The following test of different EMA strategies was based on a few simple assumptions that can be summarized as follows:

(1) Recent performance (i.e. the result of back-testing on recent historical data) is a much greater factor in determining future profits than performance on older historical data.

(2) The simple parameter search we employ seems to favor curve fitting, which makes future performance of the parameters doubtful. Therefore, we need to back-test across different time segments to confirm results found in recent history.

(3) Trading is more expensive than previously assumed. It is necessary to take into account not only the rather high trading fees itself, but also slippage while executing a trade, and possibly even the delay between the EMA method signaling a trade and the trader executing it, which tends to cut into profits.


Methodology

The obvious parts: I'm using Gekko for back-testing, performing a search for optimal parameters for EMA crossover methods, yadda yadda yadday. All of the following is based on mtgox data.

I didn't perform an exhaustive search across those main EMA parameters, but only plugged in those values that had been previously established as profitable in this thread. In particular, I need to thank ErebusBat for his August 10 post, highlighting the profitable parameter ranges.

I only tested *hourly* and *daily* variants of the EMA method. A very sloppy test on 12h interval gave pretty bad results. I suspect that a 2h version of EMA crossovers (with different parameters of course) might peform quite well. I chose '1 hour' and '1 day' because I wanted to see results from the usable range of time periods: faster than 1h is almost certainly too sensitive, slower than 1d probably is too slow for the pretty volatile btc market.

Time period(s)

Like I said above, I believe it makes sense to put more weight on recent performance when trying to find optimal parameters for an EMA crossover trading strategy. The reason is simple: say a method performed spectacularly well during 2011 and 2012, but fails to generate any profit in the current year. It would be rather naive to simply look at the aggregate profit and conclude that the method will perform with that (aggregate) profit on average in the *future*. Basically, it would be nice if our method would have generated money not only in the distant past but also the last few months, right?

I decided to start the primary backtest after the April 10 peak, for the reason that the (double?) exponential growth  during the weeks before April was unusual, even for the fast bitcoin price movement. So post-peak it is. I based the decision where to start exactly after the peak on Bollinger Bandwidth (2h interval). Volatility around and immediately after the April 10 peak was extremely high, only around May 4th it went back to normal. Well, "bitcoin normal". So "recent history" is 2013-05-04 to 2013-08-22 (110 days). Almost 4 months, enough data to chew on in my opinion.

In addition, I needed another period to backtest the backtesting results on. For that I chose approximately a time period going back 1 year from, so the "entire history" is: 2012-10-22 to 2013-08-22 (304 days).

Benchmark

We need something to compare our results again, right? "Buy & hold" (from now on: B&H) is the obvious candidate. However, B&H is problematic. Why? You'll notice that when proponents of B&H on this forum talk about its profits, they assume you bought in at a really low price point, like in early January, or at the lowest point after the bubble burst in April. Which is bullshit of course. That's not "B&H", that's "magically knowing the local minimum", and if you can do that, you don't need trading advice anyway, you're already the richest person on Earth.

So let's define B&H for our purposes: B&H profit is calculated as the volume weighted 12h price in the middle of the last day of our testing period, divided by the price halfway through the first day of the testing period.

Gekko settings

As I said, I think most parameter searches in here assumed slightly too low trading costs. An actual trading fee of 0.5% is quite normal on mtgox as far as I know. Also, some slippage usually occurs (unless you buy or sell only minimal amounts). Finally,unless you have a trading bot, there will be a delay between the EMA method signalling a trade and the trade being executed, which often reduces profits. So I decided to set the "fee" value to 1%, which includes all profit reducing factors mentioned above. Note that setting this value higher favors B&H on the one hand, and "slower" EMA methods (i.e.  methods that react slower to trends, and yields less trade signals) on the other.

The intial history setting defines the number of candles at the beginning of the data that are reserved to calculate the EMA methods initial average values. Default is 100, but this is a bad value for our purposes: the EMA methods would include all the volatile data for the initial history that I carefully exluded. So candles is set to 1, which essentially means the EMA method buys immediately. Which is good, because that's what B&H, our benchmark, does as well, so they start on equal grounds.


Results

Finally.

Anyone still reading this?

Congratulations. You must be really bored.


Hourly intervals

The list starts with the classical EMA20/10, since that's how Goomboo's thread started. You will notice it performs pretty bad.

The only other parameters I list below are the ones that performed best during backtesting. In particular, if a parameter combination didn't manage to outperform the B&H benchmark on the recent data (May to August), I immediately dismissed it (except for EMA20/10), based on my initial assumption that performance on recent data matters most.
  
Results are ranked by profit on recent history (h1), followed by profit on the entire history (h2), the 'long' and 'short' average parameter, the optimal 'treshold' values and finally, number of trades executed.

Code:
time periods
------------

h1: 2013-05-04 to 2013-08-22 (110 days)

h2: 2012-10-22 to 2013-08-22 (304 days)


EMA results
-----------

* 1h EMA20+10, -0.3/0.3
  h1: +2.5%, 41 trades
  
* 1h EMA24+15, -0.4/0.4
  h1: +32%, 19 trades
  h2: +518%
  
* 1h EMA29+18, -0.25/0.25
  h1: +38%, 23 trades
  h2: +850%

* 1h EMA28+18, -0.4/0.4
  h1: +42%, 15 trades
  h2: +823%
 
Code:
benchmark
---------

recent history (h1): 2013-05-04 to 2013-08-22 (110 days), B&H profit: +9.9%

entire history (h2): 2012-10-22 to 2013-08-22 (304 days), B&H profit: +945%

Pretty good recent profits for the hourly methods, huh? But did you notice that I didn't find a single hourly EMA method that outperforms B&H on recent data AND on the entire history? Some come close though, EMA29+18 gives +850% on h2 vs. B&H 945% on h2.

But as I said several times, I don't think performance on the older data is equally important. It mainly serves as a sanity check, to protect us from too much curve fitting. Here's an example of such curve fitting: I found some combinations that perform *even better* when set to some very high treshold value, like -1.8/1.8, or some odd combination of treshold, like -0.2/1.8. If you test those parameters on the older history (h2) however, you'll see that it falls apart. That's a pretty good indicator that those parameters where the result of curve fitting.

In conclusion, several hourly parameter combinations drastically outperform B&H during h1, even with the rather high trading fee I chose. Those methods perform well enough on the entire history as well, so I expect them to be reasonably generalized and perform well enough in the (near) future.

Daily intervals

Tresholds were 0 for all of the daily results. The daily EMA crossover method is "cautious" enough already and doesn't benefit from tresholds, it seems.

Code:
EMA results
-----------

* 1d EMA21+20
  h1: +4%, 3 trades
  h2: +826%

* 1d EMA37+5
  h1: +6%, 5 trades
  h2: +288%

* 1d EMA24+15
  h1: +7%, 3 trades
  h2: +826%

* 1d EMA21+18
  h1: +9%, 3 trades
  h2: +847%

* 1d EMA29+12
  h1: +12%, 3 trades
  h2: +827%

* 1d EMA20+10
  h1: +17%, 3 trades
  h2: +366%
  
* 1d EMA5+1
  h1: +20%, 19 trades
  h2: +1339%
  
* 1d EMA20+1
  h1: +23%, 9 trades
  h2: +878%

* 1d EMA23+3
  h1: +24%, 5 trades
  h2: +564%

* 1d EMA24+2
  h1: +24%, 5 trades
  h2: +727%

* 1d EMA20+6
  h1: +32%, 3 trades
  h2: +676%

* 1d EMA16+4
  h1: +32%, 3 trades
  h2: +639%
 

Code:
benchmark
---------

recent history (h1): 2013-05-04 to 2013-08-22 (110 days), B&H profit: +9.9%

entire history (h2): 2012-10-22 to 2013-08-22 (304 days), B&H profit: +945%

As you can see, daily method profits on recent history are somewhat lower than those of the hourly variant, but the number of trades is much lower as well.

Also, I think I found the answer to a question that came up earlier in this thread. Marcus Antonius reported that daily EMA20+21 generated a spectacular 3533% profit over the entire history of trading. The h2 profit of that parameter in my own test confirm this, it is rather high at +826%. Applying this parameter to the recent data h1 however is much less spectacular, only +4% profit. It's up to you to decide of course, but I wouldn't trust a method, that once upon a time performed extremely well, but in the past months failed to generate any serious profits.

On to the better parameters: 20+6 for example performs very well on recent data (+32%) and reasonably well on the entire history (+676%, vs. B&H 945%).

One strange beast showed up in my search: EMA5+1 is a rather fast version of the daily method, compared to the other parameter combinations (see the high number of trades). It performs relatively well on recent data, and *extremely* well on the old data. I'm not sure what to make of it, but I suggest to watch how this combination performs in the future.


Summary / Conclusions

  • There's a trade-off between "historical" performance and "recent" performance. My assumption was that recent performance is more important for future performance, but we also need to look at performance in the more distant past to check how consistently profitable the found parameters really are.


  • EMA20+10 is dead. At least with hourly interval size.


  • Hourly EMA crossovers absolutely need treshold values to be profitable, especially if we assume relatively high cost of trading (fees+slippage).


  • One of the best *hourly* parameters I found during my search: EMA28+18, treshold -0.4/0.4. Profit May to August: +42% (vs. B&H profit +9.9%). Parameters hold up well in the "historical" back-test as well.


  • Good *daily* parameters: EMA20+6, EMA16+4. Both generate +32% profit on recent data. Note that those profits were generated with very few trades (3), which could be important if you want to trade as seldom as possible, and if your trading volume is large enough that your profits are reduced by large slippage.


  • Another profitable *daily* combination: EMA20+1. Profit May to August is +23% (less than the ones above), but still outperforms B&H during recent history. Note that this combination performed better on historical data, and it generated the recent history profit with a total of 9 trades, more than the parameters above, which increases the chance that future results are somewhat in line with historic results.


  • Which interval is better, hourly or daily? Hourly EMA methods can generate higher total profits in principle, but there's a trade-off: hourly requires a much higher number of trades to reach this profit, which means more work for the trader, more fees, more chance for slippage and more room to make mistakes. Personally, I would recommend using methods with daily interval size.


  • Here's my attempt to answer the recurring question "Can a simple strategy like EMA crossover actually beat B&H?". Answer: it depends. If you have (a) enough time to trade often, and more importantly: trade as soon as you receive a crossover signal, and (b) trade with a relatively small volume so that slippage stays manageable, then the crossover method beats B&H by a significant margin. On the other hand, if your goal is to trade as little as possible, or your trading volume is large enough that it causes significant slippage on your exchange, then B&H might be the better choice. But even if you use B&H, I would still suggest to use one of the daily EMA crossovers to determine at which point to *buy in*, e.g. to avoid buying in in the middle of a big correction/downtrend.


  • Another caveat: there's always the risk that past performance and future performance diverge. As we've seen, testing different EMA parameters on different partitions of the historical data yields very different results. There is always the possibility that the EMA parameters you choose now, based on back-testing, will actually generate a loss in the future. In practice this means you should probably define a limit up to which you trust your method: if the parameters you chose are unprofitable for, say, 2 or 3 months in a row, it might be time to look for new parameters.
3540  Economy / Speculation / Re: Wall Observer - MtGoxUSD wall movement tracker - Hardcore on: September 08, 2013, 10:14:38 AM

Really interesting. The super-exponential part really hit home, as I remember people figuring out that bitcoin was in super-exponential growth in the first week of April. Still, it doesn't really indicate how one should trade. Bubbles don't have to pop, it's just that the super-exponential behavior has an expiration date and "something" happens afterwards that is different.
The real issue to understand is where the super-exponential growth is coming from; what is the factor that is the main driver causing  the exponential growth.

For example: Is the underlying cause for this exponential behavior (up or down) "debt" related? If it is debt related, then it is artificial, it is manipulated, it is an illusion. On the other hand, if it is not caused by debt, but rather natural market forces, and "not leveraged", then there is no reason to believe that the growth is in any way artificial or unsustainable, in reality the price at any moment would reflect the "true" price; thus, bubbles would essentially not be formable. Basically it all comes down to debt and leverage. Debt adds risk. The more debt-leverage involved, the more the debt-related risk associated with it, exponentially. Most people are deceived by debt because they just look at the money, and they forget to think about risk. If you want a stable financial market, eliminate ALL debt. This means you have to actually save money and be productive in order to create wealth. Debt is borrowing money that you don't have...essentially it is like a race analogy.

Race Analogy: The person with debt "jumps the gun" and runs out in front of everyone else and gives the appearance of being a better athlete, yet he is not any better than the rest, and once it if finally discovered when they review the race....they have to start the race all over again...Once it is discovered that someone used debt and are not paying it back, there is a financial crisis and a "reset" of the financial race.

There's another, maybe simpler, explanation for why it's different for Bitcoin (yeah, yeah, bears I know. It's never different). Let's make the simplifying assumption that there is, at a give time, a fair but unknown evaluation of a commodity, and that the market attempts to discover it (pretty standard, right).

If our current ideas about the eventual importance of Bitcoin are even remotely right, then the current evaluation is still several orders of magnitude below that eventually "fair" evaluation. Note: it's okay that this is the case, markets take their time, and there's obviously a lot of risk.

Anyway, the argument in favor of double exponential growth is that because the gap is so huge between current evaluation and (what I stipulated as ) the eventually fair evaluation, any shift in market perception must result in huge growth, whether it corrects back afterwards or not.

If in some other, more mature, market the evaluation goes from, say, 95% of the fair value to 99% of the fair value, it can do so at more reasonable pace. Double exponential growth in those cases probably is a sign that a correction will happen.

In our case, if we're at 1% of the eventual evaluation, and try to go to, say, 50%, it has to be a at a breakneck pace. Sure, usually double exponential growth means correction in our little market as well, but the way it seems to go is a frantic race that increases price 10-fold, then corrects back to half of that, or maybe a third. So what's left of the initial growth is still pretty impressive.
Pages: « 1 ... 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 [177] 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 »
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!