Close at a set time on a previous day 

Forums ProRealTime English forum ProOrder support Close at a set time on a previous day 

Viewing 5 posts - 1 through 5 (of 5 total)
  • #133512

    Can some one please point me in the correct direction for some code, I am aiming for the following:

    Close at a set time on a previous day

    Where the time and the relative day are variable.

    Many thanks

    #133524

    How can you close at a set time on a previous day, say yesterday?

    You should have closed yesterday.

    #133798

    Apologies I might not have been clear in my wording. I am trying to perform a price test on historic prices as a set time of day to base the decision to open on.

    In words I am trying to achieve the following:

    I want the price at 4pm 5 days ago to compare to the price at 4pm yesterday. If this is positive I will open a position at the today at 11am .

    I have tried the below but is it not working as expected on 1 hour charts

    IF (dclose (5) <= dclose(1)) AND (hour=16 and minute = 0000) THEN

    C1= 1

    endif

    IF (C1=1 AND time = 080000 AND not daysForbiddenEntry) THEN

    BUY 1 PERPOINT AT MARKET

    ENDIF

     

    I am sure it must be simple, just new to this and trying to get some basic testing done.

    Man thanks for any input in advance.

     

     

    #133800

    I understand. It’s not possible to reference past times using brackets as only past bars can be referenced.

    You have to save 5 prices at the same time, shifting them as days go by, then compare each day the previous one with the 5th previous one. You’ll have to use 5 different variable names (v11 might allow using arrays, but they are not much help this time):

     

     

    #133801

    Sorry, I just edited line 15 due to mistyping.

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

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