TheUniporn
Member
![*](https://bitcointalk.org/Themes/custom1/images/star.gif)
Offline
Activity: 83
Merit: 10
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
November 30, 2013, 09:52:30 PM |
|
Hello Goomboo! I have been looking for some time to take a peak into the trading word and after reading all your posts in this thread I think I did. Thank you!
|
|
|
|
Bulbasaur
Newbie
Offline
Activity: 13
Merit: 0
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 02, 2013, 06:27:57 PM |
|
First I would like to say thanks to Goomboo and the others who have been contributing to this thread. I read through the entire thing, and have learned a great deal. I'm in the process of backtesting now to decide on my strategy, but I have a few questions about risk management and leverage. Early in the thread, Goomboo wrote the following: I do use Bitcoinica, but I DO NOT use more than 2.5 times leverage. My method is a trend following system which simply means I'm looking for a new trend to start and I want to be trading in the direction of that trend as long as it remains. Trend following systems typically only have a 30% profitability ratio which means that if you trade, you have a 70% chance of being wrong and losing money on that trade. If you are using 10:1 leverage and are wrong 3-5 times in a row, you're bankrupt! 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? 3. Is 'shorting' BTC still viable post-Bitcoinica? Do any high-volume exchanges offer it now? I saw earlier in the thread that Goomboo was just selling his position on down-crosses and buying back in on up-crosses. Is shorting on a downturn any riskier than buying in on an upturn, or just another layer of complexity? Leverage is great in some situations, but it is a double-edged sword. The beautiful thing about leverage from my perspective is that it allows individuals to practice fixed-fractional money management on lower timeframes. Basically this means that leverage allows you to adhere to your risk management system by giving you buying power.
An example of an appropriate use of leverage: -You have a $1,000 account. -You are willing to risk 2% on a trade. This means that if you're wrong, you lose $20. -You know that a logical stop / place for you to exit if you are wrong is $.30 away from the market price. -This means that you should buy > Dollars At Risk / Price move > $20 / $.30 = 66 bitcoin. If you didn't have the money to buy 66 bitcoin, leverage finds a use. 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: 1. $1,000 account refers to how much of my own money I want to 'play with' in BTC (maximum I want to risk). 2. Rather than buying 1000$ worth of BTC (risking it all on one trade), I want to limit my potential losses to 2% of my account balance per trade to make sure that I can handle a string of losses without losing much. 3. By using a percentage of account balance as my exit point, my losses per trade will shrink if I continue to lose money (first 20$, then 19.60$, then 19.20$...). 4. Risking 20$ per trade doesn't mean buying 20$ worth of BTC, because I'm planning an exit point in advance (to lose 20$ on a 20$ trade would mean holding BTC all the way down to zero). 5. At the time of this example, the price was about 6$ per BTC; and a price move of $0.30 against my position would have been a reasonable exit point, meaning I would only lose $0.30 per BTC. To make this amount to 20$ in total would mean buying ($20 total)/($0.30 per BTC) = 66 BTC, or about 400$ worth of BTC. 6. *If you didn't have the money to buy 66 bitcoin, leverage finds a use.* Here's where I'm running into trouble. If I didn't have 400$ to buy 66 BTC, then the above calculation would never have told me to buy that many. For example, if I only had 300$, then 300*0.02=6$ would have been my maximum loss per trade. In this case I should only be buying 6$/0.30=20BTC or 120$ worth (which I can afford without leverage). 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?
|
|
|
|
notme
Legendary
Offline
Activity: 1904
Merit: 1002
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 02, 2013, 07:25:38 PM |
|
On my phone so I won't address everything but 2.5 leverage means you can trade 2.5 times your margin(the amount on deposit). Bitfinex.com allows margin trading.
|
|
|
|
Bulbasaur
Newbie
Offline
Activity: 13
Merit: 0
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 02, 2013, 08: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?
|
|
|
|
Goomboo (OP)
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 02, 2013, 11: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.
|
|
|
|
Bulbasaur
Newbie
Offline
Activity: 13
Merit: 0
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 03, 2013, 01:38:06 AM |
|
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.
|
|
|
|
chriswen
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 05, 2013, 05:21:03 AM |
|
Hi Goomboo, currently reading reminiscences of a Stock Operator. So far its a great book!
|
|
|
|
StarenseN
Legendary
Online
Activity: 2478
Merit: 1362
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 05, 2013, 05: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.
|
|
|
|
chriswen
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 05, 2013, 11:49:21 PM Last edit: December 07, 2013, 03:56:21 AM by chriswen |
|
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?
|
|
|
|
Trade101
Full Member
![*](https://bitcointalk.org/Themes/custom1/images/star.gif) ![*](https://bitcointalk.org/Themes/custom1/images/star.gif)
Offline
Activity: 126
Merit: 100
Bitstamp trader
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 08, 2013, 07:42:41 PM |
|
update? how did the recent -35 % swing impact your strategy?
|
. ◥_________________ . ◥___________ . ◥_____ BLUE VELVET CASINO . _________________◤. ___________◤. _____◤
|
|
|
Queeq
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 10, 2013, 09:01:33 AM Last edit: December 10, 2013, 11:12:04 AM by Queeq |
|
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: ![](https://ip.bitcointalk.org/?u=http%3A%2F%2Fs22.postimg.org%2F470iq12zx%2Fplot_1h.jpg&t=665&c=eWYGXcvRcig5jg) The script itself may be found on Github: https://github.com/Queeq/stockI 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.
|
|
|
|
xybersurfer
Member
![*](https://bitcointalk.org/Themes/custom1/images/star.gif)
Offline
Activity: 72
Merit: 10
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 10, 2013, 09:13:04 PM Last edit: December 10, 2013, 10:05:32 PM by xybersurfer |
|
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: ![](https://ip.bitcointalk.org/?u=http%3A%2F%2Fs22.postimg.org%2F470iq12zx%2Fplot_1h.jpg&t=665&c=eWYGXcvRcig5jg) The script itself may be found on Github: https://github.com/Queeq/stockI 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)
|
|
|
|
chriswen
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 11, 2013, 04:46:03 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: ![](https://ip.bitcointalk.org/?u=http%3A%2F%2Fs22.postimg.org%2F470iq12zx%2Fplot_1h.jpg&t=665&c=eWYGXcvRcig5jg) The script itself may be found on Github: https://github.com/Queeq/stockI 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?
|
|
|
|
Queeq
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 11, 2013, 11: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: ![](https://ip.bitcointalk.org/?u=http%3A%2F%2Fs24.postimg.org%2F93p6ro4n5%2Fplot_30m.png&t=665&c=DJvgap4A9keXPA) 1 hour tick: ![](https://ip.bitcointalk.org/?u=http%3A%2F%2Fs24.postimg.org%2F5mn4op5kx%2Fplot_1h.png&t=665&c=fvm_nqKt8HbjxQ) 2 hours tick: ![](https://ip.bitcointalk.org/?u=http%3A%2F%2Fs24.postimg.org%2F7pxjwd5dt%2Fplot_2h.png&t=665&c=p1-PbLPdf6XYWA) Or maybe you're interested in some particular period of time?
|
|
|
|
paulluopaulluo
Newbie
Offline
Activity: 13
Merit: 0
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 11, 2013, 06:57:11 PM |
|
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~
|
|
|
|
ionication
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 11, 2013, 08: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.
|
|
|
|
Queeq
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 12, 2013, 11: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: ![](https://ip.bitcointalk.org/?u=http%3A%2F%2Fs27.postimg.org%2Fwpmbeorgf%2Fplot_1m.png&t=665&c=ASXOpKCpFwYUSg) 2 minutes tick: ![](https://ip.bitcointalk.org/?u=http%3A%2F%2Fs27.postimg.org%2F6vciowrgf%2Fplot_2m.png&t=665&c=c1CtGMgOLO97aA) 15 minutes tick: ![](https://ip.bitcointalk.org/?u=http%3A%2F%2Fs27.postimg.org%2Fnx5cr06bj%2Fplot_15m.png&t=665&c=XJucKkJOT_o_sw) 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. ![](https://ip.bitcointalk.org/?u=http%3A%2F%2Fs9.postimg.org%2Ftatmqdwzf%2Fplot_6h.jpg&t=665&c=22DWPGhIkVPKZQ) 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).
|
|
|
|
ionication
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 12, 2013, 01:56:11 PM |
|
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. ![](https://ip.bitcointalk.org/?u=http%3A%2F%2Fs9.postimg.org%2Ftatmqdwzf%2Fplot_6h.jpg&t=665&c=22DWPGhIkVPKZQ) Thank you so much for such a prompt service! :-) That's a rather surprising result to me. 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). 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.
|
|
|
|
Queeq
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 12, 2013, 03:36:08 PM |
|
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. 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).
|
|
|
|
paulluopaulluo
Newbie
Offline
Activity: 13
Merit: 0
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 12, 2013, 10:32:22 PM Last edit: December 12, 2013, 11:11:52 PM by paulluopaulluo |
|
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: http://s27.postimg.org/wpmbeorgf/plot_1m.png2 minutes tick: http://s27.postimg.org/6vciowrgf/plot_2m.png15 minutes tick: http://s27.postimg.org/nx5cr06bj/plot_15m.png6h 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. http://s9.postimg.org/tatmqdwzf/plot_6h.jpgRegarding 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). 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!
|
|
|
|
|