Today vs Yesterday current cumulative volume comparison
Forums › ProRealTime English forum › ProScreener support › Today vs Yesterday current cumulative volume comparison
- This topic has 13 replies, 2 voices, and was last updated 3 years ago by robertogozzi.
-
-
07/03/2021 at 9:02 PM #173069
Good day,
I am stuck with the task to add a comparison of:
Current cumulative volume up to this time of today / cumulative volume up to this time of previous day
To my screener. Is there a proper method to do that? All I came across have some limitations and/or built in data imperfections due to premarket volume.
Thanks!
07/04/2021 at 9:50 AM #173080Post your topic in the correct forum:
_ ProRealTime Platform Support: only platform related issues.
_ ProOrder: only strategy topics.
_ ProBuilder: only indicator topics.
_ ProScreener: only screener topics
_ General Discussion: any other topics.
_ Welcome New Members: for new forum members to introduce themselves.Thank you 🙂
I moved it from ProRealTime Platform Support.
07/04/2021 at 10:01 AM #173081Currently, screeners have a 254-bar look back limit.
You cannot go beyond that limit.1 user thanked author for this post.
07/04/2021 at 10:13 AM #173082Roberto, thank you for the clarification, it’s a very important information (and I’m sorry for mixing forums, will do better next time).
Regarding the volume analysis – is there a way to exclude afterhours/premarket bars? If I got it right, screener will look for 254 bars irregardles whether it’s main trading session or not, and I’d like to analyze only main session data. Is there a way to do that?
07/04/2021 at 11:39 AM #173089PRT’s settings allow plotting on a chart some premarket data, but I as far as I know there’s no way to exclude some periods.
You have to code your screener to only account for data from a starting hhmmss to an ending hhmmsd.
1 user thanked author for this post.
07/07/2021 at 7:08 PM #173321I’ve successfully excluded premarket data by adding extra time settings like so:
1time > 093000 and time < 160000Still, I am desperately in need of a way to compare current cumulative volume up to this time of today with cumulative volume up to this time of previous trading day.
I understand the 254-bar look back limitation (Roberto, thank you again), so I can see that my only option would be to use 5 minute timeframe – but I can’t figure out how to implement such a comparison. Any help would be much appreciated.
07/07/2021 at 11:35 PM #17332207/08/2021 at 11:55 AM #173333Roberto, at any time during the trading session I’d like my screener to be able to compare the ratio of the current accumulated volume to the accumulated volume to the same time yesterday.
For example, lets say currently it’s 9:45 am of July 7 (15 minutes into the market) and my screener is looking at BSQR. By 9:45 BSQR has 3728168 volume (I’ve summarized three 5-minute candles of volume by hand).
Now, “yesterday”, July 6, during that same period of time, 9:30 to 9:45 – BSQR had 12168494 volume. So now my screener is aware of those numbers, and I can easily calculate “current cumulative volume up to this time of today / cumulative volume up to this time of previous day”, which will be 0.3 in this case.
07/08/2021 at 4:05 PM #173345Try this one:
123456IF Time = 094500 THENCumVol = CurVolCurVol = 0ENDIFCurVol = CurVol + VolumeSCREENER[CumVol](CumVol AS "Cum.Volume")07/08/2021 at 8:14 PM #173354Roberto, thank you very much for your help, but perhaps I didn’t explain the task correctly.
Your code, if I get it right, counts total volume for today (with the limit of 9:45). What I am looking for, is a code for screener, which can count total volume for whatever time it is right now (but only within main trading session) and compare it with the total volume for that same exact period of yesterday’s main trading session.
I’ve found almost identical task at this topic: https://www.prorealcode.com/topic/intraday-relative-volume-for-5min-chart/ but the screener code from that topic suffers from issues due to premarket/afterhours candles, the offset is calculated incorrectly.
If you can suggest a way to safely exclude premarket/afterhour candles with that screener, so we can analyze exclusively main trading session – that would be brilliant.
07/08/2021 at 11:30 PM #173361There you go, but you have to change the time for unwanted trading hours (mine is just an example, from 080000 through 083000):
12345678910111213i = 1CumVol = 0WHILE i < 254IF Time[i] <> Time THENIF Time[i] >= 080000 AND Time[i] <= 083000 THENCumVol = CumVol + Volume[i]ENDIFELSEBreakENDIFi = i + 1WENDSCREENER[CumVol](CumVol AS "Cum.Volume")1 user thanked author for this post.
07/12/2021 at 8:24 AM #17348707/12/2021 at 4:09 PM #173526Try this one, but I could not check if volume data is correct.
You should also bear in mind that if the prior day spans across the 254-bar limut, results will be inaccurate.
12345678910111213141516j = 0i = -1CumVol = 0WHILE j < 253IF (Time[j + 1] > Time[j]) AND (i < 0) THENi = j + 1 //This is where the prior day startsENDIFIF i >= 0 THENIF Time[i] >= 080000 AND Time[i] <= 083000 THENCumVol = CumVol + Volume[i]ENDIFi = i + 1ENDIFj = j + 1WENDSCREENER[CumVol](CumVol AS "Cum.Volume")1 user thanked author for this post.
07/13/2021 at 11:07 AM #173580Try this update:
123456789101112131415161718192021CumVol = 0j = 0i = -1WHILE j < 253IF Time >= 0 AND Time < Time[1] THENCumVol = 0i = j + 1 //This is where the prior day startsENDIFIF i > 0 THENIF Time[i] >= 160000 THENIF Time[i] <= 163000 THENCumVol = CumVol + Volume[i]ELSEi = -1ENDIFENDIFi = i + 1ENDIFj = j + 1WENDSCREENER[CumVol](CumVol AS "Cum.Volume")1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on