Author Topic: BAIP4: use 1 hours period EMA(6) to instead of BAIP 2  (Read 2036 times)

0 Members and 1 Guest are viewing this topic.

Offline litepresence

Suggestion!

Instead of hoarding debt to stuff your mattress with bitfiat,
and crying for changes to the borrowing rules every couple days like a child:

Why not consider only borrowing when you intend to short the market,
then buy back for cheaper and profit like a typical margin trader?

 ???


Offline binggo

  • Hero Member
  • *****
  • Posts: 2374
  • 世间太多瘪犊子
    • View Profile
Adjustment factor X=4.5,data come from huobi 1 hour EMA6,2020/02/15 22:00 to 2020/02/17 03:00



| EMA\(6\) | CEX PRICE   | FEED PRICE      | EMA WEIGHT   | CEX weight    | spread    | FALL       |
|-----------|---------|----------|----------|----------|----------|----------|
| 0\.0389   | 0\.0366 | 0\.0370  | 0\.1911  | 0\.8089  | 1\.2007% | 6\.28%   |
| 0\.0385   | 0\.0332 | 0\.0343  | 0\.2049  | 0\.7951  | 3\.2709% | 15\.96%  |
| 0\.0373   | 0\.034  | 0\.0346  | 0\.1960  | 0\.8040  | 1\.9024% | 9\.71%   |
| 0\.0364   | 0\.0332 | 0\.0338  | 0\.1959  | 0\.8041  | 1\.8883% | 9\.64%   |
| 0\.0359   | 0\.0346 | 0\.0348  | 0\.1874  | 0\.8126  | 0\.7040% | 3\.76%   |
| 0\.0357   | 0\.0345 | 0\.0347  | 0\.1870  | 0\.8130  | 0\.6503% | 3\.48%   |
| 0\.0354   | 0\.0346 | 0\.0347  | 0\.1852  | 0\.8148  | 0\.4283% | 2\.31%   |
| 0\.0353   | 0\.0348 | 0\.0349  | 0\.1839  | 0\.8161  | 0\.2643% | 1\.44%   |
| 0\.0352   | 0\.0346 | 0\.0347  | 0\.1844  | 0\.8156  | 0\.3198% | 1\.73%   |
| 0\.035    | 0\.034  | 0\.0342  | 0\.1862  | 0\.8138  | 0\.5476% | 2\.94%   |
| 0\.035    | 0\.0349 | 0\.0349  | 0\.1822  | 0\.8178  | 0\.0522% | 0\.29%   |
| 0\.0351   | 0\.0351 | 0\.0351  | 0\.1818  | 0\.8182  | 0\.0000% | 0\.00%   |
| 0\.0355   | 0\.0361 | 0\.0361  | 0\.1793  | 0\.8207  | 0\.0000% | \-1\.66% |
| 0\.0357   | 0\.0361 | 0\.0361  | 0\.1802  | 0\.8198  | 0\.0000% | \-1\.11% |
| 0\.0359   | 0\.0355 | 0\.0356  | 0\.1835  | 0\.8165  | 0\.2068% | 1\.13%   |
| 0\.0358   | 0\.0355 | 0\.0356  | 0\.1831  | 0\.8169  | 0\.1547% | 0\.85%   |
| 0\.0357   | 0\.0354 | 0\.0355  | 0\.1831  | 0\.8169  | 0\.1551% | 0\.85%   |
| 0\.0357   | 0\.0351 | 0\.0352  | 0\.1844  | 0\.8156  | 0\.3151% | 1\.71%   |
| 0\.0356   | 0\.035  | 0\.0351  | 0\.1844  | 0\.8156  | 0\.3160% | 1\.71%   |
| 0\.0354   | 0\.0336 | 0\.0339  | 0\.1897  | 0\.8103  | 1\.0163% | 5\.36%   |
| 0\.035    | 0\.0333 | 0\.0336  | 0\.1893  | 0\.8107  | 0\.9666% | 5\.11%   |
| 0\.0345   | 0\.0332 | 0\.0334  | 0\.1876  | 0\.8124  | 0\.7346% | 3\.92%   |
| 0\.0342   | 0\.0324 | 0\.0327  | 0\.1900  | 0\.8100  | 1\.0556% | 5\.56%   |
| 0\.034    | 0\.0326 | 0\.0329  | 0\.1882  | 0\.8118  | 0\.8080% | 4\.29%   |
| 0\.0337   | 0\.032  | 0\.0323  | 0\.1896  | 0\.8104  | 1\.0075% | 5\.31%   |
| 0\.0333   | 0\.0301 | 0\.0307  | 0\.1973  | 0\.8027  | 2\.0979% | 10\.63%  |
| 0\.0328   | 0\.0303 | 0\.0308  | 0\.1939  | 0\.8061  | 1\.5999% | 8\.25%   |
| 0\.0323   | 0\.0317 | 0\.0318  | 0\.1846  | 0\.8154  | 0\.3494% | 1\.89%   |
| 0\.0322   | 0\.0305 | 0\.0308  | 0\.1900  | 0\.8100  | 1\.0592% | 5\.57%   |
| 0\.0317   | 0\.0305 | 0\.0307  | 0\.1876  | 0\.8124  | 0\.7382% | 3\.93%   |


---------------------------
Adjustment factor X=4.5,data come from ZB,2020-02-26 08:00 到 2020-02-26 13:00



| EMA\(6\) | CEX PRICE   | FEED PRICE      | EMA WEIGHT   | CEX weight    | spread    | FALL       |
|-----------|---------|----------|----------|----------|-----------|---------|
| 0\.2069   | 0\.185  | 0\.1894  | 0\.1991  | 0\.8009  | 2\.3564%  | 11\.84% |
| 0\.2036   | 0\.1429 | 0\.1575  | 0\.2405  | 0\.7595  | 10\.2148% | 42\.48% |
| 0\.1961   | 0\.1725 | 0\.1773  | 0\.2017  | 0\.7983  | 2\.7592%  | 13\.68% |
| 0\.1905   | 0\.175  | 0\.1780  | 0\.1948  | 0\.8052  | 1\.7252%  | 8\.86%  |
| 0\.1875   | 0\.1778 | 0\.1796  | 0\.1899  | 0\.8101  | 1\.0358%  | 5\.46%  |
| 0\.1863   | 0\.1815 | 0\.1824  | 0\.1857  | 0\.8143  | 0\.4912%  | 2\.64%  |
« Last Edit: March 05, 2020, 09:23:41 am by binggo »

Offline binggo

  • Hero Member
  • *****
  • Posts: 2374
  • 世间太多瘪犊子
    • View Profile
BAIP4:  use 1 hours period EMA(6) to instead of BAIP 2
https://github.com/bitshares/baips/issues/12


Current price : The real-time BTS price of CEX, and notice: we still have many feed provider give a most lower feed price of CEX.

1 hours period EMA(6): Get the bar data from CEX,then calculate out the EMA6.

Weighting factor:  EMA(6) is the latest bar.

Weighting factor of EMA(6)= EMA(6) / (X * current price + EMA(6)), We can try X=6 first,X=(1,10)

Quote
FEED PRICE =max(weighting factor * 1 hours period EMA(6) + weighting factor * current price,current price)

Explanation:

As the EMA(6)come from the latest finished 1 hour bar, and the current price come from the next hour which the 1 hour didn't finish, so the feed price was constituted by a fixed EMA(6)in 1 hour and a variable current price.

If use proportion of weighting factor, the weighting factor of EMA(6)will be great when the price spread became great between EMA(6)and current price, the value of X will determine the upper limit,  if the price spread became small, the weight of EMA(6) will become small followling.

This FEED PRICE can track the real-time price more quickly, can avoid the lower shadow and repair price more faster(but still need 5/6 hours to repair).

Shorting attack will need more time to make the price down.

There still have a big discount space, so i think to add the weighting factor * current price to make the big discount space more smaller.

Weighting factor * current price will increase the nondeterminacy of feed price.



We can get the EMA6 can track the real-time price more quickly, and have enough price buffer.
Repair price more faster(but still need 5/6 hours to repair).






The price had plummeted in 09/25/2019, many users were margin called by the lower shadow.






Why we not use 30m or smaller period, we can check below, almost didn't have bar.




This is the EMA3, can track more faster, but maybe we shouldn't use it now.




https://bitsharestalk.org/index.php?topic=32143.msg341235;topicseen#msg341235
https://github.com/bitshares/baips/issues/4
https://github.com/bitshares/baips/issues/7

EMA, DEMA, XEMA
« Last Edit: March 08, 2020, 07:32:21 am by binggo »