Box end , period start End

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #223530 quote
    oyinloyeaoyinloyea
    Participant
    Veteran

    I will like o create a box with period Start as 03:00 and period End 06:00 and box end as 18:00

    I can do the period start and period End

    DefParam DrawOnLastBarOnly = True
    DEFPARAM CalculateOnLastBars = 10000

    start = 030000
    end = 060000
    tc = time>=start and time<end
    if tc then
    if not tc[1] then
    IBHUK=high
    IBLUK=low
    endif
    IBHUK=max(high,IBHUK)
    IBLUK=min(low,IBLUK)

    mid = (IBHUK +IBLUK)/2
    ENDIF
    drawtext(“IBHUK”,barindex,IBHUK,SansSerif,Bold,10)
    drawtext(“IBLUK”,barindex,IBLUK,SansSerif,Bold,10)
    drawtext(“mid”,barindex,mid,SansSerif,Bold,10)

    RETURN IBHUK as ” IBHUK”,IBLUK as ” IBLUK”

    toks.png toks.png
    #223548 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    There you go:

    DefParam DrawOnLastBarOnly   = True
    DEFPARAM CalculateOnLastBars = 10000
    
    rx=255
    gx=174
    bx=185
    
    rw=16
    gw=78
    bw=139
    
    t =255
    
    start=030000
    end1 =060000
    end2 =180000
    tc1  =(time>=start and time<end1)
    tc2  =(time>=end1  and time<end2)
    if tc1 then
       if time = start then
          bar1 = barindex
       endif
       if time < end1 then
          bar2 = barindex
       endif
       if not tc1[1] then
          IBHUK=high
          IBLUK=low
       endif
       IBHUK=max(high,IBHUK)
       IBLUK=min(low,IBLUK)
       mid  = (IBHUK +IBLUK)/2
    ENDIF
    
    IF tc2 THEN
       IF not tc2[1] then
          bar3 = barindex - 1
       endif
    endif
    
    IF tc2 THEN
       bar4 = barindex
    ENDIF
    
    drawtext("IBHUK",barindex+3,IBHUK,SansSerif,Bold,10)
    drawtext("IBLUK",barindex+3,IBLUK,SansSerif,Bold,10)
    drawtext("mid",  barindex+3,mid,  SansSerif,Bold,10)
    
    DrawRectangle(Bar1,IBHUK,bar2,IBLUK)    style(line,1) coloured(rx,gx,bx,t) bordercolor(rx,gx,bx,t)
    IF not tc1 then
       DrawRectangle(Bar3,IBHUK,bar4,IBLUK) style(line,1) coloured(rw,gw,bw,t) bordercolor(rw,gw,bw,t)
    endif
    
    
    RETURN //IBHUK as " IBHUK",IBLUK as " IBLUK"
    oyinloyea thanked this post
    x.jpg x.jpg
    #223658 quote
    oyinloyeaoyinloyea
    Participant
    Veteran

    Please ignore

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

Box end , period start End


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
oyinloyea @oyinloyea Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by oyinloyeaoyinloyea
2 years, 10 months ago.

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