我正在尝试建立一个谐波模式检测系统。我想将 Tradingview UI 用于前端,但我想知道是否可以通过他们的 API 以编程方式绘制这些模式。
在图表上,我们可以手动绘制它,从模式工具箱中选择工具。例如: 蝙蝠图案
我们可以设法用代码绘制它吗?
我正在尝试建立一个谐波模式检测系统。我想将 Tradingview UI 用于前端,但我想知道是否可以通过他们的 API 以编程方式绘制这些模式。
在图表上,我们可以手动绘制它,从模式工具箱中选择工具。例如: 蝙蝠图案
我们可以设法用代码绘制它吗?
是的,您可以在使用TradingView 图表库时绘制复杂的形状/绘图,方法是createMultipointShape()
:
tradingViewWidget.chart.createMultipointShape(
// indicator points
[
{time: pointTime1, price: pointPrice1},
{time: pointTime2, price: pointPrice2},
{time: pointTime3, price: pointPrice3},
{time: pointTime4, price: pointPrice4},
{time: pointTime5, price: pointPrice5}
],
// settings/overrrides
{
shape: 'xabcd_pattern'
}
)