Screener using 2 time frames

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #176922 quote
    Alfy
    Participant
    Average

    Good morning guys, i wonder if anyone can help me. Im trying to screen for the TTM squeeze simultaneously on the weekly and daily time frames. Is this possible? Ive attached the basic weekly code below if someone can help fix it so that it does the same on the daily time frame.

    Best regards

    TIMEFRAME (WEEKLY)
    basis = average[21](close)
    dev = 2 * Std[21](close)
    upperBB = basis + dev
    lowerBB = basis - dev
     
    //KC
    ma = average[21](close)
    myrange = averagetruerange[14]
    upperKC = ma+myrange * 1.5
    lowerKC = ma-myrange * 1.5
    signal=(lowerBB>lowerKC) AND (upperBB<upperKC)
    SCREENER[SIGNAL]
    #176924 quote
    Rainer (RFW)
    Participant
    Senior

    Hello,
    maybe it will help.
    TFS shows from which time frame the signal comes. 1 = Day, 2 Week.
    Regards
    Rainer

    Timeframe(Weekly)
    basis = average[21](close)
    dev = 2 * Std[21](close)
    upperBB = basis + dev
    lowerBB = basis - dev
    //KC
    ma = average[21](close)
    myrange = averagetruerange[14]
    upperKC = ma+myrange * 1.5
    lowerKC = ma-myrange * 1.5
    signalW=(lowerBB>lowerKC) AND (upperBB<upperKC)
    If signalW Then
    TFS = 2
    EndIf
    //******************************************************************************************
    TIMEFRAME (1 Day)
    basis = average[21](close)
    dev = 2 * Std[21](close)
    upperBB = basis + dev
    lowerBB = basis - dev
    //KC
    ma = average[21](close)
    myrange = averagetruerange[14]
    upperKC = ma+myrange * 1.5
    lowerKC = ma-myrange * 1.5
    signald=(lowerBB>lowerKC) AND (upperBB<upperKC)
    If signald Then
    TFS = 1
    EndIf
    //******************************************************************************************
    SCREENER[SIGNALW OR SIGNALD](TFS AS "TimeFrame-Signal")
    
    Alfy thanked this post
    #176927 quote
    Alfy
    Participant
    Average

    Thanks Rainer, could you tell me how to change the code so that it screens for only when the condition applies on the weekly and the daily rather than either/or??

     

    Thank you for your help

    #176933 quote
    Alfy
    Participant
    Average

    Dont worry Rainer, done it…thanks so much for your help. Working perfectly!

    #176936 quote
    Rainer (RFW)
    Participant
    Senior

    Hello,
    I am very happy to have helped, nothing to thank. Good luck.
    Best Regards
    Rainer

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

Screener using 2 time frames


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
Alfy @alfy Participant
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by Rainer (RFW)
4 years, 6 months ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 09/07/2021
Status: Active
Attachments: No files
Logo Logo
Loading...