我正在尝试建立一个谐波模式检测系统。我想使用Tradingview UI作为前端,但我想知道是否可以通过他们的API以编程方式绘制这些模式。
在图表上,我们可以手动绘制它,从模式工具箱中选择工具。例如:bat pattern
我们可以设法用代码绘制它吗?
是的,您可以使用TradingView Charting Library使用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'
}
)