npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

tradingview-devtrader-bbrtek

v1.0.3

Published

A library to embed TradingView widgets

Downloads

5

Readme

TradingView DevTrader BBRTEK

A library to embed TradingView widgets in web applications. Supports multiple symbols, custom studies, and saves the widget configuration.

Installation

Using npm/yarn

With npm

npm install tradingview-devtrader-bbrtek

With yarn

yarn add tradingview-devtrader-bbrtek

Using from CDN

You can include the library directly from a CDN like GitHub Pages or unpkg:

<script src="https://unpkg.com/[email protected]/dist/tradingview-devtrader-bbrtek.min.js"></script>

Usage

JavaScript (Plain)

From CDN

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>TradingView Widget</title>

<script src="https://unpkg.com/[email protected]/dist/tradingview-devtrader-bbrtek.min.js"></script>

</head>

<body>

<div id="tradingview-widget" style="width: 800px; height: 600px;"></div>

<script>

TradingViewEmbed.createTradingViewWidget('tradingview-widget', {

symbols: ['AAPL', 'GOOGL', 'TSLA'],

interval:  '60',

width: 800,

height: 600,

studies: ['SMC Binary Sniper [@DEVTRADER/BBR TEK]', 'Volume@tv-basicstudies'],

user: { auth_token: 'YOUR_AUTH_TOKEN' } // Requires a token generated by TradingView

});

</script>

</body>

</html>

React

Installation

yarn  add  tradingview-devtrader-bbrtek

Usage

//  src/components/TradingViewWidget.js



import React, { useEffect } from 'react';

import { createTradingViewWidget } from 'tradingview-devtrader-bbrtek';

  

const TradingViewWidget = ({ containerId = "tradingview-widget", options }) => {

useEffect(() => {

createTradingViewWidget(containerId, options);

}, [containerId, options]);

  

return  <div id={containerId} style={{ width: options.width, height: options.height }} />;

};

  

export  default  TradingViewWidget;

  

//  src/App.js



import React from 'react';

import TradingViewWidget from './components/TradingViewWidget';

  

function  App() {

return (

<div className="App">

<header className="App-header">

<h1>TradingView Widget</h1>

<TradingViewWidget

containerId="tradingview-widget"

options={{

symbols: ["AAPL",  "GOOGL",  "TSLA"],

interval: "60",

width: 800,

height: 600,

studies: ["SMC Binary Sniper [@DEVTRADER/BBR TEK]",  "Volume@tv-basicstudies"],

user: { auth_token: "YOUR_AUTH_TOKEN" } // Requires a token generated by TradingView

}}

/>

</header>

</div>

);

}

  

export  default  App;

Angular

Installation

yarn add tradingview-devtrader-bbrtek

  

// src/app/components/trading-view-widget/trading-view-widget.component.ts

  

import { Component, AfterViewInit, Input } from '@angular/core';

import { createTradingViewWidget } from 'tradingview-devtrader-bbrtek';

  

@Component({

selector:  'app-trading-view-widget',

template: `<div [id]="containerId"  [ngStyle]="{ width: options.width, height: options.height }"></div>`,

styleUrls: ['./trading-view-widget.component.css']

})

export  class  TradingViewWidgetComponent  implements  AfterViewInit {

@Input() containerId: string = 'tradingview-widget';

@Input() options: any = {};

  

ngAfterViewInit() {

createTradingViewWidget(this.containerId, this.options);

}

}

HTML

<!--  src/app/app.component.html  -->



<app-trading-view-widget

[containerId]="'tradingview-widget'"

[options]="{

symbols: ['AAPL', 'GOOGL', 'TSLA'],

interval: '60',

width: 800,

height: 600,

studies: ['SMC Binary Sniper [@DEVTRADER/BBR TEK]', 'Volume@tv-basicstudies'],

user: { auth_token: 'YOUR_AUTH_TOKEN' } // Requires a token generated by TradingView

}">

</app-trading-view-widget>

Vue

Installation

yarn  add  tradingview-devtrader-bbrtek

Usage

<!-- src/components/TradingViewWidget.vue -->

  

<template>

<div :id="containerId" :style="{ width: options.width + 'px', height: options.height + 'px' }"></div>

</template>

  

<script>

import { createTradingViewWidget } from 'tradingview-devtrader-bbrtek';

  

export  default {

name:  'TradingViewWidget',

props: {

containerId: {

type: String,

default:  'tradingview-widget'

},

options: {

type: Object,

default:  () => ({})

}

},

mounted() {

createTradingViewWidget(this.containerId, this.options);

}

}

</script>

  

<!-- src/App.vue -->

  

<template>

<div id="app">

<header class="App-header">

<h1>TradingView Widget</h1>

<TradingViewWidget

:containerId="'tradingview-widget'"

:options="{

symbols: ['AAPL', 'GOOGL', 'TSLA'],

interval: '60',

width: 800,

height: 600,

studies: ['SMC Binary Sniper [@DEVTRADER/BBR TEK]', 'Volume@tv-basicstudies'],

user: { auth_token: 'YOUR_AUTH_TOKEN' } // Requires a token generated by TradingView

}"

/>

</header>

</div>

</template>

  

<script>

import TradingViewWidget from './components/TradingViewWidget.vue';

  

export  default {

name:  'App',

components: {

TradingViewWidget

}

}

</script>

Svelte

Installation

yarn add tradingview-devtrader-bbrtek

Usage

<!-- src/components/TradingViewWidget.svelte -->

  

<script>

import { onMount } from 'svelte';

import { createTradingViewWidget } from 'tradingview-devtrader-bbrtek';

  

export  let  containerId = 'tradingview-widget';

export  let  options = {};

  

onMount(() => {

createTradingViewWidget(containerId, options);

});

</script>

  

<div id={containerId} style="width: {options.width}px; height: {options.height}px;"></div>

  
  

<!-- src/App.svelte -->

  

<script>

import TradingViewWidget from './components/TradingViewWidget.svelte';

  

let options = {

symbols: ['AAPL', 'GOOGL', 'TSLA'],

interval:  '60',

width: 800,

height: 600,

studies: ['SMC Binary Sniper [@DEVTRADER/BBR TEK]', 'Volume@tv-basicstudies'],

user: { auth_token: 'YOUR_AUTH_TOKEN' } // Requires a token generated by TradingView

};

</script>

  

<main>

<header class="App-header">

<h1>TradingView Widget</h1>

<TradingViewWidget containerId="tradingview-widget" {options} />

</header>

</main>

  
  

License

This project is licensed for [email protected]