Trading View - bscscan/ethereum Chart for individual Contract

693 views Asked by At

Unfortunately, I'm a bit stupid when implementing the chart for an individual token.

I call Tradinview, via html, with the following script:

`       <script type="text/javascript" src="../tv/public/charting_library/charting_library.standalone.js"></script>
        <script type="text/javascript" src="../tv/public/datafeeds/udf/dist/polyfills.js"></script>
        <script type="text/javascript" src="../tv/public/datafeeds/udf/dist/bundle.js"></script>
function getParameterByName(name) {
                name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
                var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
                    results = regex.exec(location.search);
                return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
            }

            function initOnReady() {
                var widget = window.tvWidget = new TradingView.widget({
                    // debug: true, // uncomment this line to see Library errors and warnings in the console
                    fullscreen: true,
                 debug: false,
   symbol: 'Coinbase:BTC/USD',

   interval: '15',
                    container_id: "tv_chart_container",
                    range: "YTD",
                    //  BEWARE: no trailing slash is expected in feed URL
                    datafeed: new Datafeeds.UDFCompatibleDatafeed(""),
                    library_path: "../tv/public/charting_library/",
                    locale: getParameterByName('lang') || "en",

                    disabled_features: ["left_toolbar", "border_around_the_chart", "header_saveload", "header_symbol_search", "cropped_tick_marks"],
                    enabled_features: [],
                    charts_storage_url: 'https://saveload.tradingview.com',
                    charts_storage_api_version: "1.1",
                    client_id: 'tradingview.com',
                    user_id: 'public_user_id',
                                        theme: 'dark',
                                        loading_screen: { backgroundColor: "#000000" },
                    // custom_css_url should be related to library_path

overrides: {
    "paneProperties.background": "#111111",
    "paneProperties.vertGridProperties.color": "#111111",
    "paneProperties.horzGridProperties.color": "#131722",
    "symbolWatermarkProperties.transparency": 90,
    "scalesProperties.textColor" : "#AAA",
    "mainSeriesProperties.candleStyle.wickUpColor": '#336854',
    "mainSeriesProperties.candleStyle.wickDownColor": '#7f323f',

   }
                });
            };

            window.addEventListener('DOMContentLoaded', initOnReady, false);
    <body style="margin:0px;">
        <div id="tv_chart_container"></div>
    </body>

Now to my question:

How can I display an individual chart (for example from the token / contract - 0x7726cd4813e4d99bb38649d039fcb55ef0977e79)? What do I have to change and via which API do I get the required data?

Thank you for your time,

Kind regards, Ben

0

There are 0 answers