Filtering Strategies with Mangrove SIEVE
A full backtest measures one strategy carefully. SIEVE measures 99 strategies cheaply. Use it as a pre-filter when you have many candidate parameter combinations and only want to backtest the ones likely to produce real trades and a positive outcome. SIEVE is a learned classifier trained on millions of historical Mangrove sweep runs. It returns two probability distributions:- Binary —
P(no_trades)vsP(trades). Filter out strategies that won’t fire at all. - 4-class —
losing/no_trades/wash/winning. Rank what’s left by expected outcome.
This is the shortlist-screening use of SIEVE (you supply the candidates). It is distinct from a parameter sweep, where the Experiments engine generates its own candidates and applies the binary head as an inline pre-filter. Don’t feed a screened list into a sweep.
Prerequisites
- An authentication token. See the Authentication guide.
- A list of candidate strategies you want to filter. They can be hand-built or generated by varying parameters of a known template.
Step 1 — Score one strategy to confirm the endpoint works
Step 2 — Score a batch and filter on the binary head
Build a batch of up to 99 candidates and score them in one round-trip. The binary head is your “will this fire at all” filter — drop anything withp_no_trades > 0.5 and stop wasting backtest budget on dead strategies.
Python
Python
Step 3 — Rank survivors by P(winning) and backtest the top N
The 4-class head tells you which surviving strategies are most likely to be profitable. Sort descending on P(winning) and feed the top slice into the backtest endpoint.
Python
Step 4 — Save the provenance with every score
Every SIEVE response carriesmodel_version and code_version. Log them next to any decision you make based on the score, so when the model is retrained you can tell which predictions came from which snapshot.
Python
(input_hash, model_version) so a model retrain naturally invalidates the cache.
Tips
- Same model, same answer. SIEVE is deterministic on
(input, model_version). If you hit the endpoint twice with the same payload, you’ll get byte-identical probabilities back. - The binary head is the bigger lift. In practice it ships ~80% of the filtering value — it cheaply removes dead-on-arrival strategies whose parameter ranges make entries impossible.
- Don’t trust the model alone. SIEVE is a fast pre-filter, not a backtest replacement. Always backtest the top survivors before making a real decision.
- Watch the soft-failure modes.
predictions[].binary.p_no_tradesclose to1.0usually means your TRIGGER thresholds are unreachable — adjust the parameter window rather than removing the strategy entirely.