Label in middle if the Box

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #219240 quote
    oyinloyea
    Participant
    Veteran

    I want the Text USA to show in the middle of the box.

    Please Help

    Voffset = 5*pipsize
    starttime = 143000
    endtime = 210000
    USA=HH
    if intradaybarindex=0 then
    hh = 0
    ll = 0
    alreadydrawn = 0
    endif

    if time=starttime then
    startbar=barindex
    endif

    if time=endtime then
    endbar=barindex
    endif

    if time>=starttime and time<=endtime then
    if high>hh then
    hh = high
    endif
    if low<ll or ll=0 then
    ll = low
    endif
    endif

    if time>endtime and alreadydrawn=0 then
    drawrectangle(startbar,hh,endbar,ll)
    alreadydrawn=1

    DRAWTEXT(“USA”, barindex, High,SansSerif,Bold,16) COLOURED(255,10,10,255)
    //drawtext(“USA”,barindex,USA) coloured(204,0,204)
    endif

    RETURN

    #219242 quote
    JS
    Participant
    Senior

    Hi,

    USA boxed and centered… 🙂

     

     

    Voffset = 5*pipsize
    starttime = 143000
    endtime = 210000
    USA=HH
    if intradaybarindex=0 then
    hh = 0
    ll = 0
    alreadydrawn = 0
    endif
    
    if time=starttime then
    startbar=barindex
    endif
    
    if time=endtime then
    endbar=barindex
    endif
    
    if time>=starttime and time<=endtime then
    if high>hh then
    hh = high
    endif
    if low<ll or ll=0 then
    ll = low
    endif
    endif
    
    if time>endtime and alreadydrawn=0 then
    drawrectangle(startbar,hh,endbar,ll)
    alreadydrawn=1
    
    MiddleBar=(StartBar+EndBar)/2
    MiddlePrice=(HH+LL)/2
    
    DRAWTEXT("USA", MiddleBar, MiddlePrice,SansSerif,Bold,24) COLOURED(255,10,10,255)
    //drawtext("USA",barindex,USA) coloured(204,0,204)
    endif
    
    RETURN
    oyinloyea thanked this post
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Label in middle if the Box


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
oyinloyea @oyinloyea Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by JS
2 years, 5 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 08/17/2023
Status: Active
Attachments: 1 files
Logo Logo
Loading...