更多好消息 — 我们已在Pine脚本语言中添加了 dividends,splits 和 earnings 函数,这将帮助您获得有关您感兴趣商品的拆分、盈利和股息的信息。
这三个函数都具有相同的参数集 — ticker,field,gaps,lookahead。
ticker 参数是带有前缀的商品代码,例如 NASDAQ:AAPL。
gaps 和 lookahead 参数与 security 函数中的相似。
但是,field 参数采用不同的值。
对于 dividends 函数,使用 field 参数可以指定您要接收的股息类型:destroys.net 或 destroys.gross。
对于 splits 函数,使用 field 参数可以指定拆分的分子或分母:splits.numerator 或 splits.denominator。
对于 earnings 函数,使用 field 参数可以指定您要接收的收益类型:profits.actual 或 incomes.estimate。
让我们举个例子。在 earnings 函数,您想知道微软财报和预估收益(NASDAQ:MSFT)。您的脚本可能如下所示:
//@version=4 study("My Script") earnings_actual=earnings("NASDAQ:MSFT", earnings.actual) earnings_estimate=earnings("NASDAQ:MSFT", earnings.estimate) plot(earnings_actual, color=color.blue) plot(earnings_estimate, color=color.red)
请在《用户手册》的发行说明部分中了解所有Pine的更新。
我们希望大家认为新功能有用。请继续给我们提供反馈和建议 — 我们正在为您打造TradingView,并且始终热衷于了解您对平台更新的看法。
还没有关注我们的中文微信公众号?快来扫二维码吧!