adding opentime to indicator

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #237273 quote
    Aragorna
    Participant
    Junior

    Hello,

    I found this interesting indicator that I’d like to use for having USA time on my european time chart, but open time is missing. someone can help me adding it? thanks a lot in advance

     

    ONCE FromD = 153000
    ONCE ToD   = 220000
    ONCE CurC  = close
    ONCE PrevC = close
    ONCE CurH  = high
    ONCE PrevH = high
    ONCE CurL  = low
    ONCE PrevL = low
    dCond      = (OpenDayOfWeek >= 1 AND OpenDayOfWeek <= 5)
    tCond      = OpenTime >= FromD AND OpenTime <= ToD
    IF OpenDay <> OpenDay[1] THEN
    IF dCond THEN
    PrevC = CurC
    PrevH = CurH
    PrevL = CurL
    CurH  = high
    CurL  = low
    CurC  = close
    ENDIF
    ENDIF
    IF dCond AND tCond THEN
    CurC = close
    CurL = min(CurL,low)
    CurH = max(CurH,high)
    ENDIF
    RETURN PrevC coloured("black") AS "close",PrevH coloured("green") AS "high",PrevL coloured("red") AS "low
    
    #237278 quote
    robertogozzi
    Moderator
    Master

    Here is the amended version:

    ONCE FromD = 153000
    ONCE ToD   = 220000
    ONCE CurO  = open
    ONCE PrevO = open
    ONCE CurC  = close
    ONCE PrevC = close
    ONCE CurH  = high
    ONCE PrevH = high
    ONCE CurL  = low
    ONCE PrevL = low
    dCond      = (OpenDayOfWeek >= 1 AND OpenDayOfWeek <= 5)
    tCond      = OpenTime >= FromD AND OpenTime <= ToD
    IF OpenDay <> OpenDay[1] THEN
       IF dCond THEN
          PrevO = CurO
          PrevC = CurC
          PrevH = CurH
          PrevL = CurL
          CurO  = open
          CurH  = high
          CurL  = low
          CurC  = close
       ENDIF
    ENDIF
    IF dCond AND tCond THEN
       CurC = close
       CurL = min(CurL,low)
       CurH = max(CurH,high)
    ENDIF
    RETURN PrevC coloured("black") AS "close",PrevH coloured("green") AS "high",PrevL coloured("red") AS "low", PrevO coloured("Blue") AS "open"
    Iván González thanked this post
    #237323 quote
    Aragorna
    Participant
    Junior

    Thanks roberto

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

adding opentime to indicator


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Aragorna @aragorna Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Aragorna
1 year, 5 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 09/07/2024
Status: Active
Attachments: No files
Logo Logo
Loading...