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
    marie123
    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
    robertogozzi
    Moderator
    Master

    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
    marie123
    Participant
    Junior

    Thank you!!

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

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 marie123
5 years ago.

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