How to access the previous day ?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #157642 quote
    PeterSt
    Participant
    Master

    I know, this should be too easy, right ? Still I can’t solve it.

    TIMEFRAME (1 day)
    OKForScreener = 0
    
    if Close[1] < Open[1] then   // Previous day had a loss ?
      OKForScreener = 1
    endif

    Say it is 10:45 in Europe. The above works fine for the currently open markets like Euronext stocks. Open[1] = Yesterday.

    Then, it still is 10:45 in Europe. The above now does not work for currently closed markets like Nasdaq. Open[1] now = DayBeforeYesterday.

    In this situation my Screener will mess up because it doesn’t do at all what I want. I’ll have securities which went up yesterday, mixed with securities which went down yesterday.
    This is not really solved by making a separate Screener for Europe and USA markets, because soon it will be 15:30 (USA open) and suddenly half of the USA securities will disappear while an other half will newly pop up. Unacceptable.

    I am not sure whether to call this a real bug, but assumed I see this correctly, people should realize that a Weekly timeframe also won’t work well for the same reasons. But you may not see it … (it took me just 3 hours to find the reason of my simple code (above) not working, thinking I was doing it a 100 times wrong).
    See the attachment for the importance of it (those are daily candles).

    Does anyone have a solution for this ? … I can envision something with CurrentDay with dates etc., but it would still require some creativity to solve it decently.
    Please notice that the solution does not need to take into account the Settlement Times (but it surely would be alowed). Thus, if the DAX-Future would Settle at 17:30 then it is OK that the day (our improved Close[1]) will just range from opening (01:15) to closing (22:00). Or more generally, from my set new day time (00:00). This is all not that important.

    🙂

    image_2021-01-13_125057.png image_2021-01-13_125057.png
    #157775 quote
    Nicolas
    Keymaster
    Master

    Use Dopen, Dclose?

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

How to access the previous day ?


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
PeterSt @peterst Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by Nicolas
5 years, 2 months ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 01/13/2021
Status: Active
Attachments: 1 files
Logo Logo
Loading...