tradingview-api

Requests too many securities at PineScript

三世轮回 提交于 2021-01-29 20:10:52
问题 I am trying to make this script by adding all Binance pairs which are over 250 pairs but I am getting this message: "Script requests too many securities: 48. The limit is 40" is there any idea to add all Binance pairs? I found this solution but I didn't know how to use it on my code this the solution link: https://kodify.net/tradingview/errors/request-too-many-securities/ and here is my sample code : //@version=4 study("Custom Screener", overlay = false) customFunc() => close > open s1 =

Chart update in TradingView React component doesn't work

我的梦境 提交于 2021-01-29 18:33:52
问题 Symbol of the chart is being selected in another component with an update of state which is passed back as a prop to this TradingView component. I am trying to change the symbol in the chart with this: this.tvWidget.chart().setSymbol('BINANCE:' + this.props.selectedSymbol.name) But where and how exactly should I place and use it? I am confused. I need to change the chart symbol, but in what method should it happen? Thank you! import * as React from 'react'; import './index.css'; import

how to to insert TradingView widget into react js which is in script tag link: https://www.tradingview.com/widget/market-overview/

两盒软妹~` 提交于 2019-12-24 00:56:42
问题 export default class extends Component { render() { return ( <div> { /*** * enter the code here */ } </div> ) } } 回答1: export default class Tabsshow extends React.PureComponent { constructor(props) { super(props); this._ref = React.createRef(); } render() { return( <div class="tradingview-widget-container" ref={this._ref}> <div class="tradingview-widget-container__widget"></div> </div> ); } componentDidMount() { const script = document.createElement('script'); script.src = 'https://s3

Embed Tradingview into Angular 5

白昼怎懂夜的黑 提交于 2019-12-23 10:58:09
问题 I just copy the function in the embed script found here (https://www.tradingview.com/widget/advanced-chart/) into a component in my Angular 5 app, and include the source script in angular-cli.json. However, the component returns error "Cannot find name 'TradingView'". Someone has any suggestions? 回答1: I found a way to solve the compile error by declaring TradingView in component: declare const TradingView: any; export class ChartComponent implements AfterViewInit { ngAfterViewInit() { new

Change ticker of tradingview widget with an interval

匆匆过客 提交于 2019-12-11 17:46:23
问题 It's probably really easy but I just can't figure out how to change the ticker symbol in the Tradingview widget. I want the chart to change to the tickers in a array i got. The chart needs to change every 30 seconds with a new ticker and do that forever. This is what I got so far: <div class="tradingview-widget-container"> <div id="tradingview_5889e"></div> <div class="tradingview-widget-copyright"><a href="https://www.tradingview.com/symbols/NYSE-RIG/" rel="noopener" target="_blank"><span

How TradingView Pine Script RMA function works internally?

杀马特。学长 韩版系。学妹 提交于 2019-12-11 09:50:02
问题 I'm trying to re-implement the rma function from TradingView pinescript but I cannot make it output the same result as the original function. Here is the code I developed, the code is basically the ema function, but it differs greatly from the rma function plot result when charting: //@version=3 study(title = "test", overlay=true) rolling_moving_average(data, length) => alpha = 2 / (length + 1) sum = 0.0 for index = length to 0 if sum == 0.0 sum := data[index] else sum := alpha * data[index]

Problem with Pine Scripts plotshapes offset

前提是你 提交于 2019-12-11 07:51:25
问题 This script will denote highs, with the left bar being lower and the right bar being lower. I also want this script to give me the HighofHighs, with the left high and right high being lower. I have it working but I can't get the label to display on the correct bar. If I use offset=-1, it will put it over the most recent high, if I use offset=-high_bars_back it doesn't offset it at all. (the default of the code is showing "HighofHighs" on the most current high (using offset=-1), but I need it

How to fix TradingView out of depth at index 540 error

落花浮王杯 提交于 2019-12-11 06:37:19
问题 When working on a pine script in TradingView (tradingview.com), I kept seeing red text appear near the top of the chart saying "out of depth at index" 540, and my script would not execute. Being new to pine script, I wasn't really sure what it meant. This issue was rather cryptic and difficult to google, so I'm posting the answer I found here. Hopefully it will be useful to someone. 回答1: I found an answer via this detailed writeup regarding the issue. Since stackoverflow doesn't like link-rot

How to use different string literals in PINE plot on trading view?

北城余情 提交于 2019-12-10 20:46:56
问题 I have plot defined like this: plotshape(xvalue, location=location.absolute, style=shape.labeldown, color=red, size=size.tiny, text ="Upper") Problem here is with part text="Upper". I wanted to allow user to shorten label so it can be "Upper" or "U". This usualy can be done with something like this: text = label ? "U" : "Upper" Where "label" is true/false for shorter strings. Problem is PINE isn't accepting it and error is something like "You must use string literals with 'text='". https:/

Tradingview Pine script save close price at time of strategy entry

对着背影说爱祢 提交于 2019-12-10 16:34:45
问题 Hey I'm trying to save the close price at the time of strategy.entry to a variable so I can use it later for an exit. if condition strategy.entry("long", true) buyprice=close (strategy.exit("exit","long", when = close>buyprice*1.1) I get the error: Undeclared identifier 'buyprice' . From what I understand this means that the variable is not valid outside of the if statement. Is there a way to change this? Thanks in advance for your help 回答1: This is the only way that I could get this to work.