Initial Balance Stop Drawing at 230000

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #223219 quote
    Kole96
    Participant
    New

    hi, this a code to draw the Initial balance in my time zone, i need it to stop drawing when market closes .

    Some Help?

    DEFPARAM DrawOnLastBarOnly = true
    //timeframe(1 hour)// I declare the timeframe, if not this will give the high and low of the first candle of the timefrae selected
    StartTime = 143000// this is my zone start time
    EndTime   = 153000
    IF OpenTime = StartTime OR ((OpenTime > StartTime) AND (OpenTime < OpenTime[1])) THEN
    myBar = BarIndex
    HH    = high
    LL    = low
    ENDIF
    IF (OpenTime >= StartTime) AND (OpenTime <= EndTime) THEN
    HH    = max(HH,high)
    LL    = min(LL,low)
    ENDIF
    IF OpenTime >= EndTime THEN
    DrawSegment(myBar,HH,BarIndex,HH) coloured("Green",255)
    DrawSegment(myBar,LL,BarIndex,LL) coloured("Red",255)
    //lastsig = 1
    ENDIF
    //if Endtime > 220000 then
    //lastsig = 0
    //endif
    RETURN HH AS "IB 1Hr High",LL AS "IB 1Hr Low"
    
    #223259 quote
    JC_Bywan
    Moderator
    Master

    Hi,

    here’s one possible way to do it, on one hand keeping your combo drawonlastbaronly=true & drawsegments for live, and on the other hand keeping hh and ll values in the return line to have them available for color zone customisation in the properties window (assuming you want to keep the color zone as per your attached image even if the zone stops at midnight your timezone):

    DEFPARAM DrawOnLastBarOnly = true
    //timeframe(1 hour)// I declare the timeframe, if not this will give the high and low of the first candle of the timefrae selected
    StartTime = 143000// this is my zone start time
    EndTime = 153000
    IF OpenTime = StartTime OR ((OpenTime > StartTime) AND (OpenTime < OpenTime[1])) THEN
    myBar = BarIndex
    HH = high
    LL = low
    ENDIF
    IF (OpenTime >= StartTime) AND (OpenTime <= EndTime) THEN
    HH = max(HH,high)
    LL = min(LL,low)
    ENDIF
    alpha=0
    IF OpenTime >= EndTime then
    DrawSegment(myBar,HH,BarIndex,HH) coloured("Green",255)
    DrawSegment(myBar,LL,BarIndex,LL) coloured("Red",255)
    //lastsig = 1
    alpha=255
    elsif opentime<StartTime then
    hh=ll
    ENDIF
    //if Endtime > 220000 then
    //lastsig = 0
    //endif
    RETURN HH coloured("Green",alpha) AS "IB 1Hr High", LL coloured("Red",alpha) AS "IB 1Hr Low"
    #223369 quote
    Kole96
    Participant
    New

    Thank you, very nice

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

Initial Balance Stop Drawing at 230000


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Kole96 @kole96 Participant
Summary

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

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