Pages:
Author

Topic: Bitcoinica "zhoutonging price" formulae (unofficial) - page 2. (Read 4245 times)

hero member
Activity: 607
Merit: 500
I made a simple script for adding this price to the Bitcoinica UI. Looks like this:



Download it here: http://dl.dropbox.com/u/1127246/bitcoinica.user.js

Drag it onto your Chrome browser window (should work in any browser that supports Greasemonkey scripts but I didn't test it elsewhere) and you're done. Hope it helps someone!

Note: this is my first real take on UserScripts. Any suggestions are welcome. Also, Bitcoinica UI refreshes in unusual way (instead of updating specific elements they pull whole tables with AJAX). That's why UI could flicker a bit with this (even though I'm intercepting the updater function with my code really early), I can't help with that.

Edit: Second note: this doesn't take account for LIMIT / STOP orders that you have between the current price and the min price. Maybe it will, someday.
full member
Activity: 184
Merit: 100
Feel the coffee, be the coffee.
Thanks for the info, bitcoinica has been great so far !
legendary
Activity: 1386
Merit: 1000
The FULL formula

If you are LONG,

"Zhoutonging price" = current bid - (margin balance + unrealized P/L - (base price * amount * 4%)) / amount

Please explain how "Tolerated loss" is calculated / used



It's not the same as "Maintenance margin".
sr. member
Activity: 321
Merit: 250
Bitbuy.nl!
From the user's perspective:
Mistake 1) will assume he has a typical "maintenance margin requirement" with no idea how close to typical it actually is
Mistake 2) will assume a constant margin balance, when actually that margin balance will decrease as the price of bitcoin decreases
Mistake 3) will calculate the "zhoutonging price" based on the current bid, which will of course change.  Checks back later when the bid is lower, and suddenly their "zhoutonging price" is different than what they calculated using "current bid".  Maybe even zhoutonged already.

Three strikes and you're out.

How about a formula for the "zhoutonging price" which uses variables instead of constants?

1) You're typical unless you explicitly request for a change (which will be rejected most likely).

2) Just a simple tweak will adjust for BTC balance. Original post edited.

3) If current price has changed, the net value should change too. The result should be consistent.


Thanks, I'm somewhat relieved now.  Hopefully bitcoinica users will be better on their guard. 

A massive influx of new people is already starting.  Most will not be experienced in trading of any sort let alone margin trading.  We know you realize that when your customers are losing, its bad for your business.  So its surprising that the zhoutong price isn't calculated and visible on the user's account stats. 

Any chance you'll add this value as a field on bitcoinica, so users don't have to calculate it manually?

Zhoutong, I think this is quite important. Though your site is pretty clear for people who understand what they're doing I think you should make your site more newcomer-friendly than it is now. Starting with bitcoinbull's suggestion.
hero member
Activity: 686
Merit: 500
Shame on everything; regret nothing.
Alright let's plug in some numbers and see if I have this correct:

5.5 * 90 * 0.04 = 19.8
margin + unrealized P/L = 174
174-19.8 = 154.2
154.2 / 90 = 1.7133333333333333
And so the price at which this position would be Zhoutonged would be current bid - 1.71 ?

I just want to bump this to make sure I understand correctly.
legendary
Activity: 826
Merit: 1001
rippleFanatic
From the user's perspective:
Mistake 1) will assume he has a typical "maintenance margin requirement" with no idea how close to typical it actually is
Mistake 2) will assume a constant margin balance, when actually that margin balance will decrease as the price of bitcoin decreases
Mistake 3) will calculate the "zhoutonging price" based on the current bid, which will of course change.  Checks back later when the bid is lower, and suddenly their "zhoutonging price" is different than what they calculated using "current bid".  Maybe even zhoutonged already.

Three strikes and you're out.

How about a formula for the "zhoutonging price" which uses variables instead of constants?

1) You're typical unless you explicitly request for a change (which will be rejected most likely).

2) Just a simple tweak will adjust for BTC balance. Original post edited.

3) If current price has changed, the net value should change too. The result should be consistent.


Thanks, I'm somewhat relieved now.  Hopefully bitcoinica users will be better on their guard. 

A massive influx of new people is already starting.  Most will not be experienced in trading of any sort let alone margin trading.  We know you realize that when your customers are losing, its bad for your business.  So its surprising that the zhoutong price isn't calculated and visible on the user's account stats. 

Any chance you'll add this value as a field on bitcoinica, so users don't have to calculate it manually?
vip
Activity: 490
Merit: 502
From the user's perspective:
Mistake 1) will assume he has a typical "maintenance margin requirement" with no idea how close to typical it actually is
Mistake 2) will assume a constant margin balance, when actually that margin balance will decrease as the price of bitcoin decreases
Mistake 3) will calculate the "zhoutonging price" based on the current bid, which will of course change.  Checks back later when the bid is lower, and suddenly their "zhoutonging price" is different than what they calculated using "current bid".  Maybe even zhoutonged already.

Three strikes and you're out.

How about a formula for the "zhoutonging price" which uses variables instead of constants?

1) You're typical unless you explicitly request for a change (which will be rejected most likely).

2) Just a simple tweak will adjust for BTC balance. Original post edited.

3) If current price has changed, the net value should change too. The result should be consistent.
legendary
Activity: 1145
Merit: 1001
I think it is important to tell people if they only have BTC in their currency account, then some strange effects happen.

---
First going long:
Namely, that even if you are trading with a 1:1 leverage you will get force liquidated at around 50% loss (assuming you are all in), not at 96% as in the account settings.

This is because when the BTC price drops then in addition to your P/L dropping your margin balance is also dropping. They basically meet at the halfway point.

On the good side, when the BTC price rises your margin balance increases. This means you are always able to buy relative to your BTC level in your currency account. That way you can always buy the same number of BTC no matter how high the price is. Your profits will be double, once in the P/L at Bitcionica and once in the value of your BTC in the currency account.

So with only BTC in your currency account you already effectively have a 2:1 leverage (even at 1:1 account setting)!

So, correct me if I'm wrong on this, but this means in this case (100% BTC in account) you must effectively calculate an increased leverage of your account settings (double?).

---
Second going short:
Here it also strange. If you go short with 100% BTC in your currency account then you make a profit but likewise your margin balance also goes down. So effectively you are gaining nothing (because your drop in value of your currency account offsets your profit). It's as if you have sold at the original price. If the price goes up you make a loss but also a gain in the value of your currency account, so again effectively no gain. This is at 1:1 leverage. For higher leverages I think you must halve the leverage (I think).



Is this correct Zhoutong?
vip
Activity: 490
Merit: 502
This post assumes your maintenance margin requirement is 4% or 25:1, which is applicable for typical Bitcoinica users.

Is it possible to get a different margin requirement?

Yes, it is. But only for very special accounts.

Normally we don't accept such requests.
legendary
Activity: 826
Merit: 1001
rippleFanatic
From the user's perspective:
Mistake 1) will assume he has a typical "maintenance margin requirement" with no idea how close to typical it actually is
Mistake 2) will assume a constant margin balance, when actually that margin balance will decrease as the price of bitcoin decreases
Mistake 3) will calculate the "zhoutonging price" based on the current bid, which will of course change.  Checks back later when the bid is lower, and suddenly their "zhoutonging price" is different than what they calculated using "current bid".  Maybe even zhoutonged already.

Three strikes and you're out.

How about a formula for the "zhoutonging price" which uses variables instead of constants?
hero member
Activity: 686
Merit: 500
Shame on everything; regret nothing.
Thanks Zhou, at last it is clear to me. I've been trading on margin for about 5 years and I am used to calculating leverage, expected profit, stops and margin calls in my head, just by looking at the prices of what I'm trading.

Until this post, I could not for the life of me figure out what your calculations were. I still don't get the logic behind it, but at least it is clear.

Yes I believe now I will be able to use Bitcoinica much more efficiently.
hero member
Activity: 686
Merit: 500
Shame on everything; regret nothing.
Alright let's plug in some numbers and see if I have this correct:

5.5 * 90 * 0.04 = 19.8
margin + unrealized P/L = 174
174-19.8 = 154.2
154.2 / 90 = 1.7133333333333333
And so the price at which this position would be Zhoutonged would be current bid - 1.71 ?
sr. member
Activity: 313
Merit: 251
Third score
Thanks Zhou, at last it is clear to me. I've been trading on margin for about 5 years and I am used to calculating leverage, expected profit, stops and margin calls in my head, just by looking at the prices of what I'm trading.

Until this post, I could not for the life of me figure out what your calculations were. I still don't get the logic behind it, but at least it is clear.
hero member
Activity: 686
Merit: 500
Bitbuy
This post assumes your maintenance margin requirement is 4% or 25:1, which is applicable for typical Bitcoinica users.

Is it possible to get a different margin requirement?
vip
Activity: 490
Merit: 502
"Zhoutonging price" = current ask/bid +/- (net value - maintenance) / amount


Am I to understand this as current ask DIVIDED BY bid, or current ask OR bid?

That was unclear. Edited. Thanks!
hero member
Activity: 686
Merit: 500
Shame on everything; regret nothing.
"Zhoutonging price" = current ask/bid +/- (net value - maintenance) / amount


Am I to understand this as current ask DIVIDED BY bid, or current ask OR bid?
vip
Activity: 490
Merit: 502
Even though I represent Bitcoinica on daily basis, I do not take any responsibility if this post in anyway affects your trading outcome.


This post serves as a guide to help you determine which price will trigger forced liquidation. This post assumes your maintenance margin requirement is 4% or 25:1, which is applicable for typical Bitcoinica users.

Some Background

Actual leverage = trade value / net value

net value = margin balance + unrealized P/L
trade value = base price * amount

The actual leverage of your account is dynamic. When you make a profit, the leverage is lower, and when you make a loss, the leverage is higher. However, you must meet the minimum requirement of margin, which determines that the highest leverage tolerated is 25:1 when you make a loss.

This means, at any time, your net value must be at least 4% of your trade value.

The FULL formula

If you are LONG,

"Zhoutonging price" = current bid - (margin balance + unrealized P/L - (base price * amount * 4%)) / amount

If you are SHORT,

"Zhoutonging price" = current ask + (margin balance + unrealized P/L - (base price * amount * 4%)) / amount

The SIMPLIFIED formula

You can get some figures from Bitcoinica UI directly. Then,

"Zhoutonging price" = current ask + (net value - maintenance) / amount

OR

"Zhoutonging price" = current bid - (net value - maintenance) / amount

EDIT:

This is important. If you have BTC balance, you must add that into your long position amount, or subtract it from your short position amount. At any point, your "zhoutonging price" should be constant regardless of market price if you don't trade.
Pages:
Jump to: