Is it possible to add a look-back period to scanner?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
p1=9
p2=26
REM Tenkan-Sen = (Highest High + Lowest Low) / 2, for the past 9 days
Upper1=HIGHEST[p1](HIGH)
Lower1=LOWEST[p1](LOW)
Tenkan=(Upper1+Lower1)/2
REM Kijun-Sen = (Highest High + Lowest Low) / 2, for the past 26 days
Upper2=HIGHEST[p2](HIGH)
Lower2=LOWEST[p2](LOW)
Kijun=(Upper2+Lower2)/2
TENLESSKIJUN=(Tenkan<Kijun)
//TENGREATKIJUNPAST = Tenkan[7] > Kijun[7]
CLOSEVAL=(close<1100ANDclose>50)
VOL=(volume>1000000)
//Screener((TENLESSKIJUN AND TENGREATKIJUNPAST AND CLOSEVAL AND VOL))
Screener[TENLESSKIJUNANDCLOSEVALANDVOL]
Above is a very simple TK cross over detection screener, however , this will output anything where a TK cross has taken place (and valid). Is it possible to bracket this by only running the script for a time period i.e last 7 days?
Secondly is it possible to have the results of screener sorted by the time? By time , i mean , not the scan time , but rather , if asset_1 had a TK-cross on 1st October and asset_2 on 2nd October , is there a way i can list asset_2 before asset_1 in sorting criteria?