headers / Trading View Chart On new Bittrex

// ==UserScript==
// @name         Trading View Chart On new Bittrex
// @namespace    https://bittrex.com/
// @version      0.1
// @description  Better graps for bittrex
// @author       Can
// @match        https://bittrex.com/Market/Index?MarketName=*
// @grant        none
// @license     MIT
// ==/UserScript==
function loadScript(url, callback){

    var script = document.createElement("script");
    script.type = "text/javascript";

    if (script.readyState){  //IE
        script.onreadystatechange = function(){
            if (script.readyState == "loaded" ||
                script.readyState == "complete"){
                script.onreadystatechange = null;
                callback();
            }
        };
    } else {  //Others
        script.onload = function(){
            callback();
        };
    }

    script.src = url;
    document.getElementsByTagName("head")[0].appendChild(script);
}
function addNewStyle(newStyle) {
    var styleElement = document.getElementById('styles_js');
    if (!styleElement) {
        styleElement = document.createElement('style');
        styleElement.type = 'text/css';
        styleElement.id = 'styles_js';
        document.getElementsByTagName('head')[0].appendChild(styleElement);
    }
    styleElement.appendChild(document.createTextNode(newStyle));
}
(function() {
    'use strict';
    var idAttr="chart"+Math.random().toString(16).substr(3);
    var element=document.querySelector('.chart-trade');
    element.setAttribute('id',idAttr);
    element.innerHTML="<p style='width:100%; text-align:center;padding-top:100px;'>Loading...</p>";
    var height=(window.innerWidth*0.5);
    height = height > 550 ? 550 : (height < 250 ? 250 : height);
    addNewStyle('body .main-content .market-info-content .chart-trade{height:'+(height)+'px !important;}');
    var type=document.location.search.match(/MarketName=([^-]*)-([^-]*)/);
    loadScript("https://s3.tradingview.com/tv.js", function(){
        new TradingView.widget({
            "autosize": true,
            "symbol": "BITTREX:"+type[2]+type[1],
            "interval": "5",
            "timezone": "Europe/Istanbul",
            "theme": "Dark",
            "style": "1",
            "locale": "tr",
            "toolbar_bg": "#f1f3f6",
            "enable_publishing": false,
            "hide_side_toolbar": false,
            "save_image": false,
            "studies": [
                "MACD@tv-basicstudies",
                "RSI@tv-basicstudies",
                "MASimple@tv-basicstudies",
                "BB@tv-basicstudies"
            ],
            "container_id": idAttr
        });
    });
})();