Hi,
I’m trying to run a scan inspired by the Ichimoku Tenkan-Kijun Cross (screener) written by Doctrading.
But instead of matching “now” I would like the results to match a variable day in the past, (for example 7 days ago)…
What I’m basically trying to achieve is to have :
• Tenkan over the Kijun
• Tenkan & Kijun > Kumo
• Close > Kumo
• Chikou > Kumo
And this should match the 7th bar ago (not the current one..)
I was wondering, is that actually possible to run a scan back in time ?
Thank you for your help…
So far I came up with this.
// Original code
// Ichimoku Tenkan-Kijun Cross (screener)
// https://www.prorealcode.com/prorealtime-market-screeners/ichimoku-tenkan-kijun-cross-screener/
INDICATEUR = 0
period1 = 9
period2 = 26
period3 = 52
howManyDaysAgo = 7
period1 = period1 + howManyDaysAgo
period2 = period2 + howManyDaysAgo
period3 = period3 + howManyDaysAgo
Tenkansen = (highest[period1](Dclose(howManyDaysAgo)) + lowest[period1](Dclose(howManyDaysAgo))) / 2
Kijunsen = (highest[period2](Dclose(howManyDaysAgo)) + lowest[period2](Dclose(howManyDaysAgo))) / 2
SSpanA = (tenkansen[period2]+kijunsen[period2])/2
SSpanB = (highest[period3](high[period2])+lowest[period3](low[period2]))/2
Chikou = close[period2]
// ACHAT
C1 = close > SSpanA and close > SSpanB
C2 = Tenkansen > Kijunsen
C3 = Tenkansen > SSpanA and Tenkansen > SSpanB
C4 = Kijunsen > SSpanA and Kijunsen > SSpanB
C5 = Chikou > SSpanA[period2] and Chikou > SSpanB[period2]
IF C1 and C2 and C3 and C4 and C5 THEN
INDICATEUR = 1
ENDIF
screener[INDICATEUR]
Hi have you tried using SUMMATION to look back in time?
I’ll look into it, thank you