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

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

    How would I code up below please?

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

    Many Thanks
    GraHal

    #18197 quote
    JC_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
    GraHal
    Participant
    Master

    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.

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 GraHal
9 years, 2 months ago.

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