Hello muilt time incator on 15 chart

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

    Trying to show higher time frame indicators of daily then down to an hour then showing it on a 15-minute i’m not having much luck with this could I get some help please thank you very much

    
    // Define the daily timeframe block
    timeframe(daily, updateonclose)
    DAILYMA10 = average[10](close)      // Calculate the 10-period MA on the daily timeframe
    DAILYMA20 = average[20](close)      // Calculate the 20-period MA on the daily timeframe
    
    // Calculate daily conditions
    DAILYBULL = (close > DAILYMA10 AND close > DAILYMA20)    // Bullish trend condition
    DAILYBEAR = (close < DAILYMA10 AND close < DAILYMA20)    // Bearish trend condition
    
    // Determine the daily trend
    DAILYTREND = 0
    if DAILYBULL then
        DAILYTREND = 1   // Bullish trend
    elsif DAILYBEAR then
        DAILYTREND = -1  // Bearish trend
    endif
    
    // Switch to the default (15-minute) timeframe
    timeframe(default)
    MA10 = average[10](close)          // Calculate the 10-period MA on the 15-minute timeframe
    MA20 = average[20](close)          // Calculate the 20-period MA on the 15-minute timeframe
    
    // Calculate 15-minute conditions
    MINUTELONG = (close > MA10 AND close > MA20)    // 15-minute long condition
    MINUTESHORT = (close < MA10 AND close < MA20)   // 15-minute short condition
    
    // Final decision combining daily and 15-minute conditions
    POSITION = 0
    if DAILYTREND = 1 AND MINUTELONG then
        POSITION = 1   // Signal to go long
    elsif DAILYTREND = -1 AND MINUTESHORT then
        POSITION = -1  // Signal to go short
    endif
    
    // Return the result
    RETURN POSITION AS "TRENbo"
    
    #240789 quote
    Patrick K Templar
    Participant
    Average
    // Define the daily timeframe block
    timeframe (1HOUR)
    
    // Conditions to enter long positions
    indicator1 = CALL "vid100"(close)
    B1 = (close > indicator1)
    indicator2 = CALL "STIPH10"[1, 10]
    B2 = (close > indicator2)
    // Conditions to enter short positions
    indicator3 = CALL "vid100"(close)
    S1 = (close < indicator3)
    indicator4 = CALL "STIPH10"[1, 10]
    S2 = (close < indicator4)
    
    timeframe (daily)
    
    // Conditions to enter short positions
    indicator3 = CALL "vid100"(close)
    S3 = (close < indicator5)
    indicator5 = CALL "STIPH10"[1, 10]
    S4 = (close < indicator6)
    // Conditions to enter long positions
    indicator6 = CALL "vid100"(close)
    B3 = (close > indicator7)
    indicator7 = CALL "STIPH10"[1, 10]
    B4 = (close > 8)
    
    TIMEFRAME(DEFAULT)
    if B1 and B2  AND B3 AND B4 then
    i=1.0
    
    elsif S1 AND S2 AND S3 AND S4 then
    i=-1.0
    elsif close  then
    i=0.0
    
    endif
    // Return the result
    RETURN I  AS "TRENbo"
    #240790 quote
    JS
    Participant
    Master
    // Define the daily timeframe block
    timeframe(daily,UpdateOnClose)
    DAILYMA10 = average[10](close)      // Calculate the 10-period MA on the daily timeframe
    DAILYMA20 = average[20](close)      // Calculate the 20-period MA on the daily timeframe
    
    // Calculate daily conditions
    DAILYBULL = (close > DAILYMA10 AND close > DAILYMA20)    // Bullish trend condition
    DAILYBEAR = (close < DAILYMA10 AND close < DAILYMA20)    // Bearish trend condition
    
    // Determine the daily trend
    //DAILYTREND = 0
    if DAILYBULL then
    DAILYTREND = 1   // Bullish trend
    elsif DAILYBEAR then
    DAILYTREND = -1  // Bearish trend
    Else
    DailyTrend=0
    EndIf
    
    // Switch to the default (15-minute) timeframe
    timeframe(default)
    MA10 = average[10](close)          // Calculate the 10-period MA on the 15-minute timeframe
    MA20 = average[20](close)          // Calculate the 20-period MA on the 15-minute timeframe
    
    // Calculate 15-minute conditions
    MINUTELONG = (close > MA10 AND close > MA20)    // 15-minute long condition
    MINUTESHORT = (close < MA10 AND close < MA20)   // 15-minute short condition
    
    // Final decision combining daily and 15-minute conditions
    //POSITION = 0
    if DAILYTREND = 1 AND MINUTELONG then
    POSITION = 1   // Signal to go long
    elsif DAILYTREND = -1 AND MINUTESHORT then
    POSITION = -1  // Signal to go short
    else
    Position=0
    EndIf
    
    // Return the result
    RETURN POSITION AS "TRENbo"
    Patrick K Templar and Iván González thanked this post
    Scherm­afbeelding-2024-11-26-om-18.58.54.jpg Scherm­afbeelding-2024-11-26-om-18.58.54.jpg
    #240792 quote
    Patrick K Templar
    Participant
    Average

    // Define the daily timeframe block
    //timeframe (1HOUR)
    timeframe (daily)
    
    // Conditions to enter long positions
    indicator1 = CALL "vid100"(close)
    B1 = (close > indicator1)
    indicator2 = CALL "STIPH10"[1, 10]
    B2 = (close > indicator2)
    
    // Conditions to enter short positions
    indicator3 = CALL "vid100"(close)
    S1 = (close < indicator3)
    indicator4 = CALL "STIPH10"[1, 10]
    S2 = (close < indicator4)
    
    
    //timeframe(default)
    timeframe (1HOUR)
    
    // Conditions to enter short positions
    indicator5 = CALL "vid100"(close)
    S3 = (close < indicator5)
    indicator6 = CALL "STIPH10"[1, 10]
    S4 = (close < indicator6)
    
    // Conditions to enter long positions
    indicator7 = CALL "vid100"(close)
    B3 = (close > indicator7)
    indicator7 = CALL "STIPH10"[1, 10]
    B4 = (close > 8)
    
    timeframe(15 minutes,updateonclose)
    // Conditions to enter short positions
    indicator8 = CALL "vid100"(close)
    S5 = (close < indicator8)
    indicator9 = CALL "STIPH10"[1, 10]
    S6 = (close < indicator9)
    
    // Conditions to enter long positions
    indicator10 = CALL "vid100"(close)
    B5 = (close > indicator10)
    indicator11 = CALL "STIPH10"[1, 10]
    B6 = (close > 11)
    
    //timeframe(default)
    if B1 and B2  AND B3 AND B4 then
    i=1.0
    
    elsif S1 AND S2 AND S3 AND S4 then
    i=-1.0
    //elsif close  then
    //i=0.0
    
    endif
    // Return the result
    RETURN I  AS "TRENbo"
    #240795 quote
    Patrick K Templar
    Participant
    Average

    does this look right for a screener

    // 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 (15-Minute) Timeframe
    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
    
    if  DAILYTREND = 1 AND HOURTREND = 1 AND MINUTELONG then
    c1 = i =1
    endif
    
    if DAILYTREND = -1 AND HOURTREND = -1 AND MINUTESHORT then
    c2 = i=-1
    endif
    
    if close then
    i=-0.0
    endif
    
    lookback=0
    
    condition=0
    
    for i = 0 to lookback do
    if c1[i] then
    condition=1
    direction=1
    break
    endif
    if c2[i]  then
    condition=1
    direction=-1
    break
    endif
    next
    
    screener[condition](direction as "bull or bear")
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Hello muilt time incator on 15 chart


ProBuilder: Indicators & Custom Tools

New Reply
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by Patrick K Templar
1 year, 9 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 11/26/2024
Status: Active
Attachments: 1 files
Logo Logo
Loading...