Custom Opentime drawn as segment

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

    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
    Scherm­afbeelding-2023-09-20-om-18.49.29.png Scherm­afbeelding-2023-09-20-om-18.49.29.png
    #221352 quote
    nbhudianbhudia
    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.
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

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 nbhudianbhudia
3 years ago.

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