Trying to build a screener

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #240815 quote
    Patrick K Templar
    Participant
    Average

    Trying to build a screener it showe

    // Daily Timeframe
    timeframe(daily)
    DAILYMA10 = CALL "STIPH10"[1, 10]
    
    // Calculate daily conditions
    DAILYBULL = (close > DAILYMA10)    // Bullish trend condition
    DAILYBEAR = (close < DAILYMA10)    // Bearish trend condition
    
    if DAILYBULL then
    DAILYTREND = 1   // Bullish trend
    elsif DAILYBEAR then
    DAILYTREND = -1  // Bearish trend
    else
    DAILYTREND = 0   // Neutral trend
    endif
    
    // 1-Hour Timeframe
    timeframe(1hour)
    HOURMA10 = CALL "STIPH10"[1, 10]
    
    // Calculate 1-hour conditions
    HOURBULL = (close > HOURMA10)    // Bullish trend condition
    HOURBEAR = (close < HOURMA10)    // Bearish trend condition
    
    if HOURBULL then
    HOURTREND = 1   // Bullish trend
    elsif HOURBEAR then
    HOURTREND = -1  // Bearish trend
    else
    HOURTREND = 0   // Neutral trend
    endif
    
    // Default Timeframe (15-Minute)
    timeframe(default)
    MA10 = CALL "STIPH10"[1, 10]
    
    // Calculate 15-minute conditions
    MINUTELONG = (close CROSSES OVER  MA10)    // 15-minute long condition
    MINUTESHORT = (close CROSSES UNDER MA10)   // 15-minute short condition
    
    // Combine All Timeframe Conditions
    if DAILYTREND = 1 AND HOURTREND = 1 AND MINUTELONG then
    SIGNAL1 = 1   // Long Signal
    DIRECTION = 1
    elsif DAILYTREND = -1 AND HOURTREND = -1 AND MINUTESHORT then
    SIGNAL2 = -1  // Short Signal
    DIRECTION = -1
    //else
    //SIGNAL = 0   // Neutral
    //DIRECTION = 0
    endif
    
    // Screener Output
    // Screener Output
    SCREENER [SIGNAL1 OR SIGNAL2 ] (DIRECTION as "Bull/Bear")

    d me too many so I only want to look back. Free bars if anyone can help with this I think the code is right but if you can see any issues with the code please please help me

    SCREEN1.png SCREEN1.png
    #240833 quote
    Patrick K Templar
    Participant
    Average
    // Daily Timeframe
    timeframe(daily)
    DAILYMA10 = CALL "STIPH10"[1, 10]
    
    // Calculate daily conditions
    DAILYBULL = (close > DAILYMA10)    // Bullish trend condition
    DAILYBEAR = (close < DAILYMA10)    // Bearish trend condition
    
    if DAILYBULL then
    DAILYTREND = 1   // Bullish trend
    elsif DAILYBEAR then
    DAILYTREND = -1  // Bearish trend
    else
    DAILYTREND = 0   // Neutral trend
    endif
    
    // 1-Hour Timeframe
    timeframe(1hour)
    HOURMA10 = CALL "STIPH10"[1, 10]
    
    // Calculate 1-hour conditions
    HOURBULL = (close > HOURMA10)    // Bullish trend condition
    HOURBEAR = (close < HOURMA10)    // Bearish trend condition
    
    if HOURBULL then
    HOURTREND = 1   // Bullish trend
    elsif HOURBEAR then
    HOURTREND = -1  // Bearish trend
    else
    HOURTREND = 0   // Neutral trend
    endif
    
    // Default Timeframe (15-Minute)
    timeframe(default)
    MA10 = CALL "STIPH10"[1, 10]
    
    // Calculate 15-minute conditions
    MINUTELONG = (close CROSSES OVER  MA10)    // 15-minute long condition
    MINUTESHORT = (close CROSSES UNDER MA10)   // 15-minute short condition
    SIGNAL = 0
    // Combine All Timeframe Conditions
    if DAILYTREND = 1 AND HOURTREND = 1 AND MINUTELONG then
    SIGNAL = 1   // Long Signal
    DIRECTION = 1
    elsif DAILYTREND = -1 AND HOURTREND = -1 AND MINUTESHORT then
    SIGNAL = -1  // Short Signal
    DIRECTION = -1
    //else
    //SIGNAL = 0   // Neutral
    //DIRECTION = 0
    endif
    
    // Screener Output
    // Screener Output
    SCREENER [SIGNAL] (DIRECTION as "Bull/Bear")
    
    #240846 quote
    Iván González
    Moderator
    Master

    Hi, you can write the following at the end of the code:

    bars=barssince(signal<>0)
    
    SCREENER [bars>=0 and bars<3] (DIRECTION as "Bull/Bear")
    robertogozzi and Patrick K Templar thanked this post
    #240858 quote
    Patrick K Templar
    Participant
    Average

    Is it possible to have more than one screener running and thank you very much for the help that did work

    #240967 quote
    Iván González
    Moderator
    Master

    Hi!

    Yes you can run more than one as you can see in the attached screenshot.

    Patrick K Templar thanked this post
    2024-12-02_09-54.png 2024-12-02_09-54.png
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

Trying to build a screener


ProScreener: Market Scanners & Detection

New Reply
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by Iván González
1 year, 3 months ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 11/27/2024
Status: Active
Attachments: 2 files
Logo Logo
Loading...