PREVIOUS HIGH, LOW & CLOSE INDICATOR

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #31288 quote
    HenryHenry
    Participant
    Average

    A request that was addressed to ProRealTime:

    I want a method to get the “PREVIOUS HIGH, PREVIOUS LOW & PREVIOUS CLOSE” of previous year.

    Suggestion for an anwser:

    You must select the data from the beginning of last year

    once currenthigh=high
    once currentlow=low
    
    once previousclose=undefined
    once previoushigh=undefined
    once previouslow=undefined
    
    if openyear <> openyear[1] then
    previousclose=close[1]
    previoushigh=currenthigh
    previouslow=currentlow
    currenthigh=high
    currentlow=low
    else
    currenthigh=max(high,currenthigh)
    currentlow=min(low,currentlow)
    endif
    
    return previoushigh as "previous year high",previouslow as "previous year low",previousclose as "previous year close"


    #31314 quote
    donaldthetraderdonaldthetrader
    Participant
    Average

    Thank you so much @Henry

Viewing 2 posts - 1 through 2 (of 2 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

PREVIOUS HIGH, LOW & CLOSE INDICATOR


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Henry @henry Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by donaldthetraderdonaldthetrader
9 years, 5 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 04/06/2017
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...