what is command for highest close during a specific time period

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #104089 quote
    rama
    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
    robertogozzi
    Moderator
    Master

    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
    robertogozzi
    Moderator
    Master

    Try this

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

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

    highinspecifiedtimeframe.jpg highinspecifiedtimeframe.jpg
    #104536 quote
    Vonasi
    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
    rama
    Participant
    Senior

    Works fine, I was in custom trading hours

    #105250 quote
    rama
    Participant
    Senior

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

    #105251 quote
    robertogozzi
    Moderator
    Master

    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.

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 robertogozzi
6 years, 6 months ago.

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