export default class extends Component {
render() {
return (
<div>
{
/***
* enter the code here
*/
}
</div>
)
}
}
Run Code Online (Sandbox Code Playgroud) 一个console.log variables或函数结果如何pine-script?我想将pine-script脚本转换成javascript,并且要验证我要转换的脚本与原始脚本相同。如果此功能不存在,欢迎任何解决方法。谢谢!
Iam建立了一个用于比特币交换的网站。我想使用在工作区中提取的交易视图图表库。我想知道如何提供自己的数据Feed。datafeed文件应采用哪种格式(例如php,js,json)?
var _datafeed = new Datafeeds.UDFCompatibleDatafeed("http://localhost/workspace/charting");
//var _datafeed = new Datafeeds.UDFCompatibleDatafeed("https://demo_feed.tradingview.com");
TradingView.onready(function () {
var widget = window.tvWidget = new TradingView.widget({
debug: true, // uncomment this line to see Library errors and warnings in the console
fullscreen: false,
symbol: 'A',
interval: 'D',
timezone: "America/New_York",
container_id: "tv_chart_container",
locale: getParameterByName('lang') || "en",
datafeed: _datafeed,
library_path: "charting_library/",
});
});
Run Code Online (Sandbox Code Playgroud)
在上面的代码中,图表是通过演示链接绘制的。当我将其更改为路径时,出现“无效符号”错误。我在哪里指定config和symbol_info以及它们的文件格式是什么?我是一个新手。请帮忙 。
任何以正确方式前进的建议都值得赞赏。我很烂!
我是 Tradingview 图表库的新手,我想创建类似的响应式图表。
问题是,交易视图图表库需要指定宽度和高度。这是代码。
const chart = LightweightCharts.createChart(e, {
width: e.offsetWidth,
height: e.offsetHeight,
layout: {
backgroundColor: 'rgb(17, 17, 39)',
textColor: 'rgba(255, 255, 255, 0.9)',
},
grid: {
vertLines: {
color: 'rgb(41, 44, 58)',
},
horzLines: {
color: 'rgb(41, 44, 58)',
},
},
crosshair: {
mode: LightweightCharts.CrosshairMode.Normal,
},
priceScale: {
borderColor: 'rgba(197, 203, 206, 0.8)',
},
timeScale: {
borderColor: 'rgba(197, 203, 206, 0.8)',
},
});
Run Code Online (Sandbox Code Playgroud) 我可以使用此代码获取实时股票数据和之前的 500-100 蜡烛图数据,但无法获取 CME_MINI:ESH2021 未延迟的数据。我认为 TradingView 在公共流中延迟了 600 秒。我确实支付了数据费用,并且可以在网络客户端上提取它,但我无法在 python 上获取非延迟数据,因为我不确定如何通过 python 登录 TradingView。如果有人知道我如何修复我的代码以执行我想要的操作,我将非常感谢您的意见或任何建议。
from websocket import create_connection
import json
import random
import string
import re
from datetime import datetime
from time import sleep
def filter_raw_message(text):
try:
found = re.search('"p":(.+?"}"])}', text).group(1)
print(found)
return found
except AttributeError:
print("error")
def generateSession():
stringLength=12
letters = string.ascii_lowercase
random_string= ''.join(random.choice(letters) for i in range(stringLength))
return "qs_" +random_string
def generateChartSession():
stringLength=12
letters = string.ascii_lowercase
random_string= ''.join(random.choice(letters) for i in range(stringLength))
return "cs_" +random_string
def prependHeader(st):
return …Run Code Online (Sandbox Code Playgroud) 在这些网站(https://coinalyze.net/ethereum-classic/liquidations/、BTC/USDT)上,我可以将以下指示添加到 grpah [ , , , , ]中。LiquidationsLong LiquidationsShort LiquidationsAggregated Liquidations COIN-margined ContractsAggregated Liquidations STABLECOIN-margined Contracts
合计清算量=币本位合约清算量+稳定币本位合约折算美元的清算量。目前仅包含 BTC/USD 和 BTC/USDT 合约。查看指标选项,您可以选择/取消选择单个合约。
=> 主要问题是如何获取用于加密货币清算的数据流(如果可能的话)从 Tradingview 或币安等交易所获取。
我尝试在https://www.tradingview.comAggregated liquidations上添加或直接Liquidations添加到期货下的加密货币图表中。我无法找到它的 pine-script 代码或其内置指示器,所以我相信数据是私有的,对我来说是死胡同。
是否可以从类似Binance或其他交易所获取用于加密货币清算的数据流?或者添加Aggregated liquidations到 TradingView 上的加密货币图表中?
我正在尝试从 tradinview 添加“高级实时图表”小部件。我可以添加指标指数移动平均线和简单移动平均线。但它需要默认的 9 天长度。我想改变这一点。
我尝试如下,但它不起作用。有人可以帮忙吗。非常感谢。
widget = new TradingView.widget(
{
"width": 1200,
"height": 700,
"symbol": "NSE:DRREDDY",
"interval": "D",
"timezone": "Asia/Kolkata",
"theme": "Dark",
"style": "1",
"locale": "in",
"toolbar_bg": "#f1f3f6",
"enable_publishing": false,
"hide_side_toolbar": false,
"allow_symbol_change": true,
"details": true,
"studies_overrides": {
"moving average exponential.length": 20
},
"studies": [
"MAExp@tv-basicstudies"
],
"container_id": "tradingview_f6d89"
}
Run Code Online (Sandbox Code Playgroud) 尝试在 Tradingview 中创建自定义研究,但在加载 Tradingview 小部件时出现以下错误:
Error: unexpected study id:abcd
at Function.o.findStudyMetaInfoByDescription (library.4b362457b3a7eceed386.js:29)
at y.createStudy (library.4b362457b3a7eceed386.js:718)
at t.<anonymous> (index.jsx:178)
at charting_library.min.js:1
at e.fire (library.4b362457b3a7eceed386.js:16)
at a (library.4b362457b3a7eceed386.js:22)
at Object.l [as emitOnce] (library.4b362457b3a7eceed386.js:22)
at ft (library.4b362457b3a7eceed386.js:441)
at t (library.4b362457b3a7eceed386.js:442)
at e.fire (library.4b362457b3a7eceed386.js:16)
Run Code Online (Sandbox Code Playgroud)
我一直按照https://github.com/tradingview/charting_library/wiki/Creating-Custom-Studies上的说明进行操作
我已经使用了说明中的模板,只是更改为我的研究名称“abcd”
__customIndicators = [
// *** your indicator object, created from the template ***
{
// Replace the <study name> with your study name
// The name will be used internally by the Charting Library
name: 'abcd',
//name: …Run Code Online (Sandbox Code Playgroud) 我正在尝试通过 webhook(TradingView 的新功能)将警报发送到 python 程序,并使用它们与 Alpaca 进行交易。
\n\n我尝试使用 ngrok 加上我在 Github 上找到的这个脚本:
\n\nhttps://github.com/Robswc/tradingview-webhooks-bot
\n\n将端口更改为 80 后(似乎没有其他端口可以工作,我认为这是在 TradingView 的末端),我终于得到了一些东西:
\n\n127.0.0.1 - - [25/Dec/2019 21:26:45] code 400, message Bad request version (\'\xc3\x80\\x14\xc3\x80\')\n127.0.0.1 - - [25/Dec/2019 21:26:45] " \xc3\x8c \xc3\x88\xc3\x81\xc3\x84J\xc3\x82$/g{$\xc2\xb9\xc2\xa6H\xc2\xba\xc3\x8fE(\xc2\xb7\xc3\xba\xc3\xa5[:\xc3\x9c\xc2\xb4J\xc3\xb7 D+\xc2\xb56\xc3\x91fYx\xc2\xba\xc3\xbb\xc3\xa1\xc3\x99\xc3\x98kc`\xc2\xb8\xc3\x98\xc2\xad\xc2\xb0\xc3\x9cAz\xc3\x9c \xc3\x80/\xc3\x800\xc3\x80+\xc3\x80,\xc3\x8c\xc2\xa8\xc3\x8c\xc2\xa9\xc3\x80\xc3\x80 \xc3\x80\xc3\x80" HTTPStatus.BAD_REQUEST -\n127.0.0.1 - - [25/Dec/2019 21:26:51] code 400, message Bad request version (\'\xc3\x80\\x14\xc3\x80\')\n127.0.0.1 - - [25/Dec/2019 21:26:51] " \xc3\x8c \xc3\x88\xc3\x83E\xc2\xbf\xc2\xbeG\xc3\x90\xc2\xaa6\xc3\xa1e>\xc3\x83\xc3\x9dnI6M\xc3\x9a3Y\xc3\x96\xc2\xb7\xc2\xa67\xc3\x91 \xc3\xaf\xc3\xbeG{\xc3\xa4\xc3\x89\xc3\xbdCV\xc3\x99A$\xc2\xba\xc3\x950\xc3\x92B\xc3\xb42\xc3\xb5+px\xc2\xb6 \xc3\x80/\xc3\x800\xc3\x80+\xc3\x80,\xc3\x8c\xc2\xa8\xc3\x8c\xc2\xa9\xc3\x80\xc3\x80 \xc3\x80\xc3\x80[0m" HTTPStatus.BAD_REQUEST -\n127.0.0.1 - - [25/Dec/2019 21:27:47] code 400, message Bad request version (\'\xc3\x80\\x14\xc3\x80\')\n4s"H …Run Code Online (Sandbox Code Playgroud) 尝试绘制数组中的值,但我发现需要单独绘制每个值。你如何创建一个系列来描绘这个?
\n// \xc2\xa9 SKnight79\n\n//@version=4\nstudy("My Script")\n\npma1 = array.new_float(5,0)\n\narray.push(pma1, security(syminfo.tickerid, "", (ema(close, 10 - 1) * (10 - 1) + close * 1) / 10))\narray.push(pma1, security(syminfo.tickerid, "", (ema(close, 10 - 1) * (10 - 2) + close * 2) / 10))\narray.push(pma1, security(syminfo.tickerid, "", (ema(close, 10 - 1) * (10 - 3) + close * 3) / 10))\narray.push(pma1, security(syminfo.tickerid, "", (ema(close, 10 - 1) * (10 - 3) + close * 3) / 10))\narray.push(pma1, security(syminfo.tickerid, "", (ema(close, 10 - 1) * (10 …Run Code Online (Sandbox Code Playgroud) tradingview-api ×10
javascript ×4
pine-script ×2
python ×2
arrays ×1
binance ×1
json ×1
ngrok ×1
plot ×1
reactjs ×1
web-crawler ×1
webhooks ×1
websocket ×1
widget ×1