How ProOrder treats Sunday trading data in live algos

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #111269 quote
    Wilko
    Participant
    Senior

    I want to call yesterday’s hourly ATR for IG’s EURUSD contract during European futures opening hours. My trading platform is set to CET, Central European Time. If I do this in backtest I can use the following code snippet to store the average true range in the variable ATR:

    TIMEFRAME(Hourly)
    
    IF TIME = 220000 THEN
    ATR = AverageTrueRange[14](close)
    ENDIF

     

    I can then call ATR during the following day.

    Backtest will treat Sunday data as Monday. However, I am uncertain how Sunday data is treated in live algos. Will the IF-clause run on DayOfWeek=1 give me Sunday data or will it give me Friday’s data?

     

    Thanks for any help answering this question.

    #111271 quote
    Vonasi
    Moderator
    Master

    Wilko – Please use the ‘Insert PRT Code’ button when posting code. I tidied up for you. 🙂

    Wilko thanked this post
    #111272 quote
    Vonasi
    Moderator
    Master

    Any time the code is run on a candle with a closing time of 2200 it will store the ATR based on that candle and the previous 13. If there is a Sunday 2200 candle then it will change the value. If you want to avoid those candles then just do this:

    TIMEFRAME(Hourly)
     
    IF TIME = 220000 and opendayofweek <> 0 THEN
    ATR = AverageTrueRange[14](close)
    ENDIF
    #111401 quote
    Wilko
    Participant
    Senior

    Thanks @Vonasi for you tidying of my original post and for your suggestion! That effectively eradicates this problem (which is “invisible” in backtests).

     

    /F

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

How ProOrder treats Sunday trading data in live algos


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Wilko @wilko Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by Wilko
6 years, 4 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 10/26/2019
Status: Active
Attachments: No files
Logo Logo
Loading...