All time maximum (at close)

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #70931 quote
    agarm
    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"
    #70938 quote
    robertogozzi
    Moderator
    Master

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

    #70941 quote
    agarm
    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.

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 agarm
7 years, 8 months ago.

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