Skip to content
A ready to use TradingView Embeds module for js/ts projects
HTML TypeScript
Branch: master
Clone or download
Pull request Compare This branch is 24 commits ahead of xnr-k:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode
bin init Sep 30, 2019
src ref id stringified Nov 12, 2019
.gitignore type support + Nov 12, 2019
README.md --react Nov 12, 2019
index.html --react Nov 12, 2019
package.json
tsconfig.json type support + Nov 12, 2019
tslint.json

README.md

Typescript component for TradingView Embeds

Installation

npm install --save typescript-tradingview-embed
or
yarn add typescript-tradingview-embed

Example

App.js / App.ts

TODO: update usage

import { TradingViewEmbed, widgetType } from "typescript-tradingview-embed";


export default function App() {
  return (
    <div
      className="App"
      style={{background: "rgba(0, 0, 0, 0.85)"}}
    >
      <TradingViewEmbed
        widgetType={widgetType.ADVANCED_CHART}
        widgetConfig={{
          colorTheme: "dark",
          symbol: "BITMEX:XBTUSD",
          width: "100%"
        }}
      />
      <TradingViewEmbed
        widgetType={widgetType.SCREENER_CRYPTOCURRENCY}
        widgetConfig={{
          colorTheme: "dark",
          width: "100%",
          height: "230",
        }}
      />
      <TradingViewEmbed
        widgetType={widgetType.TICKER_TAPE}
        widgetConfig={{
          colorTheme: "light",
          autosize: true
        }}
      />
    </div>
  );
}

Use widgetConfig to declare widget parameters.
See each individual widgets for available parameters.
The above code running: screen

Supported widgets in plan:

Contributions welcome!

Open a new PR here on GitHub.

Run locally

  • Run git clone https://github.com/nordible/typescript-tradingview-embed.git this project
  • Run cd typescript-tradingview-embed/ to this project
  • Run npm run dev to start the project on local machine

Bugs and Issues

Have a bug or an issue? Open a new issue here on GitHub.

License

Code licensed under MIT. Everything else is CC

Credits

Thanks to @xnr-k

Follow us

© nordible

You can’t perform that action at this time.