Percentage Move on Friday – FX

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #200802 quote
    PhilleyPhilley
    Participant
    New

    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]
    
    #200808 quote
    JSJS
    Participant
    Master

    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

    Nicolas thanked this post
    #200859 quote
    PhilleyPhilley
    Participant
    New
      Thanks you kindly JS.
    #200873 quote
    PhilleyPhilley
    Participant
    New
      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]
    #200875 quote
    robertogozzirobertogozzi
    Moderator
    Legend
    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.
    #200909 quote
    JSJS
    Participant
    Master

    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")
    
    #201935 quote
    PhilleyPhilley
    Participant
    New
      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]
    #201991 quote
    PhilleyPhilley
    Participant
    New
    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!
Viewing 8 posts - 1 through 8 (of 8 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

Percentage Move on Friday – FX


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
Philley @philley Participant
Summary

This topic contains 7 replies,
has 3 voices, and was last updated by PhilleyPhilley
3 years, 11 months ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 09/14/2022
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...