All time maximum (at close)

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

    Hello everybody,

    I am trying to generate an indicator that shows the all time high (evaluated at close)

    For that I am just checking when the close<close[1] and close[1]<close[2] (condition of relative maximum)

    The problem is that it shows me all the relative maximums even when they are lower than the previos higher maximums (see picture)

    I would like to add a condition like close>MM[1], but then the code does nothing.

    Could you please help me?
    Cheers

    // Show relative maximum
    MM=0
    if (close < close[1]) and (close[1]>close[2])   then
    MM= close[1]
    else
    MM=MM[1]
    endif
    
    return MM as "MMHH"

    Modified code which does not work

    // Show absolute maximum
    MM=0
    if (close < close[1]) and (close[1]>close[2]) and (close>MM[1])  then
    MM= close[1]
    else
    MM=MM[1]
    endif
    
    return MM as "MMHH"
    figure_1.png figure_1.png
    #70938 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Just remove, or comment out, lines 5-6.

    #70941 quote
    agarmagarm
    Participant
    New

    Thanks a lot!!
    A found it out in the last 10 min!! 😉

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

All time maximum (at close)


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
agarm @agarm Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by agarmagarm
8 years, 4 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 05/20/2018
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...