I know, this should be too easy, right ? Still I can’t solve it.
1
2
3
4
5
6
TIMEFRAME(1day)
OKForScreener=0
ifClose[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.
To help us continually offer you the best experience on ProRealCode, we use cookies. By clicking on "Continue" you are agreeing to our use of them. You can also check our "privacy policy" page for more information.Continue