screening for monthly pivot

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #132801 quote
    ronit79
    Participant
    New

    Hi all,

    I was wondering whether there is a way to screen for monthly pivots rather than for the default daily.

    I’ve been trying few things I’ve found on this blog but nothing seems to work properly.

    Your help would be much appreciated.

    Renzo

    #132848 quote
    robertogozzi
    Moderator
    Master

    There you go (thanks to Nicolas’ post https://www.prorealcode.com/prorealtime-indicators/daily-weekly-monthly-pivot-points/):

    Once Mode              = 1                //0, 1, 2 or 3
    Once lastMonthBarIndex = 0
    Once monthlyHigh       = undefined
    Once monthlyLow        = undefined
    Once monthlyPivot      = undefined
    Once monthlyR1         = undefined
    Once monthlyS1         = undefined
    Once monthlyR2         = undefined
    Once monthlyS2         = undefined
    Once monthlyR3         = undefined
    Once monthlyS3         = undefined
    If Month<>Month[1] then
        monthlyHigh = Highest[BarIndex - lastMonthBarIndex](High)[1]
        monthlyLow = Lowest[BarIndex - lastMonthBarIndex](Low)[1]
        lastMonthBarIndex = BarIndex
        If mode = 0 then
            monthlyPivot = (monthlyHigh + monthlyLow + Close[1]) / 3
        Elsif mode = 1 then
            monthlyPivot = (Open + monthlyHigh + monthlyLow + Close[1]) / 4
        Elsif mode = 2 then
            monthlyPivot = (monthlyHigh + monthlyLow + Close[1]*2) / 4
        Else
            monthlyPivot = (Open*2 + monthlyHigh + monthlyLow) / 4
        Endif
        monthlyR1 = 2*monthlyPivot - monthlyLow
        monthlyS1 = 2*monthlyPivot - monthlyHigh
        monthlyR2 = monthlyPivot   + (monthlyHigh - monthlyLow)
        monthlyS2 = monthlyPivot   - (monthlyHigh - monthlyLow)
        monthlyR3 = monthlyR1      + (monthlyHigh - monthlyLow)
        monthlyS3 = monthlyS1      - (monthlyHigh - monthlyLow)
    Endif
    Return monthlyPivot coloured(0,0,255) as "mP",monthlyR1 coloured(0,0,255) as "mR1", monthlyS1 coloured(0,0,255) as "mS1", monthlyR2 coloured(0,0,255) as "mR2", monthlyS2 coloured(0,0,255) as "mS2", monthlyR3 coloured(0,0,255) as "mR3", monthlyS3 coloured(0,0,255) as "mS3"

    name it “MonthlyPivots”, then call it in your screener:

    monthlyPivot,monthlyR1,monthlyS1,monthlyR2,monthlyS2,monthlyR3,monthlyS3 = CALL "MonthlyPivots"

    it will return the 7 variables representing Monthly:

    1. Pivot
    2. Resistance1
    3. Support1
    4. Resistance2
    5. Support2
    6. resistance3
    7. Support3
    Monthly-Pivots.itf
    #132884 quote
    Nicolas
    Keymaster
    Master
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

screening for monthly pivot


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
ronit79 @ronit79 Participant
Summary

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

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 05/22/2020
Status: Active
Attachments: 1 files
Logo Logo
Loading...