How ProOrder treats Sunday trading data in live algos

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #111269 quote
    WilkoWilko
    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
    VonasiVonasi
    Moderator
    Master

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

    Wilko thanked this post
    #111272 quote
    VonasiVonasi
    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
    WilkoWilko
    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.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

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

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