Draw an arrow on the minimum of the last n bars

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #170286 quote
    IcaroFMIcaroFM
    Participant
    Veteran

    How can I draw an arrow up on the minimum and an arrow down of the last n bars?

    For example: I would like to draw an arrow up and an arrow down of the last 10000 bars that shows the lower and the higher value. (see attached)

    PRTLowerHigherBar.png PRTLowerHigherBar.png
    #170293 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    There you go:

    Defparam DrawOnLastBarOnly = true
    ONCE hh = 0
    ONCE ll = 0
    p  = 10000
    n  = 0.003
    hh = highest[p](high)
    ll = lowest[p](low)
    IF (hh <> hh[1]) OR (ll <> ll[1]) THEN
       FOR i = 0 TO (p - 1)
          IF hh = high[i] THEN
             BarHH = BarIndex[i]
          ENDIF
          IF ll = low[i] THEN
             BarLL = BarIndex[i]
          ENDIF
       NEXT
    ENDIF
    DrawArrowUP(BarLL,ll * (1 - N))   coloured(0,255,0,255)
    DrawArrowDOWN(BarHH,hh * (1 + N)) coloured(255,0,0,255)
    RETURN

    but 10000 is such a high number that your chart will almost get stuck.

    IcaroFM thanked this post
    #170397 quote
    IcaroFMIcaroFM
    Participant
    Veteran

    Thank you very much Roberto

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

Draw an arrow on the minimum of the last n bars


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
IcaroFM @icarofm Participant
Summary

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

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 05/24/2021
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...