Simple screener not working, can't find mistake

Forums ProRealTime English forum ProScreener support Simple screener not working, can't find mistake

Viewing 15 posts - 1 through 15 (of 15 total)
  • #54313

    Hi, I’m trying to make a simple screener that alerts me when a stock’s highest/lowest price in the first 1 hour of the day is at least 0.5% from the prev-day close and also down/up at 1% on prev-day close. In case that explanation wasn’t very good, here’s a picture explaining it; https://gyazo.com/7a62b441759ee8c7a9a572de9f0a6923

    Here’s my code(V1 and V2)

    I suspect it might be a syntax mistake since my screener is listing way more stocks than it should be, from my experience, which is what tends to happen whenever a syntax is wrong.

    Can anyone correct my mistake(s) and help me out? Posting here is my last resort, after search everywhere I could.

    Thanks in advance.

     

     

    #54340

    To make a link clicky, please use the “insert/edit link” button identified by a chain connector on the grey bar when you write your post so it becomes https://gyazo.com/7a62b441759ee8c7a9a572de9f0a6923.

    You should replace lines 6-12 (both versions) with:

    because time > Hour1Start is 9 AND time < Hour1End is 8 and they exclude each other. Adding “=” should make it work!

    Also, since you are in a HOURLY timeframe, the highest & lowest prices between 080000 and 090000 are returned by the keywords HIGH and LOW of the candle closing at 090000 (which started at 080000), so you should replace lines 3-4 with:

    They are just the more visible mistakes I can easily spot. I will try to code it my own way and then post it later today.

    Roberto

    1 user thanked author for this post.
    #54341

    Hi, I’m trying to make a simple screener that alerts me when a stock’s highest/lowest price in the first 1 hour of the day is at least 0.5% from the prev-day close and also down/up at 1% on prev-day close.

    So 0.5% is +0.5% (not -0.5%)?

     

     

    1 user thanked author for this post.
    #54356

    Hi, I’m trying to make a simple screener that alerts me when a stock’s highest/lowest price in the first 1 hour of the day is at least 0.5% from the prev-day close and also down/up at 1% on prev-day close.

    So 0.5% is +0.5% (not -0.5%)?

    Thanks for above corrections, I have added them to my code but it still doesn’t work. I am no longer getting too many stocks in my screener, I now have none.

    0.5% is just a minimum benchmark from the close to the high or low. The difference between the close and high/low has got to be at least 0.5%.

    It can be either +0.5% or -0.5% depending on if it’s a bull or bear signal. In the picture/screenshot I previously sent, the signal is bullish so the 0.5% is -0.5%. If that chart was flipped to become bearish, it would be +0.5%. Hope thats makes things more clear. 

    #54816

    Hi, I’m trying to make a simple screener that alerts me when a stock’s highest/lowest price in the first 1 hour of the day is at least 0.5% from the prev-day close and also down/up at 1% on prev-day close.

    Since you used AND, there’s no need to check +-0.5%, checking 1% will do both.

    I tried to write this code, please test it and give me some feedback. I did not test it much:

    1 user thanked author for this post.
    #54832

    Hi, thanks for getting back to me.

    I just pasted your code into a new screener, and I get no new results; it still doesn’t work.

    I’m not sure what you mean by the following “Since you used AND, there’s no need to check +-0.5%, checking 1% will do both.” since the first hourly low/high being 0.5% from close is a key requirement, and I only want to be alerted once the stock has reached 1% from close. Maybe I misunderstood what you said, but it seems like theres some confusion I hope this clears any.

    Thanks in advance

     

     

    #54887

    Hi, thanks for getting back to me. I just pasted your code into a new screener, and I get no new results; it still doesn’t work. I’m not sure what you mean by the following “Since you used AND, there’s no need to check +-0.5%, checking 1% will do both.” since the first hourly low/high being 0.5% from close is a key requirement, and I only want to be alerted once the stock has reached 1% from close. Maybe I misunderstood what you said, but it seems like theres some confusion I hope this clears any. Thanks in advance

    Since you wrote “I only want to be alerted once the stock has reached 1% from close” you only need to check 1%, since it includes 0.5%.

    1 user thanked author for this post.
    #54900

    I’m confused as to why you wouldn’t need to check if the distance between the close and highest/lowest is 0.5%, since the 0.5% distance isn’t counted from close, since it is either below or above the close.

     

    I’ve attached a picture showing what I want my screener to achieve. The distance between the red circles has to be atleast -0.5% and I need the screener to tell me when the difference between the blue circles is +1%. 

     

    Thanks

    #54902

    Please attach a detailed example, you might use a spreadsheet to make it, with each candle tagged with the time it is formed.

    I can’t understand why you drew a red circle below the red candle and the other one below the green candle by its side.

    1 user thanked author for this post.
    #54903

    I drew a red circle around the previous day close, and around the lowest point of the opening hour the next day. I included the time/day bar at the bottom of the screen in hopes of showing this.

     

    Bull example:

     

    Stock price at previous day close = 10

    Stock price at low of first hour candle = 9.9

    Difference between close and lowest point in first hour = -1%

    -1% is bigger than the minimum requirement of -0.5%, which is what we are looking for.

    Stock price then increases to 10.1

    Difference between previous day close(10) and current price(10.1) is +1%, at this point, the screener alerts.

     

    Bear example:

    Stock price at previous day close = 10

    Stock price at high of first hour candle = 10.1

    Difference between close and lowest point in first hour = +1%

    +1% is bigger than the minimum requirement of +0.5%, which is what we are looking for.

    Stock price then decreases to 9.9

    Difference between previous day close(10) and current price(9.9) is -1%, at this point, the screener alerts.

     

    No alert bull example:

    Stock price at previous day close = 10

    Stock price at low of first hour candle = 9.98

    Difference between close and lowest point in first hour = -0.2%

    -0.2% is below the minimum requirement of -0.5%, which means we dont care about it.

     

    I hope this helps

    #54904

    Now I got it!

    I’ll try to arrange something tomorrow morning.

    1 user thanked author for this post.
    #54905

    Great! I’m glad that got cleared up.

     

    Just seen a small typo in my comment;

    Under “Bear example”, the line “Difference between close and lowest point in first hour = +1%”, should be; “Difference between close and HIGHEST point in first hour = +1%”

    #55044

    Try this one (I did not test it, though):

    This will work on a hourly TF, to make it work on, say, 5min TF a bit more work is needed. If it works on an hourly TF we can further adapt it to other TFs.

    Still, I have no idea what to do with 0.5%; it is useless, since you only want to be alerted when the price reaches +-1% (which is bigger than+-0.5%).

     

    2 users thanked author for this post.
    #55733

    Hi, thanks for the help. I apologize for not responding instantly, as I have been away from internet access for the last week.

    I have tried your new code, it still doesn’t work. It returns lots of stocks that don’t have anything to do with what I’m looking for.

     

    Still, I have no idea what to do with 0.5%; it is useless, since you only want to be alerted when the price reaches +-1% (which is bigger than+-0.5%).

    As I explained before, the 0.5% is not measuring anything but the difference in price from the previous days close, and the high(Bear) or low(Bull) of the first candle. If the difference is bigger than -0.5% then I want to be alerted once the stock reaches +1%(Bull signal) and if the difference is bigger than +0.5%, then I need to be alerted when the stock reaches -1%(Bear signal). So, the 0.5% is definitely needed, since it’s the opposite direction of the 1%.

    Here’s a visual of what I would like to achieve. This chart attached is a bull signal.

    Chart Key;

    1 = Previous day close (30/10/17)

    2 = Low of first hour (31/10/17)

    3 = Stock reaches +1% difference from Previous day close(1)

     

    As you can see; the difference between the Previous day close, labelled “1”(px : 1203.5) and the low of the first hour, labelled “2”(px: 1261) is -2.51%. -2.51% is above the minimum requirement of -0.5% for a Bull signal, so this is what we are looking for. For the screener to alert, we need the difference between the previous day close(“1”) and the current price to be +1%. The stock pictured, reaches +1% at point “3” on the chart.

    The general idea of this pattern is the stock price going from negative to positive(Bull) or positive to negative(Bear) within the first hour of the day. 

    Hope this helps

    #55751

    What I did not understand was  that 0.05% had to be -0.05% for BULLish setups and +0.05% for BEARish setups. Now it’s clear.

    I hope it works as you asked (any feedback is always and highly welcomed):

     

    1 user thanked author for this post.
Viewing 15 posts - 1 through 15 (of 15 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login