You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
It's not possible to detect the nonexistance of stock trade condition "update rules". This is necessary for conditions like condition 60 that don't have update_rules in returned JSON responses.
Additional context
Note that this proposed implementation would silently break downstream code by compiling without error and causing runtime panics. I care more that I can determine existence at all than how it's surfaced in the client. I drew this solution from the Python and Typescript implementations.
I'm constructing bars from trades by assuming update rules for each trade are true unless any conditions indicate false. Condition 60 showed up consistently on trades for TGT today, resulting in "frozen" bars that never updated even though Polygon aggs did update over time.
The text was updated successfully, but these errors were encountered:
Hey @aimscreenname, are you building your own bars based on trade data and wanted to look for trades that are eligible? Just trying to figure out the use-case here. I think you could likely do something in reverse in that say all trade are not eligible unless they are. Just wanted to see if that's what you're trying to solve for or not first before looking into this.
@justinpolygon That's right, my goal is to build my own bars based on trade data. Going reverse produced volume inconsistent with Polygon aggs bars for me in the past. This blog post talks about the "eligible unless" approach, too.
That said, I'm only proposing existence checks based on public APIs I'm seeing. Maybe only "type": "sale_condition" conditions affect eligibility? An official code example of reconstructing bars from trades could clear up confusion on my side.
Hey @aimscreenname, thanks for the reply. I'm going to check this out and see the impact. I just don't want to make a breaking change here so want to explore the options.
Describe the bug
It's not possible to detect the nonexistance of stock trade condition "update rules". This is necessary for conditions like condition 60 that don't have
update_rules
in returned JSON responses.To Reproduce
Result:
Expected behavior
Making
UpdateRules
nillable would enable existance checks.Result:
Additional context
Note that this proposed implementation would silently break downstream code by compiling without error and causing runtime panics. I care more that I can determine existence at all than how it's surfaced in the client. I drew this solution from the Python and Typescript implementations.
I'm constructing bars from trades by assuming update rules for each trade are true unless any conditions indicate false. Condition 60 showed up consistently on trades for TGT today, resulting in "frozen" bars that never updated even though Polygon aggs did update over time.
The text was updated successfully, but these errors were encountered: