High & High[1] within x Percent – how to code please?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #18196 quote
    GraHalGraHal
    Participant
    Legend

    How would I code up below please?

    If High and High[1] are within x percent Then …

    Many Thanks
    GraHal

    #18197 quote
    JC_BywanJC_Bywan
    Moderator
    Master

    Hi,

    Do you mean within x percent of each other? Or x percent of a given third number? I assume x percent of each other, so I’d go with:

    if abs(high-high[1])/high[1]<=x/100 then
    ...
    endif
    #18198 quote
    GraHalGraHal
    Participant
    Legend

    x percent of each other … spot on! Nice one!

    Thanks ever so Much Noob
    GraHal

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

High & High[1] within x Percent – how to code please?


Platform Support: Charts, Data & Broker Setup

New Reply
Author
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by GraHalGraHal
9 years, 11 months ago.

Topic Details
Forum: Platform Support: Charts, Data & Broker Setup
Language: English
Started: 12/09/2016
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...