How can I get the position of the highest high of the last 30 bars?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #164439 quote
    marie123marie123
    Participant
    Junior

    Hello,

    with Highest[30](high) I get the highest value of the last 30 bars. Is there a chance to get the bar number of this high?

    Thank you!

    #164454 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    You need to use FOR…NEXT:

    MyHigh = Highest[30](high)
    FOR i = BarIndex DOWNTO 0
       IF MyHigh = high[BarIndex - i] THEN
          break             //i = BarIndex of the HIGHEST high
       ENDIF
    NEXT
    marie123 thanked this post
    #164500 quote
    marie123marie123
    Participant
    Junior

    Thank you!!

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

How can I get the position of the highest high of the last 30 bars?


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
marie123 @marie123 Participant
Summary

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

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 03/17/2021
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...