52 week high Explain the difference between these 2

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

    Hey,

     

    this is such a simple question but I am looking at some old coding of mine and notice 2 things I’ve put in differently

     

    HC = Highest [ 52 ] ( High ) [ 2 ]

    HC = Highest [ 52 ] ( High ) [ 1 ]

     

    What is the difference between the 1 and the 2, is it that the last 2 bars are high closes on the prevous 52 and the last 1 bar is a high close on the previous 52?

    #114945 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Both find the highest high within the last 52 bars.

    The difference is that [1] starts from the 1st bar preceding the current one (which is none or [0]), while [2] starts from the 2nd bar preceding the current bar. [1] will scan bars 1-52, [2] will scan bars 2-53.

    #114946 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    They can also be written as:

    HC = Highest[52](High[2])
    HC = Highest[52](High[1])

    there’s no difference (only logic differs).

    This example fits best my explanation above.

    You examples scan 52 bars, but they retrieve the value that was retained 2 and 1 bars ago, respectively.

    You could accomplish the same goal with:

    HC  = Highest[52](High)
    HCx = HC[2]
    //    or
    HC  = Highest[52](High)
    HCx = HC[1]
Viewing 3 posts - 1 through 3 (of 3 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

52 week high Explain the difference between these 2


ProScreener: Market Scanners & Detection

New Reply
Author
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by robertogozzirobertogozzi
6 years, 9 months ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 12/16/2019
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...