Bitcoin Forum

Economy => Speculation => Topic started by: Bitcoin Swami on August 11, 2011, 02:39:53 AM



Title: Quick math question.
Post by: Bitcoin Swami on August 11, 2011, 02:39:53 AM
I know this question might seem a bit dumb but how much does the price need to go up on mt. gox before I can sell at a profit with their normal fee.

Say I bought one btc at 10, how much would it have to rise.  6 cents?


Title: Re: Quick math question.
Post by: JoelKatz on August 11, 2011, 02:44:01 AM
I know this question might seem a bit dumb but how much does the price need to go up on mt. gox before I can sell at a profit with their normal fee.

Say I bought one btc at 10, how much would it have to rise.  6 cents?
It takes a buy at $10.00 and a sell at $10.12 to break even.

Commission is (normally) .65%, so:

I buy 10 bitcoins at $10 each, cost is $100 plus $0.65 commission.

I sell 10 bitcoins at $10.12 each, I get $101.20 and pay $.55 commission.

Sell-Buy: $101.20 - $100 = $1.20
Total Commission: $1.20

Result: Breakeven


Title: Re: Quick math question.
Post by: Bitcoin Swami on August 11, 2011, 02:48:44 AM
I know this question might seem a bit dumb but how much does the price need to go up on mt. gox before I can sell at a profit with their normal fee.

Say I bought one btc at 10, how much would it have to rise.  6 cents?
It takes a buy at $10.00 and a sell at $10.12 to break even.

Commission is (normally) .65%, so:

I buy 10 bitcoins at $10 each, cost is $100 plus $0.65 commission.

I sell 10 bitcoins at $10.12 each, I get $101.20 and pay $.55 commission.

Sell-Buy: $101.20 - $100 = $1.20
Total Commission: $1.20

Result: Breakeven


Thanks Joel I was still figuring the .3 percent commission so i was getting screwed up. 
Thanks alot.
Mike


Title: Re: Quick math question.
Post by: Bitcoin Swami on August 11, 2011, 02:53:55 AM
I know this question might seem a bit dumb but how much does the price need to go up on mt. gox before I can sell at a profit with their normal fee.

Say I bought one btc at 10, how much would it have to rise.  6 cents?
It takes a buy at $10.00 and a sell at $10.12 to break even.

Commission is (normally) .65%, so:

I buy 10 bitcoins at $10 each, cost is $100 plus $0.65 commission.

I sell 10 bitcoins at $10.12 each, I get $101.20 and pay $.55 commission.

Sell-Buy: $101.20 - $100 = $1.20
Total Commission: $1.20

Result: Breakeven


One more question.  Has anyone made a calculator or chart online for quick reference when trading? instead of getting the ole windows (or linux) calculator out?)


Title: Re: Quick math question.
Post by: kiwiasian on August 11, 2011, 03:08:15 AM
Not sure what you're asking.....just do BTC(USD)(99.35%) and that's your total profit


Title: Re: Quick math question.
Post by: Bitcoin Swami on August 11, 2011, 03:17:23 AM
Not sure what you're asking.....just do BTC(USD)(99.35%) and that's your total profit

Guess I"m not totally sure what I'm asking either.  I was just thinking a chart where If I bought a bitcoin at 14 dollars it would just tell me the exact price i would need to sell at to break even (with fees included).  I'm sure it would take 2 seconds to program.  Is this a stupid idea? Am I too lazy? lol


Title: Re: Quick math question.
Post by: PatrickHarnett on August 11, 2011, 04:37:07 AM
you could use your brain


Title: Re: Quick math question.
Post by: TiagoTiago on August 11, 2011, 04:39:19 AM
Depending on the route the money takes, the comissions, taxes etc could be bigger for your roundtrip operation


Title: Re: Quick math question.
Post by: PatrickHarnett on August 11, 2011, 05:24:46 AM
Gox charges 0.65% on each side, so very roughly on your $10 coin, 13 cents.  (More precisely, 13.08 cents.)

Have one BTC
Sell 1 at $10.1308, pay 0.06585 commission, have 10.065.  then
Buy 1 at 10.0000, pay 0.06500 commission, have one BTC and no $$


Title: Re: Quick math question.
Post by: piramida on August 11, 2011, 06:20:36 AM
anything below 50 cents of volatility and you should not worry :) best up-and-down is after any big move, sell or buy does not matter. when the panic stops price goes up-down 1-2$ several times while seeking an average, that's the time to play.


Title: Re: Quick math question.
Post by: GeniuSxBoY on August 11, 2011, 09:57:05 AM
If the price is $10. What price would you have to sell at to get $10?

x= what price?
fee= .65%
how many fees? 2 since you are trading in and trading out.
Remember, even if 1btc = $10 you only have .9935 after the trade.
If you cash out right now, you'll have to pay another fee .9935 x ($10) = $9.935 minus .65% = $9.8704225
So you lose twice the fee for trading in and trading out.

Shortcut:
x = price you need to sell at.
y = price you want to start.
Plug in y, solve for x.

x - (.65%*2*x) = y
x - (.65%*2*x) = 10
x - .0130x = 10
.987x = 10
x ~= 10.131712259371833839918946301925

A variance of 13 cents.

If we were trading at $20
x - (.65%*2*x) = y
x - (.65%*2*x) = 20
x - .0130x = 20
.987x = 20
x ~= 20.26342451874366767983789260385

A variance of 26 cents.



Longcut:
 X = current price, Y = Price you want to sell at to break even.
If X=10
($X - $X*.0065)/$X * ($Y - $Y*.0065)  = $X
($10 - $10*.0065)/$10 * ($Y - $Y*.0065)  = $10
.9935 * ($Y - $Y*.0065) = $10
($Y - $Y*.0065) = 10/.9935
.9935Y = 10/.9935
Y = 10/.9935/.9935
Y = 10/.9935^2
Y = 10.131278574954618204033312657082


Title: Re: Quick math question.
Post by: NothinG on August 11, 2011, 10:23:49 AM
I know this question might seem a bit dumb but how much does the price need to go up on mt. gox before I can sell at a profit with their normal fee.

Say I bought one btc at 10, how much would it have to rise.  6 cents?
It takes a buy at $10.00 and a sell at $10.12 to break even.

Commission is (normally) .65%, so:

I buy 10 bitcoins at $10 each, cost is $100 plus $0.65 commission.

I sell 10 bitcoins at $10.12 each, I get $101.20 and pay $.55 commission.

Sell-Buy: $101.20 - $100 = $1.20
Total Commission: $1.20

Result: Breakeven

Hopefully I did this right :P
http://zombietoday.com/trade_calculator.php

Code:
<?php
echo "<center>What's the minimum price I would have to sell back at to break even?</center><br />";
if(
$_GET['volume']>&& $_GET['ppb']>&& is_numeric($_GET['volume']) && is_numeric($_GET['ppb']) && $_GET['fee']>&& is_numeric($_GET['fee']))
{
$volume $_GET['volume'];
$ppb $_GET['ppb'];
$fee $_GET['fee'];
$fee_c = ($fee 1000); //yea, I know...decided to not use the full percentage
$total_buy $volume $ppb;
$min_sell $total_buy + ($total_buy $fee_c);

echo "[Buy]: ".$total_buy."<br />";
echo "[Sell]: ".$min_sell."<br /><Br />";
echo "You paid ".$total_buy." USD for ".$volume." BTC; you will need to sell back at ".$min_sell." USD to break even.<br />";

} else {
$mtGoxAVG mtGoxAvg();
echo "<form method=get>";
echo "Buy <input type='text' name='volume' value='1' size='2'> @ <input type='text' name='ppb' value='".$mtGoxAVG."'><br />";
echo "Fee 0.<input type='text' name='fee' value='65' size='1'>%<br /> ";
echo "<input type='submit' value='calculate'></form>";
}
function 
mtGoxAvg()
{
$opts = array(
  'http'=> array(
'method'=>   "GET",
'user_agent'=>    "MozillaXYZ/1.0"));
$context stream_context_create($opts);
$json file_get_contents('https://mtgox.com/code/data/ticker.php'false$context);
$jdec json_decode($json);
return $jdec->{'ticker'}->{'avg'};
}
?>

[edit]: I have no idea what I coded...lol. Modify it math nerds ;D


Title: Re: Quick math question.
Post by: Bitcoin Swami on August 11, 2011, 05:03:23 PM
I know this question might seem a bit dumb but how much does the price need to go up on mt. gox before I can sell at a profit with their normal fee.

Say I bought one btc at 10, how much would it have to rise.  6 cents?
It takes a buy at $10.00 and a sell at $10.12 to break even.

Commission is (normally) .65%, so:

I buy 10 bitcoins at $10 each, cost is $100 plus $0.65 commission.

I sell 10 bitcoins at $10.12 each, I get $101.20 and pay $.55 commission.

Sell-Buy: $101.20 - $100 = $1.20
Total Commission: $1.20

Result: Breakeven

Hopefully I did this right :P
http://zombietoday.com/trade_calculator.php

Code:
<?php
echo "<center>What's the minimum price I would have to sell back at to break even?</center><br />";
if(
$_GET['volume']>&& $_GET['ppb']>&& is_numeric($_GET['volume']) && is_numeric($_GET['ppb']) && $_GET['fee']>&& is_numeric($_GET['fee']))
{
$volume $_GET['volume'];
$ppb $_GET['ppb'];
$fee $_GET['fee'];
$fee_c = ($fee 1000); //yea, I know...decided to not use the full percentage
$total_buy $volume $ppb;
$min_sell $total_buy + ($total_buy $fee_c);

echo "[Buy]: ".$total_buy."<br />";
echo "[Sell]: ".$min_sell."<br /><Br />";
echo "You paid ".$total_buy." USD for ".$volume." BTC; you will need to sell back at ".$min_sell." USD to break even.<br />";

} else {
$mtGoxAVG mtGoxAvg();
echo "<form method=get>";
echo "Buy <input type='text' name='volume' value='1' size='2'> @ <input type='text' name='ppb' value='".$mtGoxAVG."'><br />";
echo "Fee 0.<input type='text' name='fee' value='65' size='1'>%<br /> ";
echo "<input type='submit' value='calculate'></form>";
}
function 
mtGoxAvg()
{
$opts = array(
  'http'=> array(
'method'=>   "GET",
'user_agent'=>    "MozillaXYZ/1.0"));
$context stream_context_create($opts);
$json file_get_contents('https://mtgox.com/code/data/ticker.php'false$context);
$jdec json_decode($json);
return $jdec->{'ticker'}->{'avg'};
}
?>

[edit]: I have no idea what I coded...lol. Modify it math nerds ;D

Perfect, exactly what I was talking about.  Except the math is wrong but I think you notice that.


Title: Re: Quick math question.
Post by: Elwar on August 11, 2011, 05:34:36 PM
I know this question might seem a bit dumb but how much does the price need to go up on mt. gox before I can sell at a profit with their normal fee.

Say I bought one btc at 10, how much would it have to rise.  6 cents?
It takes a buy at $10.00 and a sell at $10.12 to break even.

Commission is (normally) .65%, so:

I buy 10 bitcoins at $10 each, cost is $100 plus $0.65 commission.

I sell 10 bitcoins at $10.12 each, I get $101.20 and pay $.55 commission.

Sell-Buy: $101.20 - $100 = $1.20
Total Commission: $1.20

Result: Breakeven

Hopefully I did this right :P
http://zombietoday.com/trade_calculator.php

Code:
<?php
echo "<center>What's the minimum price I would have to sell back at to break even?</center><br />";
if(
$_GET['volume']>&& $_GET['ppb']>&& is_numeric($_GET['volume']) && is_numeric($_GET['ppb']) && $_GET['fee']>&& is_numeric($_GET['fee']))
{
$volume $_GET['volume'];
$ppb $_GET['ppb'];
$fee $_GET['fee'];
$fee_c = ($fee 1000); //yea, I know...decided to not use the full percentage
$total_buy $volume $ppb;
$min_sell $total_buy + ($total_buy $fee_c);

echo "[Buy]: ".$total_buy."<br />";
echo "[Sell]: ".$min_sell."<br /><Br />";
echo "You paid ".$total_buy." USD for ".$volume." BTC; you will need to sell back at ".$min_sell." USD to break even.<br />";

} else {
$mtGoxAVG mtGoxAvg();
echo "<form method=get>";
echo "Buy <input type='text' name='volume' value='1' size='2'> @ <input type='text' name='ppb' value='".$mtGoxAVG."'><br />";
echo "Fee 0.<input type='text' name='fee' value='65' size='1'>%<br /> ";
echo "<input type='submit' value='calculate'></form>";
}
function 
mtGoxAvg()
{
$opts = array(
  'http'=> array(
'method'=>   "GET",
'user_agent'=>    "MozillaXYZ/1.0"));
$context stream_context_create($opts);
$json file_get_contents('https://mtgox.com/code/data/ticker.php'false$context);
$jdec json_decode($json);
return $jdec->{'ticker'}->{'avg'};
}
?>

[edit]: I have no idea what I coded...lol. Modify it math nerds ;D

Well done. It would help to add at the end "Price to sell back at to break even: "   eg. 10.12


Title: Re: Quick math question.
Post by: NothinG on August 11, 2011, 05:46:58 PM
Well done. It would help to add at the end "Price to sell back at to break even: "   eg. 10.12
I wrote the script at 5am.

Give me a few minutes and I'll add that.

[Edit]:
http://gyazo.com/ee34be5c37cce7747d2a1d2316ad3bc2.png
http://zombietoday.com/trade_calculator.php
Code:
<?php
echo "<center>What's the minimum price I would have to sell back at to break even?</center><br />";
if(
$_GET['volume']>&& $_GET['ppb']>&& is_numeric($_GET['volume']) && is_numeric($_GET['ppb']) && $_GET['fee']>&& is_numeric($_GET['fee']))
{
$volume $_GET['volume'];
$ppb $_GET['ppb'];
$fee $_GET['fee'];
$fee_c = ($fee 1000); //yea, I know...decided to not use the full percentage
$total_buy $volume $ppb;
$min_sell $total_buy + ($total_buy $fee_c);
$minMarket_low_sell = ($min_sell $volume);

echo "[Volume]: ".$volume."<br />";
echo "[Buy]: ".$total_buy."<br />";
echo "[Sell]: ".$min_sell."<br /><Br />";
echo "Minimum sell when Price Per Bitcoin is <u>".$minMarket_low_sell."USD</u> to break even.<br />";

} else {
echo "<form method=get>";
echo "Buy <input type='text' name='volume' value='1' size='2'> @ <input type='text' name='ppb' value='".mtGoxAvg()."'><br />";
echo "Fee 0.<input type='text' name='fee' value='65' size='1'>%<br /> ";
echo "<input type='submit' value='calculate'></form>";
}

function 
mtGoxAvg()
{
$opts = array(
  'http'=> array(
'method'=>   "GET",
'user_agent'=>    "MozillaXYZ/1.0"));
$context stream_context_create($opts);
$json file_get_contents('https://mtgox.com/code/data/ticker.php'false$context);
$jdec json_decode($json);
return $jdec->{'ticker'}->{'avg'};
}
?>
Enjoy!


Title: Re: Quick math question.
Post by: Elwar on August 11, 2011, 06:15:16 PM
Enjoy!

Perfect! Thanks.


One question though...where is everyone getting .65%?

When I trade on MtGox it shows:
Mt Gox charges a small fee (0.30%) for each trade.

And with .3% would it not be multiplying times .003? Or .006 for two trades.

So a transaction of buying 100 BTC at $10 would be $1000 with a break even point of $1006?


Title: Re: Quick math question.
Post by: NothinG on August 11, 2011, 06:17:07 PM
Enjoy!

Perfect! Thanks.


One question though...where is everyone getting .65%?

When I trade on MtGox it shows:
Mt Gox charges a small fee (0.30%) for each trade.

And with .3% would it not be multiplying times .003? Or .006 for two trades.

So a transaction of buying 100 BTC at $10 would be $1000 with a break even point of $1006?
I had the assumption the fee was 0.65% per trade. That's why it's a modifiable field.
I'll make some more modifications I guess.


Title: Re: Quick math question.
Post by: Elwar on August 11, 2011, 06:47:50 PM
Ahh, I see what is wrong.

You have: Fee: 0.[65]%  which uses 65 as a multiple. If you have a fee of just 0.[6] it uses 6 as a multiple.

So you have:

100 * 10 = 1000 with a selloff of 1065 for .65

and

100 * 10 = 1000 with a selloff of 1006 for .6


Title: Re: Quick math question.
Post by: xjosx on August 11, 2011, 06:48:09 PM
Well done. It would help to add at the end "Price to sell back at to break even: "   eg. 10.12
I wrote the script at 5am.

Give me a few minutes and I'll add that.

[Edit]:
http://gyazo.com/ee34be5c37cce7747d2a1d2316ad3bc2.png
http://zombietoday.com/trade_calculator.php
Code:
<?php
echo "<center>What's the minimum price I would have to sell back at to break even?</center><br />";
if(
$_GET['volume']>&& $_GET['ppb']>&& is_numeric($_GET['volume']) && is_numeric($_GET['ppb']) && $_GET['fee']>&& is_numeric($_GET['fee']))
{
$volume $_GET['volume'];
$ppb $_GET['ppb'];
$fee $_GET['fee'];
$fee_c = ($fee 1000); //yea, I know...decided to not use the full percentage
$total_buy $volume $ppb;
$min_sell $total_buy + ($total_buy $fee_c);
$minMarket_low_sell = ($min_sell $volume);

echo "[Volume]: ".$volume."<br />";
echo "[Buy]: ".$total_buy."<br />";
echo "[Sell]: ".$min_sell."<br /><Br />";
echo "Minimum sell when Price Per Bitcoin is <u>".$minMarket_low_sell."USD</u> to break even.<br />";

} else {
echo "<form method=get>";
echo "Buy <input type='text' name='volume' value='1' size='2'> @ <input type='text' name='ppb' value='".mtGoxAvg()."'><br />";
echo "Fee 0.<input type='text' name='fee' value='65' size='1'>%<br /> ";
echo "<input type='submit' value='calculate'></form>";
}

function 
mtGoxAvg()
{
$opts = array(
  'http'=> array(
'method'=>   "GET",
'user_agent'=>    "MozillaXYZ/1.0"));
$context stream_context_create($opts);
$json file_get_contents('https://mtgox.com/code/data/ticker.php'false$context);
$jdec json_decode($json);
return $jdec->{'ticker'}->{'avg'};
}
?>
Enjoy!

Are you sure the math is right? As stated in Joel's post, a $0.12 spread at $10 is enough to break even. According to yours, a $0.67 spread is required... That can't be right.


Title: Re: Quick math question.
Post by: Elwar on August 11, 2011, 06:52:46 PM
Works perfectly if you just use a single digit.

Or 6.5


Title: Re: Quick math question.
Post by: NothinG on August 11, 2011, 06:59:24 PM
If you want me to change the math around, give me a formula to work with.
So far everyone keeps saying my math is wrong.


Title: Re: Quick math question.
Post by: Elwar on August 11, 2011, 07:08:35 PM
Looks fine. You just do a $fee / 1000

Which is screwy since you have the decimal specified before the input.

So someone putting in: .60 and someone putting in .6 would end up with
60 / 1000
and
6 / 1000

Two very different numbers.

I am not sure how to add a decimal before a number in php.


Title: Re: Quick math question.
Post by: NothinG on August 11, 2011, 07:30:41 PM
Looks fine. You just do a $fee / 1000

Which is screwy since you have the decimal specified before the input.

So someone putting in: .60 and someone putting in .6 would end up with
60 / 1000
and
6 / 1000

Two very different numbers.

I am not sure how to add a decimal before a number in php.
I forgot I could divide with decimals.
[/fail]
http://zombietoday.com/trade_calculator.php?volume=1&ppb=9.905165356&liveppb=on&bfee=0.3&sfee=0.3
http://zombietoday.com/trade_calculator.php
xD


Title: Re: Quick math question.
Post by: Vandroiy on August 11, 2011, 09:23:11 PM
Profit criterion:

Buy price * (1 - commission fraction)^2 > sell price

Just use Wolfram Alpha when you have a browser around. For simple calculations, it responds quickly in JavaScript.


Title: Re: Quick math question.
Post by: Ellen Alemany on August 11, 2011, 09:37:44 PM
I buy 10 bitcoins at $10 each, cost is $100 plus $0.65 commission.
I sell 10 bitcoins at $10.12 each, I get $101.20 and pay $.55 commission.
It is not reasonable that for a larger transaction the commission is lower, it should be the other way around so there is a mistake here?
---

If f is the fee, B is the buying price and S is the selling price then break even is found when S/B = (1+f)/(1-f) since:
Our income = -B*(1+f) + S*(1-f) > 0 => S/B > (1+f)/(1-f)

In the case 0.003 and 0.0065 we get 1.00601805 and 1.01308505.

In other words, if you buy at $10, you sell at $10*1.01308505 or roughly $10.13.


Title: Re: Quick math question.
Post by: phorensic on August 12, 2011, 01:08:54 AM
What's funny is I have been using the dang Windows calculator do this for weeks and I have been wondering: "I wonder if someone has made an online app for this?"  Prayer answered!  Thank you sir


Title: Re: Quick math question.
Post by: NothinG on August 12, 2011, 01:56:02 AM
What's funny is I have been using the dang Windows calculator do this for weeks and I have been wondering: "I wonder if someone has made an online app for this?"  Prayer answered!  Thank you sir
No problem.
I added JSON ;D
http://zombietoday.com/trade_calculator.php?volume=1&liveppb=on&json=on&bfee=0.3&sfee=0.3

Simple usage for JSON in PHP?
Code:
<?php
echo minSell();

function 
minSell($volume=1,$ppb="live",$bfee=0.3,$sfee=0.3)
{
$url "http://zombietoday.com/trade_calculator.php?";
$url .= "volume=".$volume;
if($ppb=="live")
$url .= "&liveppb=on";
else
$url .= "&ppb=".$ppb;
$url .= "&bfee=".$bfee;
$url .= "&sfee=".$sfee;
$json file_get_contents($url."json=on");
$obj json_decode($json);
return $obj->{'mmsppb'};
}
?>

Like it?
1vfMrL8FWtKtUyUkarzotS3Q8Q9SQCopL


Title: Re: Quick math question.
Post by: Bitcoin Swami on August 12, 2011, 05:02:58 AM
Thanks alot man, you should put your donate address on the page.

I will donate when I mine a few more.

Glad other people think this was a good idea too!

Mike


Title: Re: Quick math question.
Post by: NothinG on August 12, 2011, 05:10:15 AM
Thanks alot man, you should put your donate address on the page.

I will donate when I mine a few more.

Glad other people think this was a good idea too!

Mike
Thanks, added to the page.

If anyone has something I should add, let me know.


Title: Re: Quick math question.
Post by: Tasty Champa on August 15, 2011, 03:17:33 AM
Thanks alot man, you should put your donate address on the page.

I will donate when I mine a few more.

Glad other people think this was a good idea too!

Mike
Thanks, added to the page.

If anyone has something I should add, let me know.

other way around. like how much money equals bitcoins minus fee.


Title: Re: Quick math question.
Post by: NothinG on August 15, 2011, 03:19:09 AM
Thanks alot man, you should put your donate address on the page.

I will donate when I mine a few more.

Glad other people think this was a good idea too!

Mike
Thanks, added to the page.

If anyone has something I should add, let me know.

other way around. like how much money equals bitcoins minus fee.
I don't understand.


Title: Re: Quick math question.
Post by: dub0matic on August 15, 2011, 03:36:12 AM
doesnt work to good. i just use mtgox calculator. but good job anyways


Title: Re: Quick math question.
Post by: NothinG on August 15, 2011, 03:42:45 AM
doesnt work to good. i just use mtgox calculator. but good job anyways
How does it not work too well?
What's wrong with it?


Title: Re: Quick math question.
Post by: dub0matic on August 15, 2011, 03:44:02 AM
doesnt work to good. i just use mtgox calculator. but good job anyways
How does it not work too well?
What's wrong with it?
you cant change the price


Title: Re: Quick math question.
Post by: Elwar on August 18, 2011, 06:07:39 PM
doesnt work to good. i just use mtgox calculator. but good job anyways
How does it not work too well?
What's wrong with it?
you cant change the price

You can change the price. Just turn off the options to the right of price.

Also, I finally saw on MtGox that they are saying .65% per trade on the trade page.


Title: Re: Quick math question.
Post by: GeniuSxBoY on August 19, 2011, 01:47:08 PM
Mine says Mt Gox charges a small fee (0.43 %) for each trade.


I'm so confused lol


Title: Re: Quick math question.
Post by: Elwar on August 25, 2011, 12:18:59 PM
Bump for a useful tool.

Thank you!