Maximum value between more than 2 values

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #123619 quote
    AlgoAlexAlgoAlex
    Participant
    Master

    Given that functions max and min return result only between 2 values, how can we find the maximum value between 3 or more values?

    Example: I have 3 SMA, 20, 50 and 100, and I want to code an indicator that plots continuously the highest and minimum value related to the 3 SMAs.

     

    Thanks in advance.

    #123627 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    There you go:

    x = max(sma20,max(sma50,sma100))
    y = min(sma20,min(sma50,sma100))
    AlgoAlex thanked this post
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

Maximum value between more than 2 values


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
AlgoAlex @alexf Participant
Summary

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

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 03/27/2020
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...