Hi,
I’m trying to execute a screener to confirm if the price move at between 08:00 and 21:55 is above a certain percentage. The below code is not returning with an error shown in the “If (P1-P2)/P1 > 0.007 then” line. Screener to be executed on Sundays on certain FX pairs for the Friday move hence 0 to 0 loop.
Any help is greatly appreciated.
P1 = Open[080000]
P2 = Open[215500]
For y = 0 to 0
If (P1-P2)/P1 > 0.007 then
c1 =1
break
endif
Screener [c1]
JSParticipant
Veteran
The numbers between “brackets” after Open[…] are not intended for data.
Hence the error message.
Open[0] = the last Open
Open[1] = the previous Open
Etc.
If you want to use times, you can do it this way:
If OpenTime >= 080000 and OpenTime <= 215500 then
Or
If OpenTime = 080000 then
xOpen080000 = Open
ElsIf OpenTime = 215500 then
xOpen215500 = Open
EndIf
Percentage: (%)
(xOpen215500 – xOpen080000) / xOpen08000 * 100
If ((xOpen215500 – xOpen080000) / xOpen08000 * 100) > 0.7 then
C1
EndIf
The below code should be returning results on the daily candle for my FX pairs list but no joy, am I missing something
If OpenTime = 080000 then
xOpen080000 = Open
ElsIf OpenTime = 215500 then
xOpen215500 = Open
EndIf
If ((xOpen080000 – xOpen215500) / xOpen080000) > 0.007 then
C1 = 1
EndIf
SCREENER [C1]
On a Daily candle there’s no intraday time, it starts at a fixed time and ends at a fixed time.
There must be a candle opening/closing at anyone of the chosen times.
JSParticipant
Veteran
Hi @Philey
Try it with this screener…
The screener calculates the “Move” of the selection on the last Friday
The “Move” must take place between 08:00 and 22:00 on Friday.
When this “Move” is greater than 0.007 then the signal = 1
You should not use this screener on Friday before 22:00 otherwise it will work with the wrong values (before 22:00 it will use a value from the previous Friday)
You must set the “Period” in your screener to 1 hour otherwise the times cannot be read.
xPercent = 0.007
Signal = 0
If DayOfWeek = 5 and OpenTime = 080000 then
xOpen080000 = Open
ElsIf DayOfWeek = 5 and OpenTime = 220000 then
xOpen220000 = Open
EndIf
xMove = abs((xOpen080000 - xOpen220000) / xOpen080000)
If xMove > xPercent then
Signal = 1
EndIf
Screener[Signal](Signal as "%Move")
The below screener is working perfectly however I need to add a few additional conditions namely RSI and bollinger band levels on the daily chart. Given that the below code works only in the 1hr candles is there anyway I can incorporate the RSI and bollinger band daily values in the same screener?
Signal = 0
If DayOfWeek = 5 and OpenTime = 080000 then
xOpen080000 = Open
ElsIf DayOfWeek = 5 and OpenTime = 210000 then
xClose210000 = Close
EndIf
xMovedown = ((xOpen080000 - xClose210000) / xOpen080000)
xMoveUp = ((xClose210000 - xOpen080000) / xOpen080000)
If xMovedown > xPercent then
Signal = 1
Elsif xmoveUp > xpercent then
Signal = 1
EndIf
Screener[Signal]
The below is my current take on the issue . . .
xPercent = 0.007
Signal = 0
If dayofweek = 5 then RSIFri = timeframe (daily) RSI[14](close)
endif
If DayOfWeek = 5 and OpenTime = 080000 then
xOpen080000 = Open
ElsIf DayOfWeek = 5 and OpenTime = 210000 then
xClose210000 = Close
EndIf
xMovedown = ((xOpen080000 - xClose210000) / xOpen080000)
//xMoveUp = ((xClose210000 - xOpen080000) / xOpen080000)
If xMovedown > xPercent and RSIFri < 40 then
Signal = 1
EndIf
Screener[Signal]
Thanks!