Bitcoin Forum
December 09, 2016, 09:42:48 PM *
News: To be able to use the next phase of the beta forum software, please ensure that your email address is correct/functional.
 
   Home   Help Search Donate Login Register  
Pages: « 1 ... 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 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 [53] 54 55 56 57 58 59 »
  Print  
Author Topic: Goomboo's Journal  (Read 250894 times)
TheUniporn
Member
**
Offline Offline

Activity: 83


View Profile
November 30, 2013, 09:52:30 PM
 #1041

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!
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
Bulbasaur
Newbie
*
Offline Offline

Activity: 13


View Profile
December 02, 2013, 06:27:57 PM
 #1042

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:

Quote
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?

Quote
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
*
Online Online

Activity: 1526


View Profile
December 02, 2013, 07:25:38 PM
 #1043

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.

https://www.bitcoin.org/bitcoin.pdf
While no idea is perfect, some ideas are useful.
12jh3odyAAaR2XedPKZNCR4X4sebuotQzN
Bulbasaur
Newbie
*
Offline Offline

Activity: 13


View Profile
December 02, 2013, 08:53:00 PM
 #1044

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
Sr. Member
****
Offline Offline

Activity: 409



View Profile
December 02, 2013, 11:29:27 PM
 #1045

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 Offline

Activity: 13


View Profile
December 03, 2013, 01:38:06 AM
 #1046

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
Hero Member
*****
Offline Offline

Activity: 742


View Profile
December 05, 2013, 05:21:03 AM
 #1047

Hi Goomboo,  currently reading reminiscences of a Stock Operator.  So far its a great book!
StarenseN
Legendary
*
Offline Offline

Activity: 1162



View Profile
December 05, 2013, 05:45:09 AM
 #1048

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.

Je donne des conseils et des cours de trading. MP Pour plus d'infos.
chriswen
Hero Member
*****
Offline Offline

Activity: 742


View Profile
December 05, 2013, 11:49:21 PM
 #1049

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
***
Offline Offline

Activity: 126

Bitstamp trader


View Profile
December 08, 2013, 07:42:41 PM
 #1050

update? how did the recent -35 % swing impact your strategy?

.
◥_________________
.
◥___________
.
◥_____
 BLUE VELVET CASINO 
.
_________________◤
.
___________◤
.
_____◤
Queeq
Sr. Member
****
Offline Offline

Activity: 426



View Profile
December 10, 2013, 09:01:33 AM
 #1051

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.

Python backtesting and bot script at Github
Development halted due to other priorities.
xybersurfer
Member
**
Offline Offline

Activity: 61


View Profile
December 10, 2013, 09:13:04 PM
 #1052

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)
chriswen
Hero Member
*****
Offline Offline

Activity: 742


View Profile
December 11, 2013, 04:46:03 AM
 #1053

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?
Queeq
Sr. Member
****
Offline Offline

Activity: 426



View Profile
December 11, 2013, 11:15:49 AM
 #1054


- 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?

Python backtesting and bot script at Github
Development halted due to other priorities.
paulluopaulluo
Newbie
*
Offline Offline

Activity: 14


View Profile
December 11, 2013, 06:57:11 PM
 #1055


- 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~

MY BTC address:1BaimbTphNvmd46kHs4Gv6Y5BuscHAoL48
ionication
Full Member
***
Offline Offline

Activity: 151


View Profile
December 11, 2013, 08:34:48 PM
 #1056

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
Sr. Member
****
Offline Offline

Activity: 426



View Profile
December 12, 2013, 11:31:56 AM
 #1057

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).


Python backtesting and bot script at Github
Development halted due to other priorities.
ionication
Full Member
***
Offline Offline

Activity: 151


View Profile
December 12, 2013, 01:56:11 PM
 #1058

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.
Queeq
Sr. Member
****
Offline Offline

Activity: 426



View Profile
December 12, 2013, 03:36:08 PM
 #1059


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).

Python backtesting and bot script at Github
Development halted due to other priorities.
paulluopaulluo
Newbie
*
Offline Offline

Activity: 14


View Profile
December 12, 2013, 10:32:22 PM
 #1060

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.png

2 minutes tick:
http://s27.postimg.org/6vciowrgf/plot_2m.png

15 minutes tick:
http://s27.postimg.org/nx5cr06bj/plot_15m.png


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.

http://s9.postimg.org/tatmqdwzf/plot_6h.jpg

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).




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!

MY BTC address:1BaimbTphNvmd46kHs4Gv6Y5BuscHAoL48
Pages: « 1 ... 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 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 [53] 54 55 56 57 58 59 »
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!