Custom Opentime drawn as segment

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #221335 quote
    nbhudia
    Participant
    Average

    I’m trying to draw a custom line using the below code based on the time 10pm from the night before.  Whilst the code below works, I want to draw this as a segment from the time identified in “Opentime” to the end of the current day but the code keeps kicking up an error and i wasn’t sure that this is even possible.  Would someone be able to advise?

    defparam drawonlastbaronly=true

    if opentime=220000 then
    value1=open
    endif

    if intradaybarindex>=0 then
    drawhline(value1)coloured(0,0,255)
    endif

    return

    Thanks

    Nilesh

    #221345 quote
    JS
    Participant
    Senior

    Hi @nbhudia

    Is this what you want…

    DefParam DrawOnLastBarOnly=True
    
    If OpenTime=220000 then
    Value1=Open
    endif
    
    If IntradayBarIndex=0 then
    BarValue=BarIndex
    EndIf
    
    If IntraDayBarIndex>=0 then
    DrawSegment(BarValue,Value1,BarIndex,Value1)Coloured("Red")
    Endif
    
    Return
    nbhudia and Bel thanked this post
    #221352 quote
    nbhudia
    Participant
    Average
    hi JS, This is exactly what i was after, works better now. Many Thanks
    JS thanked this post
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Custom Opentime drawn as segment


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
nbhudia @nbhudia Participant
Summary

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

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