Same named conditon for different TimeFrames

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #235904 quote
    sgrechsgrech
    Participant
    Junior

    You can see in the code below that under both Daily/Weekly timeframes there is a condition with the same name bbUP.  This appears to be causing an issue and I am unsure why?  Basically when I sort by C9 [bbUP], the correct value is returned ie BollingerUP[20](Close) for the daily bar.  HOWEVER when I change bbUP[1], it doesn’t return the value for the previous daily bar but rather the BB for previous weekly bar!!?

    TIMEFRAME(daily)
    
    // def inds
    ma20 = average[20](close)
    bbUP = BollingerUP[20](close)
    
    //ma50 higher than prior day
    c1 = ma20 > ma20[1]
    c8 = high>bbUP
    c9=bbUP[1]
    
    TIMEFRAME(weekly)
    //def inds
    ma40 = average[40](close)
    ma80 = average[80](close)
    ma200 = average[200](Close)
    bbUP = BollingerUP[20](close)
    bbDW = BollingerDown[20](close)
    
    
    //40 period ma (200day ma) trending higher
    c2 = ma40[1] > ma40[3]
    
    //200 period ma trending higher
    c3 = ma200>ma200[5]
    
    #235909 quote
    sgrechsgrech
    Participant
    Junior

    Anyone able to provide some much needed insight?

    #235911 quote
    JSJS
    Participant
    Master

    Hi,

    You can’t use the same variable name in different time frames, this causes confusion…

    For example, use:

    bbUPDaily

    bbUPWeekly

    sgrech and Iván González thanked this post
    #235912 quote
    sgrechsgrech
    Participant
    Junior
    I guessed as much,  I already adjusted the code accordingly.
    JS thanked this post
Viewing 4 posts - 1 through 4 (of 4 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

Same named conditon for different TimeFrames


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
sgrech @sgrech Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by sgrechsgrech
2 years, 1 month ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 07/29/2024
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...