Simple test seems to run on wrong period

Forums ProRealTime English forum ProScreener support Simple test seems to run on wrong period

Viewing 9 posts - 1 through 9 (of 9 total)
  • #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.

     

    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

     

    #57663

    to 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

     

    #57664

    Hi Brisvegas, I was just looking for a green candle.  I would guess that I’d need to do something like

     

    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.

    #57674

    Have you tried using DCLOSE and DOPOEN rather than CLOSE?

    1 user thanked author for this post.
    #57679

    Thanks 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.

     

     

    #57686

    I’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.
    #57688

    Are 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

    does not work if you are interested in yesterday’s candle.

    does work for that or you can get the same result with

    I’m not big on ProScreener coding so someone else correct me if I’m wrong please.

    1 user thanked author for this post.
    #57693

    Thanks 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 🙂

     

    #57716

    With an EOD account, the screener will always use the bar before the current one, so that is not a coincidence, but the normal behavior of this account type.

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

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