Hi everyone,
Here is a multitimeframe screener based on reversion of the LinearRegression slop;
but I cannot figure out how to implement a freshness of the signal
=> I want the screener to give me only the stocks where DOWN and UP (for both week and day) just occured in [0]
thanks for your help ;
Chris
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// parameters
Length = 9
timeframe (weekly )
PenteRLWeek = LinearRegressionSlope [ Length] (close )
DOWNWeek = PenteRLWeek[ 2 ] > PenteRLWeek[ 1 ] and PenteRLWeek[ 0 ] > PenteRLWeek[ 1 ]
UPWeek = PenteRLWeek[ 2 ] < PenteRLWeek[ 1 ] and PenteRLWeek[ 1 ] > PenteRLWeek[ 0 ]
if DOWNWeek then
SignalWeek = 1
elsif UPWeek then
SignalWeek = - 1
else
SignalWeek = 0
endif
timeframe (daily )
PenteRLDay = LinearRegressionSlope [ 10 ] (close )
DOWNDAY = PenteRLDay[ 2 ] > PenteRLDay[ 1 ] and PenteRLDay[ 0 ] > PenteRLDay[ 1 ]
UPDAY = PenteRLDay[ 2 ] < PenteRLDay[ 1 ] and PenteRLDay[ 1 ] > PenteRLDay[ 0 ]
if DOWNDAY then
SignalDay = 1
elsif UPDAY then
SignalDay = - 1
else
SignalDay = 0
endif
MinPrix = close > 2.5
MinVolume = average [ 23 ] (volume ) > 200000
//
c1 = signalWeek = 1 and signalDay = 1
c2 = signalWeek = - 1 and signalDay = - 1
SCREENER [ c1 or c2 and MinPrix and MinVolume] (signalday as "signal" )