coding for previous period

Forums ProRealTime English forum ProScreener support coding for previous period

Viewing 15 posts - 1 through 15 (of 15 total)
  • #96913

    How do I code identify a previous periods close.   So, I want my code to make reference to a previous periods candle etc.

    Eg – Today Close > previous days close

    #96917

    If it is just daily close that you want then use DCLOSE[1] which is yesterdays close or DOPEN[1] . It is not possible to directly retrieve other values such as week close or year high for example but this recent indicator that I posted to the library might be useful to you if you want those values. Either hard code whichever section you need into a strategy or use CALL to get the values you need.

    https://www.prorealcode.com/prorealtime-indicators/candlesticks-ohlc-yearly-quarterly-monthly-weekly-daily-h4-h1/

    #96919

    Unlikely common referencing of previous data, by means of brackets, DOPEN, DCLOSE, DHIGH and DLOW require parentheses to reference previous days.

    #96920

    DOPEN, DCLOSE, DHIGH and DLOW require parentheses

    Well spotted Roberto. That is one that I always get wrong and PRT always tells me I got wrong! My previous post should read DCLOSE(1) and not DCLOSE[1].

    #96921

    Thanks guys, So I’ve been playing with the SUPERTREND TOUCH CODE from the forum which is:

     

    I want to get it to look back at the previous periods close.  So the codes reads:

     

    Im struggling
    #96924

    Spider and The Fly – Please use the ‘Insert PRT Code’ button when putting code in your posts to make it easier for others to read. I have tidied up your post for you.

    I will also move your topic to the screener forum as that is a more relevant place for it. 🙂

    #96926

    Thanks very much

    #96927

    What do you mean by ‘but less than previous period??’? Do you mean the low of this bar is lower than the lowest low of yesterday?

     

    #96929

    This code will  give you yesterdays lowest low:

     

    #96932

    Im sorry, I’m very new to code.’I cant work out how to do the PRT insert.

    I want the close of yesterdays candle to be lower than the close of today’s candle. I don’t know how or where to put that in the original code listed below.

     

    #96933

    Please use the ‘Insert PRT Code’ button. I tidied up your post again!

    As we are working in a screener we can use the TIMEFRAME instruction.

     

    #96934

    Im trying to get the screener to show the Supertrend when it flips bearish to bullish and vice versa as opposed to just recording a touch. Does that make sense?

    #96938

    Thanks very much guys.  I’ve worked it out with your input. Much appreciated.

    #96940

    Im trying to get the screener to show the Supertrend when it flips bearish to bullish and vice versa as opposed to just recording a touch.

    It might have been helpful if we’d had this information from the very beginning as it is very different to your first request! 🙂

    #96959

    Supertrend change its colour once the Close has crossed the line.

Viewing 15 posts - 1 through 15 (of 15 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login