Hello Robert,
Is it possible to create the opposite screener if the attached code. Basically, I a looking for “HA-ShortSetupAfterRally”.
Attached is a file.
Thanks
Vineet
I just reverted conditions:
// Trend Template
c1 = Average[13](close) < Average[26](close)
c2 = Average[26](close) < Average[52](close)
c3 = average[52](volume*close) > 3000000
n = 0
if barindex = 0 then
haOpen = open
haClose = close
elsif N = 0 then
haClose =(Open+High+Low+Close)/4
haOpen =(haOpen[1]+haClose[1])/2
elsif (barindex MOD N) = 0 then
haClose =(Open[N]+Highest[N](high)+Lowest[N](low)+Close)/4
haOpen =(haOpen[1]+haClose[1])/2
endif
c4 = haclose < haopen
c5 = haclose[1] > haopen[1]
c6 = haclose[2] > haopen[2]
c7 = haclose[3] > haopen[3]
SCREENER[c1 and c2 and c3 and c4 and c5 and c6 and c7 ](volume*close as "traded volume")
Thanks, Robert,
But I tried to do that earlier but it is still not working as expected. I am looking for just one bar HA reversals after the rally and it is giving results for several bars. Please look at the screenshot
There’s no data on your pic.
Can you post gthe rules to go short?
It is a simple rule, Robert. If HA turns red it is short. I expect this screener to find those scrips. Currently as shown in the picture, this screener is showing scrips after several HA candles
Ok, then no moving average is needed to simply spot any reversion, just after a P number of green candles, the first red one is returned:
P = 10
N = 0
if barindex = 0 then
haOpen = open
haClose = close
elsif N = 0 then
haClose =(Open+High+Low+Close)/4
haOpen =(haOpen[1]+haClose[1])/2
elsif (barindex MOD N) = 0 then
haClose =(Open[N]+Highest[N](high)+Lowest[N](low)+Close)/4
haOpen =(haOpen[1]+haClose[1])/2
endif
haBullish = haClose > haOpen
haBearish = haClose < haOpen
Cond = 0
IF haBearish AND (summation[P](haBullish[1]) = P) THEN
Cond = 1
ENDIF
SCREENER[Cond]
Thank you so much Robert, really appreciate it. you are awesome 🙂