Simple test seems to run on wrong period
Forums › ProRealTime English forum › ProScreener support › Simple test seems to run on wrong period
- This topic has 8 replies, 4 voices, and was last updated 6 years ago by Nicolas.
-
-
01/08/2018 at 5:01 AM #57661
Hi all,
I’ve got another problem I can’t seem to solve. I have searched the forums, the PRT screener manual and Google but haven’t found an answer. I have written the most simple of codes, but am not getting what I expect. As a part of a larger screener, I am wanting to confirm that the most recent day was an up day, i.e. that the price rose. I like to test each element of my screener as I build it, so wrote and ran the following on the “Australian Market” list in PRT.
Was yesterday an123c1 = close > openscreener [c1]When I run this, I get shares that were up and shares that were down on the last candle (Friday last week) but all results seem to have an up candle on Thursday last week. Is there a reason this would be running like this? Is it to do with using the free version with end of day data or is there something wrong with the code?
Apologies if it is a dumb question and thanks in advance to anybody who can explain what I’m doing wrong.
Thanks,
David
01/08/2018 at 5:12 AM #57663to be clear are you looking for stocks that closed green or stocks that just closed above open for there is a difference ? A stock can close above open and still be a down day
Possibly this is what you require
1234c1 = (close > close[1])SCREENER[c1] (Variation AS "%Chg prev bar")01/08/2018 at 5:25 AM #57664Hi Brisvegas, I was just looking for a green candle. I would guess that I’d need to do something like
Checking today is up on yesterday123c1 = close > close[1]screener [c1]to have an “up day” compared to yesterday. I just ran that code and it didn’t seem to work either. Anyway, I’ve attached an example of a chart that I get from the code in my first post if that helps.
01/08/2018 at 10:17 AM #5767401/08/2018 at 11:03 AM #57679Thanks Vonasi,
DOpen(0) and DClose(0) worked.
I’d still like to know why Open and Close didn’t work as I’m on daily charts. Maybe one of those features of coding you need to know to get things working in PRT 🙂
I guess I’ll use DOpen, DHigh, DLow and DClose in all of my screener coding from now on.
01/08/2018 at 11:37 AM #57686I’d still like to know why Open and Close didn’t work as I’m on daily charts
Because you are scanning with an ‘End Of Day’ account?
1 user thanked author for this post.
01/08/2018 at 11:40 AM #57688Are you interested in whether yesterday was a green day or whether today is currently a green day? I think ProScreener looks at the current still forming candle to make decisions which is why
1close > opendoes not work if you are interested in yesterday’s candle.
1close(1) > open(1)does work for that or you can get the same result with
1DClose(1) > DOpen(1)I’m not big on ProScreener coding so someone else correct me if I’m wrong please.
1 user thanked author for this post.
01/08/2018 at 12:10 PM #57693Thanks Nicolas and Vonasi,
It may be because I am using an EOD account. I would have thought close > open would deliver nothing if it needs to work on the current day data and I’m on EOD. I ran a test on 20 stocks and it seemed to be looking at the day before yesterday but that could be a coincidence I guess if the program is somehow looking at current day data on an EOD acount. Anyway, the use of DOpen, DClose etc seems to have at least given me a workaround. I appreciate your time in considering my problem 🙂
01/08/2018 at 1:46 PM #57716 -
AuthorPosts
Find exclusive trading pro-tools on