High/Low/Close previous day with time

Viewing 4 posts - 31 through 34 (of 34 total)
  • Author
    Posts
  • #204563 quote
    Tom.JTom.J
    Participant
    New

    YES, thanks!

    I am also trying to add one horizontal line showing open price NY-midnight. This line I only want to be printed for the current day, no history needed.

    And one more little help would be appreciated, I would like one horizantal line across the daily chart showing previos weeks high and low.

    Thank you!

    #204564 quote
    Tom.JTom.J
    Participant
    New

    Or the weekly high and low line would be greta if it was only printed from the actual high and low and forward.

    #204573 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    There you go:

    DEFPARAM DrawOnLastBarOnly = True
    ONCE NYtime = 060000
    ONCE CurO   = open
    ONCE CurH   = high
    ONCE PrevH  = high
    ONCE CurL   = low
    ONCE PrevL  = low
    ONCE CurHw  = high
    ONCE CurLw  = low
    ONCE PrevHw = high
    ONCE PrevLw = low
    ONCE OdW    = 0
    IF OpenDayOfWeek < OpenDayOfWeek[1] THEN
       OdW      = 1
    ENDIF
    IF (OpenTime = NYtime) OR ((OpenTime > NYtime) AND (OpenTime[1] < NyTime)) THEN
       IF OdW = 1 THEN
          PrevHw= CurHw
          PrevLw= CurLw
          CurHw = high
          CurLw = low
          OdW   = 0
       ENDIF
       CurO     = open
       PrevH    = CurH
       PrevL    = CurL
       CurH     = high
       CurL     = low
       Start    = BarIndex
    ENDIF
    CurH        = max(high,CurH)
    CurL        = min(low,CurL)
    CurHw       = max(high,CurHw)
    CurLw       = min(low,CurLw)
    DrawSegment(Start,CurO,BarIndex,CurO) coloured("Green") style(Line,2)
    RETURN PrevH coloured("Blue") style(Line,2) AS "Previous DAY high",PrevL coloured("Red") Style(Line,2) AS "Previous DAY low",PrevHw coloured("Gold") style(Line,2) AS "Previous WEEK high",PrevLw coloured("Fuchsia") Style(Line,2) AS "Previous WEEK low"
    Tom.J thanked this post
    #204576 quote
    Tom.JTom.J
    Participant
    New

    Thank you!

    Just the previous weekly high/low that gives a strange result (or a result I didnt had in mind).

    On the daily chart I want just a line from the high/low of the previous week and covering the current week. I dont want any lines for the weeks before the previous week.

Viewing 4 posts - 31 through 34 (of 34 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

High/Low/Close previous day with time


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Friend @friend Participant
Summary

This topic contains 33 replies,
has 8 voices, and was last updated by Tom.JTom.J
3 years, 10 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 09/17/2020
Status: Active
Attachments: 6 files
ProRealCode ProRealCode
Loading...