Pages:
Author

Topic: Goomboo's Journal - page 7. (Read 281459 times)

newbie
Activity: 7
Merit: 0
December 14, 2013, 06:10:50 AM
See below. Notice especially the area with the short between 41-43 and the long around 25.

http://www.canalphotos.nl/Afbeelding1.jpg

And a sample run of Gekko on the EMA pair short 42, long 25:

Code:
2013-12-14 12:09:10 (INFO):     ADVICE is to BUY @ 728.000 (7.710)      at      2013-12-07 12:59:57
2013-12-14 12:09:10 (INFO):     ADVICE is to SELL @ 962.900 (-0.511)    at      2013-12-09 09:59:59
2013-12-14 12:09:10 (INFO):     ADVICE is to BUY @ 908.610 (0.330)      at      2013-12-12 04:59:59
2013-12-14 12:09:10 (INFO):     ADVICE is to SELL @ 972.010 (-0.255)    at      2013-12-13 11:59:54


2013-12-14 12:09:10 (INFO):             WARNING: BACKTESTING FEATURE NEEDS PROPER TESTING
2013-12-14 12:09:10 (INFO):             WARNING: ACT ON THESE NUMBERS AT YOUR OWN RISK!


2013-12-14 12:09:10 (INFO):     (PROFIT REPORT) start time:                      2013-12-07 11:59:59
2013-12-14 12:09:10 (INFO):     (PROFIT REPORT) end time:                        2013-12-13 22:55:35
2013-12-14 12:09:10 (INFO):     (PROFIT REPORT) timespan:                        6 days

2013-12-14 12:09:10 (INFO):     (PROFIT REPORT) start price:                     1065.1
2013-12-14 12:09:10 (INFO):     (PROFIT REPORT) end price:                       891
2013-12-14 12:09:10 (INFO):     (PROFIT REPORT) Buy and Hold profit:             -16.345883%

2013-12-14 12:09:10 (INFO):     (PROFIT REPORT) amount of trades:                4
2013-12-14 12:09:10 (INFO):     (PROFIT REPORT) original simulated balance:      1000.000000 USD
2013-12-14 12:09:10 (INFO):     (PROFIT REPORT) current simulated balance:       1403.670563 USD
2013-12-14 12:09:10 (INFO):     (PROFIT REPORT) simulated profit:                403.670563 USD (40.367056%)
2013-12-14 12:09:10 (INFO):     (PROFIT REPORT) simulated yearly profit:         23951.120080 USD (2395.112008%)
newbie
Activity: 7
Merit: 0
December 14, 2013, 05:23:19 AM
Very interesting stuff Goomboo. Respect.
I've been running soms backtests using Gekko from Whydifficult (again many respect).

What I've done is creating a script which alters the ema pair in the config file and loops Gekko over this. I'm on my phone now so can't upload the results. Quite similar to queeq, but haven't read his post while making the script...

A very interesting outcome is that the ema pairs which have a short period bigger than the long gives very consistent high profit percentages. Way higher than the other way around. Also looking at the buy sell moments it tends to buy low and sell high pretty good.

data period is last 1.5 weeks and interval is 1h.

Any insights on this?

I will upload files when on laptop.
sr. member
Activity: 427
Merit: 250
December 13, 2013, 04:16:27 AM
WOW that great, thanks you a lot!!

this program can run @ WIN or just @linux ?

& can i humbly ask you draw 5 MIN?

thanks again!

5 min tick for dec.05 - dec.12:


Welcome.

The script can be run on both Win and Linux (or any other OS which has ability to run Python scripts). However it needs some adaptation for that, but I moved my focus to slightly different area. Though anyone can do that as it's open-source and available on Github.
newbie
Activity: 13
Merit: 0
December 12, 2013, 05:32:22 PM
sr. member
Activity: 427
Merit: 250
December 12, 2013, 10:36:08 AM

Thank you so much for such a prompt service! :-) That's a rather surprising result to me.


Welcome. If you find any discrepancies with your own calculations - let me know so we can find where's an error.

Quote
Not sure if we are talking about the same thing. I was thinking of combining the heat maps that you already calculated in order to obtain a heat map that tells us which parameters work best independent of time period (1d, 6h, 1h).

Yes, now I see what you mean. However I think that such parameter would not be universal for all time periods. If you look closer at 30m-1h-2h graphs, you'll notice that 30m is kind of lower left corner of 1h, and 1h is the corner for 2h, which is pretty logical. Personally I think that 1h period is the most stable in the sense that for different samples the area of high profitability lays around the same values. Looking at it, I think that these values group somewhere around 13-27 pair (for SMA).
full member
Activity: 152
Merit: 100
December 12, 2013, 08:56:11 AM
Here's the 6-hour tick size analysis for the last 6 months. Beware, that color coding is different now from the one of previous plots as I ran the script only against 6-hour resolution, so minimum and maximum is taken only from this calculation.



Thank you so much for such a prompt service! :-) That's a rather surprising result to me.

Quote
Regarding described approach, it would require to add some more logic. If I understand correctly, that would be making the script to divide given period into several parts, compute profits for each part individually and then combine the results back. Frankly, I don't understand how would we benefit in this case: it would show the same result as if we just calculate the whole period at once.

Not sure if we are talking about the same thing. I was thinking of combining the heat maps that you already calculated in order to obtain a heat map that tells us which parameters work best independent of time period (1d, 6h, 1h).

Quote
What's for normalization, it's possible to see the particular profit in percentage of initial sum for any given case.
Actually we don't need normalization if all results are calculated over the same duration of time.
sr. member
Activity: 427
Merit: 250
December 12, 2013, 06:31:56 AM
Can you do this  1m 2m 15m in 12/5~12/12 ?

Want to know in this particular period how can we adjust our EMA strategy~

Here you are:

1 minute tick:


2 minutes tick:


15 minutes tick:



6h would be perfect, if possible - thank you!

From the "scientific" point of view it would be interesting to see how each set of parameters performs independent of time period. A simple approach would be to calculate an average of the (ideally normed to be comparable) perfomances of each parameter set in different time periods.

Here's the 6-hour tick size analysis for the last 6 months. Beware, that color coding is different now from the one of previous plots as I ran the script only against 6-hour resolution, so minimum and maximum is taken only from this calculation.



Regarding described approach, it would require to add some more logic. If I understand correctly, that would be making the script to divide given period into several parts, compute profits for each part individually and then combine the results back. Frankly, I don't understand how would we benefit in this case: it would show the same result as if we just calculate the whole period at once.

What's for normalization, it's possible to see the particular profit in percentage of initial sum for any given case. The other question is drawing normalized heatmap itself, but it would require storing all-time minimum and maximum profits. Moreover, a map for any period would not be much useful as it would mostly be of one particular color.

Anyway, currently I try to focus on getting the latest data from BTC-e API itself, as Bitcoincharts' CSV files are updated once or twice a day only. Then I plan to do realtime simulation of trading with particular pair(s).

full member
Activity: 152
Merit: 100
December 11, 2013, 03:34:48 PM
Or maybe you're interested in some particular period of time?

6h would be perfect, if possible - thank you!

From the "scientific" point of view it would be interesting to see how each set of parameters performs independent of time period. A simple approach would be to calculate an average of the (ideally normed to be comparable) perfomances of each parameter set in different time periods.
newbie
Activity: 13
Merit: 0
December 11, 2013, 01:57:11 PM

- what does the exp version show?
(i'm guessing exp=Exponential Moving Average and simple= Simple Moving Average)


That's right.



Can you do it so that it looks through more historical data?

Sure, here's the analysis for the last 6 months.

30 minutes tick:
http://s24.postimg.org/93p6ro4n5/plot_30m.png

1 hour tick:
http://s24.postimg.org/5mn4op5kx/plot_1h.png

2 hours tick:
http://s24.postimg.org/7pxjwd5dt/plot_2h.png

Or maybe you're interested in some particular period of time?

Can you do this  1m 2m 15m in 12/5~12/12 ?

Want to know in this particular period how can we adjust our EMA strategy~
sr. member
Activity: 427
Merit: 250
December 11, 2013, 06:15:49 AM

- what does the exp version show?
(i'm guessing exp=Exponential Moving Average and simple= Simple Moving Average)


That's right.



Can you do it so that it looks through more historical data?

Sure, here's the analysis for the last 6 months.

30 minutes tick:


1 hour tick:


2 hours tick:


Or maybe you're interested in some particular period of time?
hero member
Activity: 756
Merit: 500
December 10, 2013, 11:46:03 PM
Inspired by Goomboo's heatmap of profits, I wrote a Python script to automatically draw similar heatmaps for custom time periods. It works on Linux as this is the only OS I use. Anybody is free to adapt it to work on other systems (sorry, I have neither experience nor wish to do this).

Here's an example of what is drawn:


The script itself may be found on Github: https://github.com/Queeq/stock

I would also be happy to get advice from experienced Python programmers on how to make it better.

If somebody is interested in particular period but is too lazy/busy/inexperienced to draw graphs himself, I can do that for him and post it here. Required parameters are: time period with maximum resolution of one day, size of ticks to work on (5 minutes, 15 minutes, 30 minutes, 1 hour, 2 hours),

Currently I used it only with BTC-e historical data taken from Bitcoincharts, but it would work with every CSV-formatted historical datafile.

Can you do it so that it looks through more historical data?
member
Activity: 72
Merit: 10
December 10, 2013, 04:13:04 PM
Inspired by Goomboo's heatmap of profits, I wrote a Python script to automatically draw similar heatmaps for custom time periods. It works on Linux as this is the only OS I use. Anybody is free to adapt it to work on other systems (sorry, I have neither experience nor wish to do this).

Here's an example of what is drawn:


The script itself may be found on Github: https://github.com/Queeq/stock

I would also be happy to get advice from experienced Python programmers on how to make it better.

If somebody is interested in particular period but is too lazy/busy/inexperienced to draw graphs himself, I can do that for him and post it here. Required parameters are: time period with maximum resolution of one day, size of ticks to work on (5 minutes, 15 minutes, 30 minutes, 1 hour, 2 hours),

Currently I used it only with BTC-e historical data taken from Bitcoincharts, but it would work with every CSV-formatted historical datafile.
that heatmap looks good Queeq,

- what did you use as measurement unit?
(EDIT: nvm i see now that you used the ema's)

- what does the exp version show?
(i'm guessing exp=Exponential Moving Average and simple= Simple Moving Average)

also, i didn't know bitcoincharts.com had the historical data in CSV format (thanks for that)
sr. member
Activity: 427
Merit: 250
December 10, 2013, 04:01:33 AM
Inspired by Goomboo's heatmap of profits, I wrote a Python script to automatically draw similar heatmaps for custom time periods. It works on Linux as this is the only OS I use. Anybody is free to adapt it to work on other systems (sorry, I have neither experience nor wish to do this).

Here's an example of what is drawn:


The script itself may be found on Github: https://github.com/Queeq/stock

I would also be happy to get advice from experienced Python programmers on how to make it better.

If somebody is interested in particular period but is too lazy/busy/inexperienced to draw graphs himself, I can do that for him and post it here. Required parameters are: time period with maximum resolution of one day, size of ticks to work on (5 minutes, 15 minutes, 30 minutes, 1 hour, 2 hours),

Currently I used it only with BTC-e historical data taken from Bitcoincharts, but it would work with every CSV-formatted historical datafile.
full member
Activity: 126
Merit: 100
Bitstamp trader
December 08, 2013, 02:42:41 PM
update? how did the recent -35 % swing impact your strategy?
hero member
Activity: 756
Merit: 500
December 05, 2013, 06:49:21 PM
hey goomboo.  I think your the 10/21 EMA strategy is really overused right now.  Actually I think a its going to be really hard to make money using moving averages now.  Actually you might be able to make money betting against it.  It seems like there is always so much slippage after the moving averages touch.  And it the short term that is recovered.  Medium term those might be real.  But, yeah so many people implementing market orders on crossovers so theres just a massive red and green candle or green and red candle on the crossovers.

EDIT: Actually the large decrease might have caused the drop, I'm not sure. What % of volume do you think is from bots?
legendary
Activity: 2478
Merit: 1362
December 05, 2013, 12:45:09 AM
Hi Goomboo,  currently reading reminiscences of a Stock Operator.  So far its a great book!
I did it too thanks to that topic. The book was awsome.
hero member
Activity: 756
Merit: 500
December 05, 2013, 12:21:03 AM
Hi Goomboo,  currently reading reminiscences of a Stock Operator.  So far its a great book!
newbie
Activity: 13
Merit: 0
December 02, 2013, 08:38:06 PM
Thanks, Goomboo. I think I can see what you mean. I wonder if you could comment on how the exit point is chosen? For example, 0.20$ probably makes sense when BTC costs 10$, but not if it costs 1000$. Assuming they scale proportionally, the ratio of exit point and price seems to determine whether I would need leverage. Do you just treat this as another variable to backtest, or is there some 'rule of thumb?'

edit: I should read more carefully. "A backtested, thought-out stop loss is required to survive in the long run." So I suppose I should test different values around a commonsense starting point.
sr. member
Activity: 409
Merit: 250
December 02, 2013, 06:29:27 PM
I have no finance background so I'm having some trouble following this. If my understanding of leverage is correct, it would mean borrowing USD to buy BTC for long positions, and/or borrowing BTC to buy USD for short positions. If this is correct, then I have some specific questions:

1. Regarding '2.5 times leverage', does this mean for example that you're putting up 2.5 $ for every 1 $ you borrow when buying BTC? Or that you borrow 2.5$ for every 1 $ of your own?

2. How would this work for going short? I would think in that case you would sell your full BTC position (which itself may be leveraged) and then possibly borrow and sell additional BTC. What does the 2.5x refer to in this case?

That is correct, this would mean putting up $2.50 for every $1.00 in your account.  For shorting, this means selling 2.5 times the dollar value of your account in BTC.  This information is dated in that Bitcoinica no longer exists, but the principle remains the same.

I think I'm understanding most of this, but I'm struggling to see how leverage comes into play here. Here is my interpretation of the above example:

The only way I can see to include leverage in this example is if the max loss per trade is kept at 20$ regardless of the account balance, but wouldn't this mean increasing rather than decreasing risk as losses accrue? Additionally, I'm having trouble seeing how the selection of a particular exit point is compatible with the moving average crossover strategies. Isn't the exit point determined by the next crossover, and thus not known in advance? Or is the crossover strategy meant to include these predetermined exit points to protect against rapid price changes and provide a way to quantify and limit maximum loss?

When calculating how much you should trade using fixed-fractional money management, the flat price of the instrument is irrelevant.  All that matters is how much you will lose per contract/lot/share/coin in the distance between the entry point and the stop.  If I want to lose 2% of whatever my account balance is, then I trade at such a size that when my stop is hit, I lose 2% of my account balance.  If I have $1000 in my account and I'm risking 2% of my account balance with a stop $0.20 away, then I need to buy 100 coins.  A position of 100 coins moving $0.20 will result in a loss of $20.  If the price of BTC is greater than $10, then those 100 coins will cost more than your account balance - this is why you may or may not need leverage.

You are correct about the stop loss.  Without having a stop loss in place, it is very difficult to practice risk management in flat-price speculative trading.  If price were to fall by 30% immediately after you enter a new position, it would be silly to sit around waiting for a crossover before exiting.  A backtested, thought-out stop loss is required to survive in the long run.
newbie
Activity: 13
Merit: 0
December 02, 2013, 03:53:00 PM
I see... So if you wanted to enter a long position with 100$ and 2.5x leverage you'd buy 250$ worth of BTC (100$ + 150$ borrowed). I suppose then if you wanted to enter a short position with 100$ and 2.5x leverage, you'd borrow and sell 150$-worth of BTC?
Pages:
Jump to: