Drawtext useful LineBreak?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #212567 quote
    marlow2017marlow2017
    Participant
    Average

    I have often found that placing DRAW elements a set distance away from the candle to be difficult to manage, as the ATR*n even when small, can make a huge difference due to the differing volatilities/price-levels on various instruments.

    Goodness knows why, but I found that in the DRAWTEXT element, the HTML code ‘ <br> ‘ works.

    The effect is that the vertical centre is where the relative position is set, so that the code for example

    IF Flag[1]=1 AND Flag=0 THEN
    DRAWTEXT("§<br>.<br>.", barindex, high)
    ENDIF

    keeps the text ‘ § ‘ at a reasonably relative position to the candle.

    I mention this a I haven’t seen it mentioned elsewhere, and may be of some use to others?

    Nicolas and JS thanked this post
    #212571 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    You can also use an average of the past N bars’ range as an offset:

    Offset = average[200,0](range)
    IF Flag[1]=1 AND Flag=0 THEN
       DRAWTEXT("§", barindex, high + Offset)
    ENDIF
    marlow2017 thanked this post
Viewing 2 posts - 1 through 2 (of 2 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

Drawtext useful LineBreak?


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
marlow2017 @marlow2017 Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzirobertogozzi
3 years, 6 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 03/30/2023
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...