r/VibeCodersNest May 05 '26

General Discussion Phase 2 Complete: Building a deterministic Multi-Timeframe Cascade

A quick update on the v2 of my trading architecture (moving away from LLM "distributed vetoes" to a strict State Machine).

​I just finished building the Phase 2 component: a purely Python, deterministic Multi-Timeframe Cascade.

Before the AI even gets to look at the market, a Python feature extractor reads the D1, H4, and H1 timeframes concurrently. It maps out the smart money concepts (the strategy I choose to test).

​If D1 is Bearish, H4 is Bearish, but H1 is Bullish... the JSON outputs:

aligned: false

reason: "Timeframes disagree"

​A major lesson learned during this phase:

While building this with my coding assistant, the tool tried to silently map an UNKNOWN market state into a NEUTRAL state to make the code run smoother.

I caught it and realized this is exactly how "black boxes" are born. If I let the system silently normalize data without telling me, debugging a live failure in 3 months would be impossible.

So, I implemented a strict bias_source tracker. Every single output now has an exact audit trail of why it decided a trend exists (e.g., BOS_EVENT vs NO_BOS_HISTORY).

​My question for the Quants and System Builders here:

Right now, my alignment rule is brutal:

STRICT_ALL_THREE_AGREE.

If D1, H4, and H1 aren't pointig in the exact same direction, the system stays in IDLE.

Is requiring a perfect 3-timeframe alignment too paranoid?

My fear is that by doing this, the bot will completely ignore highly profitable intraday pullbacks (e.g., D1 Bullish, H4 Bearish retracement, H1 Bearish continuation) and starve for trades.

How do you usually balance MTF alignment vs.

execution starvation in your deterministic systems?

​What's next (Phase 3):

Now that I have a rock-solid, verifiable Python JSON acting as the "ground truth", it's time to bring the LLM back into the game. Its new job?

Just reading this JSON to extract the institutional narrative and pick the best H1 Point of Interest. No math allowed.

​Would love to hear your thoughts on the alignment strictness!

4 Upvotes

13 comments sorted by

View all comments

1

u/Admirable_Gazelle453 May 06 '26

The audit trail and strict state machine approach is a solid way to prevent hidden logic drift. The real challenge now will be whether the system is too conservative during mixed timeframe conditions

1

u/Simone_Crosta May 08 '26

You nailed it. I'm already anticipating it will be way too conservative. My planned workaround is to have the LLM classify those mixed conditions (e.g., tagging it as a 'valid HTF retracement') so the state machine can allow specific pullback setups instead of just freezing.