what is command for highest close during a specific time period

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #104089 quote
    ramarama
    Participant
    Senior

    I am trying find out high during specific session such as between 8 am till 12.30 what is highest close

    c1=time>=080000 and time<=143000
    c2= highest[40](high)
    if c1 then
    c2= highest[40](high)
    endif
    
    return c2

    I wrote the above code but it bring only highest of 40 candles all the time  ( i counted the candles between which is 40)

    #104092 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    For clarity of messages on ProRealCode’s forums, please use the “insert code PRT” button to separate the text of the code part!

    Thank you!

    #104093 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Try this

    If time = 080000 then
      c2 = close
    Endif
    If time <= 123000 then
       c2 = max(c2,close)
    Endif
    return c2
    #104534 quote
    ramarama
    Participant
    Senior

    the above code is not working, please find the screen shot attached

    highinspecifiedtimeframe.jpg highinspecifiedtimeframe.jpg
    #104536 quote
    VonasiVonasi
    Moderator
    Master

    Works just fine for me. What time frame chart are you applying it to as there are no details at all in your screen shot?

    1 minute screenshot attached.

    Screenshot_3-2.png Screenshot_3-2.png
    #104574 quote
    ramarama
    Participant
    Senior

    Works fine, I was in custom trading hours

    #105250 quote
    ramarama
    Participant
    Senior

    how get the same value for previous day or 2 days ago

    #105251 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    There you go:

    If time = 080000 then
      Previous2 = Previous1
      Previous1 = c2
      c2        = close
    Endif
    If time <= 123000 then
       c2 = max(c2,close)
    Endif
    return c2,Previous1,Previous2 //c2=today, Previous1=yesterday, Previous2=the day before yesterday
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

what is command for highest close during a specific time period


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
rama @rama Participant
Summary

This topic contains 7 replies,
has 3 voices, and was last updated by robertogozzirobertogozzi
7 years, 1 month ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 08/03/2019
Status: Active
Attachments: 2 files
ProRealCode ProRealCode
Loading...