Find out the open/close of the first bar of the week.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #125351 quote
    ESCapedTestSubjectESCapedTestSubject
    Participant
    Average

    Hi,

    I would appreciate any input on how to find out the trade of the first bar of the week. The reason is that I want to reset all indicators at the first bar.

    Example:

    Forex opens at 22.00 on Sunday. US futures at 00.00 Monday.

    I tried using IntraDayBarIndex with DayOfWeek, but IntraDayBarIndex which normally shows 0 (zero) on the first bar, also shows 0 (zero) on the first bar in case the first day is not fully loaded.

    I can of course set the specific hours, but the problem is that Daylight saving between countries occurs on different dates, so there are 2-3 weeks difference sometimes which makes this a big problem with my ProBackTesting.

    Any clues as to find out which bar is the first bar?

    Many thanks.

    #125360 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    The first bar of the week is when OpenDayOfWeek < OpenDayDayOfWeek[1].

    #125700 quote
    ESCapedTestSubjectESCapedTestSubject
    Participant
    Average

    Thanks. I overcomplicated things as I was resetting the weekly trades.

    #125703 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Sorry for mispelling the second OpenDayOfWeek.

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

Find out the open/close of the first bar of the week.


ProBuilder: Indicators & Custom Tools

New Reply
Summary

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

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 04/09/2020
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...