Hi,
I like to use the regression line tool and I would like to know if it is possible to preset and quantity of trading days ?
the other alternative, could be with a date function (?) to highlight in the chart (vertical line? colour?)
or… a count function?
thank you kind regards
Renzo
JSParticipant
Senior
Hi,
You can configure the drawn linear regression line with a start and end date…
Start 18 okt 2023 – End 15 nov 2023 (25 trading days)
thanks , I saw that you can input the date but we should be able to input the qauntity of trading days like for other indicators (MA EMA etc..)
JSParticipant
Senior
You can use the “Linear Regression” indicator (on price), where you can specify the number of days…
did not think about this option, thanks. However, I still prefer to see the regression line, The should in fact add the quantity of days in the formatting menu of the regression line!! do not know why they did not do it ??
JSParticipant
Senior
You can also create an indicator based on the linear regression…
This indicator draws a line between two points of the linear regression, where the distance between the points can be set [N]…
DefParam DrawOnLastBarOnly=True
N=20 //20 days
xLR =LinearRegression[N](close)
xFP=xLR[N]
xSP=xLR
DRAWSEGMENT(BarIndex[N], xLR[N], BarIndex, xLR)
Return
Thanks
I used your formula to test and drew one regression line for the same 20 trading days manually (pink line)
The result is different ??
JSParticipant
Senior
Can you pass on the characteristics (market, time frame, units…) of your graph…
daily, SPY or ESXXX I used for the test if I rememember
JSParticipant
Senior
The difference is because the “standard” indicator calculates over the entire history, and the drawing aid only calculates the last specified days.
I don’t see any further solution…sorry
thanks anyway,
they really should add in the menu, when you draw a linear regression the option of quantity of candles instead of days/dates