Max/MIn code question

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #173369 quote
    AlfyAlfy
    Participant
    Average

    Good morning guys, I’m looking to keep an indicator value

    A= exponentialaverage [16] (close)
    B= exponentialaverage [32] (Close)
    ind1=A-B

     

    to a maximum and minimum value of +20 and -20. Can anyone help me with the code please? Much appreciated.

    Best regards

    #173370 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    You can replace line 3 by:

    ind1=max(-20,min(20,A-B))
    Alfy thanked this post
    #173372 quote
    AlfyAlfy
    Participant
    Average

    Thank you Roberto!

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

Max/MIn code question


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Alfy @alfy Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by AlfyAlfy
5 years, 3 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 07/09/2021
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...