简体   繁体   English

Pine-Script 中是否有可用的 FORCAST 函数?

[英]Is there any FORCAST function available in Pine-Script?

I am trying to convert an existing script into Pine-Script, and I am currently stuck in a function which is FORCAST, where I don't know what it is trying to do.我正在尝试将现有脚本转换为 Pine-Script,但我目前被困在一个 FORCAST 函数中,我不知道它要做什么。 Possible if I post the partial script here and if there is anyone that is able to interpret it?如果我在这里发布部分脚本并且是否有人能够解释它,那么可能吗?

if what you're looking for is indeed a linear regression like the Excel FORECAST function, please have a look on this example:如果您要查找的确实是 Excel FORECAST 函数之类的线性回归,请查看此示例:

https://www.tradingview.com/pine-script-docs/en/v4/essential/Drawings.html#linear-regression https://www.tradingview.com/pine-script-docs/en/v4/essential/Drawings.html#linear-regression

Normally such functions should have (at least) the following inputs:通常,此类函数应(至少)具有以下输入:

  1. known vector of X values (inputs) X 值的已知向量(输入)
  2. known vector of Y values (outputs) Y 值的已知向量(输出)
  3. user X value for which the function will return a forecasted Y value函数将为其返回预测的 Y 值的用户 X 值

The example in the link will give you a fairly complete implementation of linear regression in Pine-script, but note it is meant to draw a line instead of making forecasts.链接中的示例将为您提供 Pine-script 中线性回归的相当完整的实现,但请注意,它旨在绘制一条线而不是进行预测。 You'll need to get some hands-on if you want to convert it into a function that returns you a certain Y value instead of the line.如果要将其转换为返回特定 Y 值而不是行的函数,则需要进行一些实践。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM