Maximum value between more than 2 values

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #123619 quote
    AlgoAlex
    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
    robertogozzi
    Moderator
    Master

    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.

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 robertogozzi
5 years, 10 months ago.

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