Auto find time when exchange open and close?

Forums ProRealTime English forum ProRealTime platform support Auto find time when exchange open and close?

Viewing 2 posts - 1 through 2 (of 2 total)
  • #234593

    Hi

    Doing some back testing and always running into summer, winter time and holidays problems, as I do my buy and sell with time when he exchange opens or closes for the day.

    Is there any automatic function in PRT so I can buy exactly when the exchange opens and sell before it closes?

    Also I check values from previous period, aka the day before when doing the buy, so the script must run exactly the first period it opens otherwise I dont get the value from the previous day.

     

    Thank you all

    #234636

    Hi,
    You could work with intradaybarindex variable or with time.
    For example, with 5 minutes timeframe in USA stocks you have 77 bars each day. You can ask the system open new position if your conditions are met when intradaybarindex=77. With this sentence the system will open in the next bar open (next day).
    You can instead use time.

    Note: Exit at the end of the day is not possible because PRT evaluate the conditions at the close of the bar. the solution is to work with smaller timeframes.

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

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