Label in middle if the Box

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #219240 quote
    oyinloyeaoyinloyea
    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
    JSJS
    Participant
    Master

    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
    Scherm­afbeelding-2023-08-17-om-09.45.50.png Scherm­afbeelding-2023-08-17-om-09.45.50.png
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

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 JSJS
3 years, 1 month ago.

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