2 x ATR as a value only in box on price chart

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #97681 quote
    Probbo63
    Participant
    New

    Hi

    I think this is a problem that will easily be fixed, but sorry, I can’t find the information in the manuals/videos etc.

    I use a 2 x ATR indicator on my charts and currently have it as a separate indicator under the price chart. It is only the current value I need, so I would like it to appear as a value only in a box on the price chart.

    Can anyone help?

    Thanks

    #97685 quote
    Vonasi
    Moderator
    Master

    You can do something like this:

    defparam drawonlastbaronly = true
    
    period = 10
    
    myATR = AverageTrueRange[period]
    y = high * 1.01
    drawtext("ATRx2 = #MyATR#",barindex-2,y) coloured(204,0,204)
    DRAWRECTANGLE(barindex-4,y*1.001,barindex,y*0.999) coloured(204,0,204)
    
    return
    #97686 quote
    Vonasi
    Moderator
    Master

    I included the code for the box but it is only possible to draw a box from barindex to barindex and so the size will only work when you zoom in and make the text smaller than the box. It is probably better to remove the box completely and just do something like this:

    defparam drawonlastbaronly = true
    
    period = 10
    
    myATR = AverageTrueRange[period]
    y = high + myATR
    drawtext("ATR[ #period#] x2 = #MyATR#",barindex,y) coloured(204,0,204)
    
    return

     

    Obviously add the indicator directly to your price chart.

    #97690 quote
    GraHal
    Participant
    Master

    added here

    Snippet Link Library

    #97691 quote
    Probbo63
    Participant
    New

    Thank you Vonasi. Much appreciated.

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

2 x ATR as a value only in box on price chart


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Probbo63 @probbo63 Participant
Summary

This topic contains 4 replies,
has 3 voices, and was last updated by Probbo63
6 years, 9 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 05/04/2019
Status: Active
Attachments: No files
Logo Logo
Loading...