Overnight High Low

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #92533 quote
    denstr78denstr78
    Participant
    Junior

    Hello

    I need som help here. I have done a search but cant find what I´m looking for

    I want a line to show the high and the low between 220000 and 080000

    The code I have used is something I found on here but It can only show the line from 000000 to 080000

    Any idea how that can bo solved?

    if intradaybarindex =0 then
    maxprice = 0
    minprice = close * 100
    endif
    
    tcondition = time>=000000 and time<080100
    
    // Determine daily level
    if tcondition then
    maxprice = max(maxprice,high)
    minprice = min(minprice,low)
    
    Long = maxprice
    
    Short = minprice
    
    
    
    endif
    
    return Long as "Long", Short as "Short"
    #92552 quote
    VonasiVonasi
    Moderator
    Master

    Change line 6 to:

    tcondition = time>=220000 or time<080100
    denstr78 thanked this post
    #92564 quote
    denstr78denstr78
    Participant
    Junior

    Thanks for your answer @vonasi

    But it still seems like it resets the value at time 000000

    If the high or the low is before 000000 I want that to show the rest of the next day, so to speak

    Capture-6.png Capture-6.png
    #92568 quote
    VonasiVonasi
    Moderator
    Master

    Try this:

    once maxprice = 0
    once minprice = close * 100
     
    tcondition = time>=000000 or time<080100
     
    // Determine daily level
    if tcondition then
    maxprice = max(maxprice,high)
    minprice = min(minprice,low)
     
    Long = maxprice
     
    Short = minprice
    
    endif
     
    return Long as "Long", Short as "Short"
    denstr78 thanked this post
    #92571 quote
    denstr78denstr78
    Participant
    Junior

    Then the result looks like this

    Capture-7.png Capture-7.png
    #92575 quote
    VonasiVonasi
    Moderator
    Master

    Sorry but I’m trying to help while doing other things and not actually testing what I write!

    Try this:

    tcondition = time>=000000 or time<080100
     
    // Determine daily level
    if tcondition then
    if time = 000000 then
    maxprice = 0
    minprice = close * 100
    endif
    
    maxprice = max(maxprice,high)
    minprice = min(minprice,low)
     
    endif
     
    return maxprice as "Long", minprice as "Short"
    denstr78 thanked this post
    #92585 quote
    denstr78denstr78
    Participant
    Junior

    I completly understand and Im very grateful for your help @vonasi

    Now it worked perfectly and exactly as i wanted, only changed time from 000000 to 220000

    Again, thank you very much

    Capture-8.png Capture-8.png
    #92590 quote
    VonasiVonasi
    Moderator
    Master

    only changed time from 000000 to 220000

    Oooops – too much cutting and pasting by me! Glad it finally works.

    denstr78 thanked this post
Viewing 8 posts - 1 through 8 (of 8 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

Overnight High Low


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
denstr78 @denstr78 Participant
Summary

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

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 02/28/2019
Status: Active
Attachments: 3 files
ProRealCode ProRealCode
Loading...