Support/resistance rectangle that extend on last bar

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #26002 quote
    Rudy
    Participant
    New

    Hi I was wondering if anyone could help me… I’m trying to write an indicator that will find a rectangle on the chart and extend it out to the current bar.  I want to draw supply and demand zones myself using the rectangle, but I want it to automatically extend (and stay updated) to current bar.

    Any ideas?

    #26131 quote
    Nicolas
    Keymaster
    Master

    Hi Rudy, I moved your query to a new specific thread.

    To draw a rectangle that will always be drawn to the last bar, you must use the BARINDEX instruction as the second X-axis coordinate, like this:

    Example of a support zone:

    x1 = barindex-50
    y1 = lowest[50](low)[1]
    
    DRAWRECTANGLE(x1,y1,barindex,y1) COLOURED(255,0,0,100)
    
    RETURN
    #26215 quote
    Rudy
    Participant
    New

    Thank you Nicolas!  Do you know how I would get the indicator to only apply this extension to a manually drawn rectangle?  I don’t want it to draw a rectangle on its own, only extend the ones I draw.

    #26225 quote
    Nicolas
    Keymaster
    Master

    It cannot be done by code I’m sorry. I did not read well your request of your first post sorry..

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

Support/resistance rectangle that extend on last bar


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Rudy @rudy Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by Nicolas
8 years, 11 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 02/22/2017
Status: Active
Attachments: No files
Logo Logo
Loading...