- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
尝试在 Tradingview 中创建自定义研究,但在加载 tradeview 小部件时出现以下错误:
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)
__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: '<study name>',
metainfo: {
_metainfoVersion: 40,
id: 'abcd@tv-basicstudies-1',
//id: '<study name>@tv-basicstudies-1',
scriptIdPart: '',
name: 'abcd',
//name: '<study name>',
// This description will be displayed in the Indicators window
// It is also used as a "name" argument when calling the createStudy method
description: 'abcd crypto index',
//description: '<study description>',
// This description will be displayed on the chart
shortDescription: 'abcd index',
//shortDescription: '<short study description>',
is_hidden_study: true,
is_price_study: true,
isCustomIndicator: true,
plots: [{ id: 'plot_0', type: 'line' }],
defaults: {
styles: {
plot_0: {
linestyle: 0,
visible: true,
// Plot line width.
linewidth: 2,
// Plot type:
// 1 - Histogram
// 2 - Line
// 3 - Cross
// 4 - Area
// 5 - Columns
// 6 - Circles
// 7 - Line With Breaks
// 8 - Area With Breaks
plottype: 2,
// Show price line?
trackPrice: false,
// Plot transparency, in percent.
transparency: 40,
// Plot color in #RRGGBB format
color: '#0000FF',
},
},
// Precision of the study's output values
// (quantity of digits after the decimal separator).
precision: 2,
inputs: {},
},
styles: {
plot_0: {
// Output name will be displayed in the Style window
title: '-- output name --',
histogramBase: 0,
},
},
inputs: [],
},
constructor: function() {
this.init = function(context, inputCallback) {
this._context = context;
this._input = inputCallback;
// Define the symbol to be plotted.
// Symbol should be a string.
// You can use PineJS.Std.ticker(this._context) to get the selected symbol's ticker.
// For example,
// var symbol = "AAPL";
// var symbol = "#EQUITY";
// var symbol = PineJS.Std.ticker(this._context) + "#TEST";
var symbol = '#abcd';
//var symbol = '<TICKER>';
this._context.new_sym(symbol, PineJS.Std.period(this._context), PineJS.Std.period(this._context));
};
this.main = function(context, inputCallback) {
this._context = context;
this._input = inputCallback;
this._context.select_sym(1);
// You can use following built-in functions in PineJS.Std object:
// open, high, low, close
// hl2, hlc3, ohlc4
var v = PineJS.Std.close(this._context);
return [v];
};
},
},
];
tvWidget.onChartReady(() => {
tvWidget.chart().createStudy('abcd', false, true);
});
1 custom indicator loaded.
Datafeed settings received: {"supports_search":true,"supports_group_request":false,"supports_marks":false,"supports_timescale_marks":false,"supports_time":true,"exchanges":[{"value":"NasdaqNM","name":"NasdaqNM","desc":"NasdaqNM"}],"symbols_types":[{"name":"All types","value":""},{"name":"Stock","value":"stock"},{"name":"Index","value":"index"}],"supported_resolutions":["D"]}
library.4b362457b3a7eceed386.js:698 Symbol resolve requested: `HOLD`
library.4b362457b3a7eceed386.js:698 Symbol resolved: `HOLD`, SymbolInfo in server response {"name":"HOLD","timezone":"America/New_York","minmov":1,"minmov2":0,"pointvalue":1,"session":"24x7","has_intraday":false,"has_no_volume":true,"description":"Portfolio Performance","type":"crypto","supported_resolutions":["D"],"pricescale":1000,"ticker":"HOLD"}
library.4b362457b3a7eceed386.js:698 Symbol info after post-processing: `HOLD`, SymbolInfo {"name":"HOLD","timezone":"America/New_York","minmov":1,"minmov2":0,"pointvalue":1,"session":"24x7","has_intraday":false,"has_no_volume":true,"description":"Portfolio Performance","type":"crypto","supported_resolutions":["1D"],"pricescale":1000,"ticker":"HOLD","base_name":["HOLD"],"legs":["HOLD"],"full_name":"HOLD","pro_name":"HOLD","data_status":"streaming"}
library.4b362457b3a7eceed386.js:339 Event "symbol", arguments: [{"category":"Symbol","label":"HOLD","value":""}]
...
...
...
library.4b362457b3a7eceed386.js:339 Event "onChartReady", arguments: []
library.4b362457b3a7eceed386.js:339 Event "chart_style", arguments: [{"category":"Chart","value":"AREA"}]
index.js:2178 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)
最佳答案
// referring to your description: 'abcd crypto index'
widget.chart().createStudy("abcd crypto index", false, true);
__customIndicators
的文件放入 public\charting_library\static\your-file-that-contains-__customIndicators.js
indicators_file_name
参数,而不是 custom_indicators_getter
(就像文档推荐的那个,对我来说不起作用)。 关于tradingview-api - Tradingview 定制研究,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55111957/
尝试在 Tradingview 中创建自定义研究,但在加载 tradeview 小部件时出现以下错误: Error: unexpected study id:abcd at Function.
在尝试实现 TradingView 的保存和加载低级 API 时,我无法让库在加载从后端返回的对象时刷新屏幕。 load() 只会导致屏幕闪烁,没有错误。图表不会更新。 如何在 Angular 前端的
在尝试实现 TradingView 的保存和加载低级 API 时,我无法让库在加载从后端返回的对象时刷新屏幕。 load() 只会导致屏幕闪烁,没有错误。图表不会更新。 如何在 Angular 前端的
export default class extends Component { render() { return (
我刚刚将比特币的实时数据添加到我的图表中。有一个高峰,甚至交易 View 都无法处理它......至少,在我的图表上。这是它的样子: 正如你在 6 月 2 日看到的那样,比特币涨得如此之高,以至于它走
使用 tradingview 图表小部件,我想在 js 中进行设置/选项更改并将其应用于图表,而无需完全重新加载 (chart.reload())在 tradingview 上小部件页面有一个应用按钮
有人能告诉我为什么我的 TradingView 图表不显示吗?我得到一个没有图表显示的空白页面。 我按照此处的所有安装说明进行操作: https://github.com/tradingview/li
我正在尝试覆盖 Advanced Real-Time Chart TradingView Widget 上的默认配置. 我添加了一个简单的移动平均线,我设法在其上设置了周期(从默认的 9 到 200)
我是 Tradingview 图表库的新手,我想创建类似响应式图表。 问题是,交易 View 图表库需要指定宽度和高度。这是代码。 const chart = LightweightCharts.cr
图表符号在另一个组件中被选择,状态更新作为 Prop 传回此 TradingView 组件。 我正在尝试使用以下方法更改图表中的符号: this.tvWidget.chart().setSymbol(
如何在 Pine 脚本中设置 strategy.commission.percent? 我知道如何在手动设置中将佣金设置为百分比。但是有没有办法用代码设置佣金? 这是我的策略脚本: strategy(
我正在尝试创建一个新的 Web 项目并想使用 Technical Analysis Charts图书馆,但是当我想下载它时,它要求提供一个我没有的公共(public)网站域!这是一个教育项目,我没有公
我需要绘制多条水平线来标记不同的价格水平。现在我只想出了这个松树脚本: //@version=4 study(title = "H1",overlay=true) plot(close) lev1=0
我正在尝试从 tradinview 添加“高级实时图表”小部件。我可以添加指数移动平均线和简单移动平均线指标。但默认需要 9 天的长度。我想改变这一点。 我尝试了以下方法,但没有成功。有人可以帮忙吗?
$("#loadtv").on("click",function(myfunc23){ var chart4 = new TradingView.widget({ cont
关闭。这个问题需要更多focused .它目前不接受答案。 想改进这个问题吗? 更新问题,使其只关注一个问题 editing this post . 关闭 4 年前。 Improve this qu
这是基于 EMA 交叉的简单策略。当尝试在某个水平退出 % 并让剩余头寸由追踪止损填补时,问题就来了。 让我们设定 3% 的目标。当价格触及目标时,该策略应关闭订单的 50%,并让移动止损继续,直到触
我想实现一个移动平均线,其中长度基于 n-back 平均周期长度 K。因此,我需要长度是变量 K 的函数。 内置的移动平均线只允许长度为静态整数值。 我有一个名为 cycle_difference 的
我需要创建一个类似于 https://www.tradingview.com/wiki/Compare 中显示和解释的图表。 . 在 https://www.tradingview.com/widge
//@version=4 study(shorttitle="try", title="line", overlay=true, resolution="") line.new(x1=bar_inde
我是一名优秀的程序员,十分优秀!