ZigoParticipant
Master
I have posted this indicator in the library today. This indicator give a line(s) in the graph that marks the past trend. If we take two different settings for q, (for example 29 and 13) the lines are convergent or divergent or exceptional equal. The angle that will be created by the two lines gives the direction of the trend.
Unfortunate the lines not adapt by a new candle. (see 2 attachments). Maybe someone can help find a way to coding this matter.
// q as a variable 29 and 13 is a good pair to use
// q = 29 and or 13
Once j=0
once ab=q
Z=DPO[AB*2](close)
if Z=Z[1] and Z[1]=Z[2] and Z[2]<>Z[3] Then
PP=1
endif
//////////////////////////////////////////////////
N=(AB*2)-4
P=(N/2)-1
d100=DPO[n](close)
m100=close-d100
cx=(m100-m100[1]+(close[p])/n)*n
PW = TypicalPrice
RX= Range
///////////////////////////////////////////////////
SQR1=(SQRT(RX) *180) -225
SQ1=SQR1/360
ZZ=SQ1 Mod 100
So9=SQ1-Zz
Fxd=PW+(So9*2)
IF Close > FXD Then
CS=CX-(So9*1.1618)
else
CS=CX+(So9*1.1618)
endif
/////////////////////////////////////////////////////
if pp=1 and pp[1]=0 then
A=LinearRegressionSlope[AB](CS)
B=LinearRegression[AB](CS)
c=(b-a*ab)
endif
if Pp=0 then
st=undefined
else
J=J+1
ST=a*j+c
endif
STx=(ST/100)*100
Return STx as "F1 Gann Trend"
The lines are not updating because you are using DPO which is using the future of the price on its first load. Then, in real time, the indicator will obviously use the current price and therefore not behaves as good as in the past.
ZigoParticipant
Master
Thank you Nicolas, for your quick reaction.
ZigoParticipant
Master
@ Nicolas is there anything possible to update the lines?