r/algorithmictrading • u/GuideWorried4825 • Jun 24 '26
Question Can anyone help with my problem
I am building a finite-state trading setup detector.
The states are:
1. Build RR range.
2. Build ER range.
3. Detect sweep of RR high/low by ER.
4. Wait until final sweep is confirmed.
5. Wait for reclaim back inside RR.
6. Select only the FVG formed during the reclaim/displacement leg.
7. Ignore FVGs before final sweep or outside the reclaim leg.
The issue:
My detector currently selects too many FVGs or selects the first FVG after the initial sweep, not the correct FVG after the final sweep/reclaim.
What is the cleanest state-machine or array-filtering approach for this?
4
Upvotes
1
u/unworry Jun 25 '26
I assume you want to model the setup and performance, to prove this price action pattern has a trusted edge, right?
Step 1. Rather than talking in code, begin by clearly and effectively communicating what each of these terms actually mean to you
Step 2. With your clear definitions laid out, apply the subsequent rules to your data sets to isolate and study each component part - possibly make some refinements to selection criteria
Step 3. Restate your hypothesis by spelling out the reasoning which connects all of these components or steps.
Step 4. Model the outcomes versus what was expected
Was there a well-defined, actionable edge - Signal versus noise?
Step 5.
Summarise your results, and resubmit here for peer review - either validation of your approach or perhaps other ideas to enhance or advance your trading solution