Author [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] Topic: Tip on keeping track on the current BTSX valuation on BTC38 for BTSX/BTC traders  (Read 644 times)

0 Members and 1 Guest are viewing this topic.

Offline AtomicBounce

  • Newbie
  • *
  • Posts: 19
    • View Profile

Hello,

With nearly 90% of the market volume, the BTSX/CNY trading pair on BTC38 is quite important to keep track of.

A site similar to BitcoinWisdom for the BTSX/CNY trading pair on BTC38 can be found here:
http://www.sosobtc.com/kline/btsx/btc38.html

If you are usually trading in BTC markets and not in CNY markets, it is kinda annoying to have to manually convert CNY prices to BTC prices to get a grasp of the current valuation of BTSX in China. I wrote a small script that automates this process. You can simply copy it into the URL bar while you are on sosobtc.com and press enter to execute it. After executing this script, a second price is shown on the site giving the always up-to-date BTSX value in BTC (using the current Huobi BTC/CNY ticker value for the conversion).

Code: [Select]
$('head').append('<style>.dark #sidebar #priceinbtc.green {color: #0F0;} .dark #sidebar #priceinbtc.red {color: #F00;};</style>');$('#price').after('<div id="priceinbtc" style="text-align:center;font-size: 18px;font-weight: bold;height: 40px;line-height: 40px;"></div>');function updateBTCPrice(){console.log('updateBTCPrice');var ticker=$('#ticker_huobi_btc').text();var huobi_btc_cny_ticker_val=ticker.substring(ticker.indexOf('¥')+1);var val = $('#trades .row:nth-of-type(1) .p').text()/huobi_btc_cny_ticker_val;$('#priceinbtc').text(Math.round(val * 10000000) / 10000000);$('#priceinbtc').attr('class',$('#trades .row:nth-of-type(1) .p').attr('class'));};updateBTCPrice();$('#trades').bind('DOMNodeInserted', updateBTCPrice);$('ul.nav-item-list.clearfix').bind('DOMSubtreeModified', updateBTCPrice);

EDIT: pasting the command to the URL bar seems not to work in firefox. Instead, you can open the javascript console by pressing F12 and execute the command there (without the leading 'javascript:').

Just wanted to share in case it is useful to someone else!

Cheers
« Last Edit: September 28, 2014, 10:15:18 PM by AtomicBounce »

Offline jsidhu

  • Hero Member
  • *****
  • Posts: 1337
    • View Profile
 +5%
Hired by blockchain | Developer
delegate: dev.sidhujag

Offline AtomicBounce

  • Newbie
  • *
  • Posts: 19
    • View Profile
BTW you can make this change permanent using a browser plugin like for example Greasemonkey.

Offline roadscape

Thanks for this! You can also just create a bookmark with the js code in the URL field.
http://cryptofresh.com  |  witness: roadscape

Offline AtomicBounce

  • Newbie
  • *
  • Posts: 19
    • View Profile
Thanks for your comment :). I just improved the script a bit, it now also updates the price when the Huobi BTC/USD ticker value changes (not only when new trades in the BTC/BTSX market happen).

I am using Tampermonkey now with Chrome to run the script, working fine.

Offline roadscape

Thanks for your comment :). I just improved the script a bit, it now also updates the price when the Huobi BTC/USD ticker value changes (not only when new trades in the BTC/BTSX market happen).

I am using Tampermonkey now with Chrome to run the script, working fine.

Great! I installed Tampermonkey, way better than the bookmarklet approach :)

Also, if anyone is interested, this code cleans up Bter.com interfaces:
Code: [Select]
$('.leftbar, .footer, .topspace, .top_up, .top_dn, #box, .backToTop').hide();
$('.header').css('height','auto');
$('#divMyTradeHistoryList').attr('style', 'max-height: auto');
http://cryptofresh.com  |  witness: roadscape

 

Google+