GannTrend 2.0 (Lines)
Forums › ProRealTime English forum › General trading discussions › GannTrend 2.0 (Lines)
- This topic has 5 replies, 2 voices, and was last updated 4 years ago by Nicolas.
-
-
10/27/2020 at 9:52 PM #148733
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.
GannTrend 2.01234567891011121314151617181920212223242526272829303132333435363738394041424344// q as a variable 29 and 13 is a good pair to use// q = 29 and or 13Once j=0once ab=qZ=DPO[AB*2](close)if Z=Z[1] and Z[1]=Z[2] and Z[2]<>Z[3] ThenPP=1endif//////////////////////////////////////////////////N=(AB*2)-4P=(N/2)-1d100=DPO[n](close)m100=close-d100cx=(m100-m100[1]+(close[p])/n)*nPW = TypicalPriceRX= Range///////////////////////////////////////////////////SQR1=(SQRT(RX) *180) -225SQ1=SQR1/360ZZ=SQ1 Mod 100So9=SQ1-ZzFxd=PW+(So9*2)IF Close > FXD ThenCS=CX-(So9*1.1618)elseCS=CX+(So9*1.1618)endif/////////////////////////////////////////////////////if pp=1 and pp[1]=0 thenA=LinearRegressionSlope[AB](CS)B=LinearRegression[AB](CS)c=(b-a*ab)endifif Pp=0 thenst=undefinedelseJ=J+1ST=a*j+cendifSTx=(ST/100)*100Return STx as "F1 Gann Trend"10/28/2020 at 9:09 AM #148752The 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.
1 user thanked author for this post.
10/28/2020 at 10:08 AM #14876410/28/2020 at 10:42 AM #14876710/28/2020 at 11:01 PM #14884010/29/2020 at 8:08 AM #148852That’s pretty similar to a common linear regression?
Standard Deviation & Standard Error Linear Regression Channel
-
AuthorPosts