Linear Regression forecast formula

Created at 19 Jan 2016, 16:02
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
aimerdoux's avatar

aimerdoux

Joined 07.06.2015

Linear Regression forecast formula
19 Jan 2016, 16:02


hi, dear team ctdn I would like to know what is the formula to calculate the Linear Regression Forecast indicator and what data does it use to feed the calculation. thank you.


@aimerdoux
Replies

Jiri
19 Jan 2016, 17:05

RE:

This documentation might help.

If you want to implement it in your cAlgo, it's built-in already.

Example:

private LinearRegressionForecast lrForecast;

protected override void OnStart()
{
    lrForecast = Indicators.LinearRegressionForecast(Source, Period);
}
protected override void OnTick()
{
    Print("LRF Last Value = {0}", lrForecast.Result.LastValue);
}

I hope it helped.


@Jiri