|
Marcus Schöppl
2014-10-28 14:15:46
|
|
hello i�m new at quantshare
and would be glad to help me.
i have a TrendLength Indicator in Easy Language Code.
This Indicator counts the Weeks, how many Weeks the Stocks is in an UpTrend... The Trend depends on the SuperTrend Indicator.
Please help me.
Here is the code:
a = Supertrend[3.5,10]
If Close Crosses Under a Then
dwTr = -1
Else
dwTr = 0
Endif
x = dwTr
f = x > -1
i = 0
WHILE f[i] DO
i = i + 1
WEND
If Barindex > i+10 Then
xx = Lowest[Max(1,i)](Low)
If Low = xx Then
trend = 1
Else
trend = 0
Endif
Endif
If Barindex > 100 Then
x1 = Trend
f1 = x1 = 0
i1 = 0
WHILE f1[i1] DO
i1 = i1 + 1
WEND
Endif
trendlength = Max(1,i1)
Return trendlength
|
|