DRAWRECTANGLE in the middle of a barindex

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

    Hi all,

    I’m trying to build an indicator but I’m not sure it is possible to draw a rectangle in the middle of barindex ?
    I mean when I’m using the DRAWRECTANGLE it actually display the rectangle at the beginning of the barindex so it’s kind of “offset”. Whereas when I use the chart configurator I manage to get the black rectangle in the middle of the barindex (C.f. Screenshot)
    Also is it possible to get a specific color between the two red and green lines in the code directly ? Or is it only possible in the chart configuration ?

    Many thanks !

    Kaci.

    2020-06-19_14-45-06.png 2020-06-19_14-45-06.png
    #136557 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    As you can see from the attached pics you can draw rectangles in 3 ways:

    defparam drawonlastbaronly = true            //#1 it will only show on the current bar, so it's almost invisible (you can only change the bordercolor)
    drawrectangle(barindex,low,barindex,high)
    RETURN
    defparam drawonlastbaronly = true            //#2 you can start from a previous bar
    drawrectangle(barindex-1,low,barindex,high)
    RETURN
    defparam drawonlastbaronly = true            //#3 you can also end on a future bar and change both border and inside colours                       (v11.x ONLY)
    drawrectangle(barindex-1,low,barindex+1,high) coloured (0,255,0,32) bordercolor(0,0,255,255)
    RETURN
    Zigo, Kaci and Nicolas thanked this post
    DrawRectangle1.jpg DrawRectangle1.jpg DrawRectangle2.jpg DrawRectangle2.jpg DrawRectangle3.jpg DrawRectangle3.jpg
    #136564 quote
    KaciKaci
    Participant
    Junior

    Hi Robert,

     

    Thanks I will try which one is the best !

     

    Kaci.

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

DRAWRECTANGLE in the middle of a barindex


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Kaci @kaci Participant
Summary

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

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 06/19/2020
Status: Active
Attachments: 4 files
ProRealCode ProRealCode
Loading...