Question

I'm need linear type technical indicator(Linear) with custom set periods value not the default value '100'.

So, I have created this JSfiddle for the same with custom periods value '70'.

{
    name: 'Linear Trendline',
    linkedTo: 'primary',
    showInLegend: true,
    enableMouseTracking: true,
    type: 'trendline',
    algorithm: 'linear',
    periods:70
}

But this does not take any effect. the periods value is still taking 100. what I did wrong?

Was it helpful?

Solution

Documentation is sparse but from a quick look at the source, the period parameter is how many points to include in (the window size of) the moving average. The linear algorithm type, though, is a regression line. It fits to all the data points and by definition does not have a window size.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top