I’m trying to write a screener that checks DOpen(0) against another indicator but I only want it to evaluate the condition between a specified time, say the first 10 mins of the market open. At the moment it doesn’t seem to work.
Start = 060000
End = 103000
IF TIME >= Start AND TIME =< End THEN
Conditions...
ENDIF
I have tried the above but it returns no results.
Is what I’m trying to do possible please?
Thanks
Rob
A suggestion … test using conditions that you know will definitely return a value between those times then you can check out that the Screener worked between those times only?
In which timeframe please?
Hi Nicolas
Daily timeframe which I guess is my problem?
I’m trying to compare today’s open to an indicator value from two periods ago [2]
Thanks
Rob
Yes that’s the problem, because you check TIME that are not read in daily bar. You should split your conditions into different timeframe by using the TIMEFRAME instruction of ProScreener.
I think I’m with you 🙂
So I check the daily indicator value on the daily timeframe and DOpen(0) on a lesser timeframe, like an hour?
Forget what I said in my last post, Dopen(0) is a value that can test in any timeframe. So just use the same code that you did but on a timeframe that read the TIME you set on its bar close.
e.g. 103000 is a time read only starting at timeframe 30 minutes (and below obviously).
Hi Nicolas
I’m struggling and would appreciate some help please.
I have coded a dummy ProOrder system with GRAPH statements similar to what is in the SCREENER. I can verify the conditions being met/correct but I cannot get the SCREENER to return any values.
I am executing both the ProOrder system and the screener on a 1 minute chart.
What am I doing wrong please?
Thanks
Rob
DEFPARAM CUMULATEORDERS = False
//EMA[2] from dailt chart
timeframe(daily)
EMA2 = ExponentialAverage[2]
//Daily SMA
smad20 = average[21]
timeframe(default)
//dummy order condition
IF smad20=-100 THEN
BUY AT MARKET
ENDIF
GRAPH DOpen(0) as "Daily Open(0)"
GRAPH EMA2 as "Daily EMA 2"
GRAPH Close as "Close"
// Time to check the condition
CheckTime = 090000
// Flag setup
Flag = 0
// EMA[2] from Daily chart
timeframe(daily)
EMA1 = ExponentialAverage[2]
timeframe(default)
// Daily open value
DaOpen = DOpen(0)
// To go short
IF (TIME = CheckTime) THEN
IF DaOpen >= EMA1 THEN
Flag = 2
ENDIF
ENDIF
// To go long
IF (TIME = CheckTime) THEN
IF DaOpen <= EMA1 THEN
Flag = 1
ENDIF
ENDIF
SCREENER[Flag](Flag AS "1=Buy 2=Sell")
I get plenty of results by using the screener on a 1-hour timeframe.
At the time I write this post, there is 337 elapsed 1-minute bars since 9 o’clock this morning, with a limitation of 254 bars in ProScreener, there is no way for your code to return something..
Of course, I forgot about that limit!
Thanks again.