Max/MIn code question

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

    You can replace line 3 by:

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

    Thank you Roberto!

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

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 Alfy
4 years, 7 months ago.

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