Camarilla Pivots Proximity

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #195095 quote
    brunoasoliveira
    Participant
    New

    Hi Everyone,

    I’m trying to set a proscreener  code to find stocks with proximity to Camarilla pivots R4 and S4. The problem is in defining the value of the pivots. The value that PRT is presenting in the screener is not the same as the chart. In some stocks, the difference is much bigger. I already used the parameters as an indicator and the lines are in the same value of the PRT Camarilla Pivots. I don’t know what to do more… 🙁 I have in the screener (file attached) a column with the S4 value.

    The code i’m using is this:

    myH = ( DHIGH(1) )
    myL = ( DLOW(1) )
    myC = ( DCLOSE(1) )
    
    //Camarilla Support S4
    CAMS4 = myC-(myH-myL)*(1.1/2)
    //Camarilla Support S3
    CAMS3 = myC-(myH-myL)*(1.1/4)
    //Camarilla Support R4
    CAMR4 = ((myH-myL)*1.1)/2+myC
    //Camarilla Support R3
    CAMR3 = ((myH-myL)*1.1)/4+myC
    
    
    c1 = close <= ((CAMS4+CAMS3)/2) AND close >= CAMS4
    C2 = close >= ((CAMR4+CAMR3)/2) AND close <= CAMR4
    indicator1 = Volume
    c3 = (indicator1 >= 2000000)
    c4 = Volume > 1000000
    C5 = Close > 10 AND CLOSE < 200
    C6 = AverageTrueRange[14](Close) > 3
    criteria = CAMS4
    
    SCREENER[c1 AND C3 AND C4 AND C5 AND C6 OR c2 AND C3 AND C4 AND C5 AND C6] (criteria AS "Cam_Sup4")
    Camarilla-Pivots-Screener.png Camarilla-Pivots-Screener.png
    #195098 quote
    brunoasoliveira
    Participant
    New

    What I found right now, was that the HOD and LOD of the previous day in the code, considers the pre-market time and Camarilla Pivots don’t. How can i correct this?

    Thanks in advance.

    Regards

    #196962 quote
    brunoasoliveira
    Participant
    New

    Hi everyone,

    Any thoughts about how can I define the “high of the day” considering only regular time? I know that it is possible disabling  the extended trading hours, but I need to see the resistances and supports in the premarket. Another possibility is to “call” camarilla pivots in the code, but i’m not seeing how. Any help will be greatfull.

    Thanks in advance.

    #196965 quote
    JC_Bywan
    Moderator
    Master

    Hi,

    Assuming a start time lower than finish time (meaning not either side of local midnight for a market in a faraway timezone, which would require to amend timing conditions), and assuming a not too small intraday timeframe to avoid empty candles and to avoid more complex coding solution, this should give you the high, low and close for customised start and finish times in lines 1,2 in HHMMSS format:

    start=080000
    finish=220000
    
    if opentime=start then
    myH=high
    myL=low
    endif
    if opentime>=start and opentime<finish then
    myH=max(high, myH)
    myL=min(low,myL)
    endif
    if time=finish then
    myC=close
    endif
    
    return myL, myH, myC
    #196971 quote
    JC_Bywan
    Moderator
    Master

    Sorry, above gave myL,myH,myC for the day in response to #196962, but if you want to include it in your screener in #195095 you would need previous day’s values not today’s, I should have written it differently to keep your myL, myH, myC names for same calc as you and avoid any potential confusion, so here it is rewritten with dayH,dayL,dayC feeding at end of day into myH,myL,myC remaining not overwritten the following morning to be available for pivot calc, and without return line to add it at beginning of your screener:

    start=080000//customise it in HHMMSS
    finish=220000//customise it in HHMMSS
    
    if opentime=start then
    dayH=high
    dayL=low
    endif
    if opentime>=start and opentime<finish then
    dayH=max(high, dayH)
    dayL=min(low,dayL)
    endif
    if time=finish then
    dayC=close
    myL=dayL
    myH=dayH
    myC=dayC
    endif
    #197173 quote
    brunoasoliveira
    Participant
    New

    <span class=”bbp-author-name”>JC_Bywan</span>, you are the Master!!! Thank you very much for your help. Problem solved!

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

Camarilla Pivots Proximity


ProScreener: Market Scanners & Detection

New Reply
Author
Summary

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

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 06/10/2022
Status: Active
Attachments: 1 files
Logo Logo
Loading...