How to run a scan screener back in time, some days ago

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #56484 quote
    OlivierLarue
    Participant
    Average

    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]
    
    #56859 quote
    Philippo
    Participant
    Average

    Hi have you tried using SUMMATION to look back in time?

    #56886 quote
    OlivierLarue
    Participant
    Average

    I’ll look into it, thank you

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

How to run a scan screener back in time, some days ago


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
OlivierLarue @olivier7 Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by OlivierLarue
8 years, 2 months ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 12/24/2017
Status: Active
Attachments: No files
Logo Logo
Loading...