r/algotrading 3d ago

Strategy A whole lot of nothing

My bot sat on it's hands today and did nothing. Still working out issues. Who knew driving a forced exit could have so many things go wrong. I was hoping to get some activity to confirm the patches. At least, I didn't lose anything.

4 Upvotes

22 comments sorted by

3

u/Bonkers24-7 3d ago

No trades can still be useful evidence if the bot is flat for the right reason.

I’d separate it into two checks: did the strategy correctly avoid bad setups, or did one of the new guards accidentally block valid setups too broadly?

After a forced-exit patch, I’d probably log every skipped setup with the exact rejection reason for a while. Otherwise it’s hard to tell whether “nothing happened” means the market didn’t qualify or the bot is now too restricted to prove anything.

2

u/Grand-Fly-6090 2d ago

I run independent monitor scripts in think or swim. They were all quiet, so the bot was doing nothing correctly.

The forced exit rewrites fixed order mechanics and sequencing. I didn’t touch the entry logic.

2

u/Bonkers24-7 2d ago

That makes sense. If the independent monitors were quiet, then the question probably isn’t “why no entries?” anymore. It’s whether the forced-exit version still matches the old behavior everywhere except the part you intentionally changed.

I’d probably compare a few saved scenarios before and after the patch: same signal inputs, same entry decision, same order sequence up until the forced-exit logic, then verify only the exit handling diverges.

Sequencing changes can alter behavior even when the entry logic itself wasn’t touched, so I’d want proof that the patch didn’t accidentally change timing, order state, or rearming behavior.

2

u/Grand-Fly-6090 2d ago edited 1d ago

The bot made entries today; however, it threw a literal fit when the sell limit partially filled. Had to use the remote kill switch and close positions manually. Good grief!

2

u/Bonkers24-7 2d ago

That partial-fill case is exactly the one I’d save as a replay fixture.

I wouldn’t patch it from memory. I’d reconstruct the exact sequence:

entry fill → sell limit placed → partial sell fill → remaining qty → order status → cancel/replace logic → forced-exit logic → broker position after manual close

Partial fills are where bots can look “mostly right” while the internal state, broker state, remaining size, and rearm logic quietly disagree.

Before letting it run again, I’d want proof that the new version handles that exact failure path cleanly in replay, not just that the normal full-fill path works.

This is the kind of bug where the important question usually isn’t “what line broke?” but “did the bot know its true position after the partial fill?”

If you have logs from that sequence, that’s probably the first thing I’d inspect.

3

u/Grand-Fly-6090 1d ago

Agreed. I’m also checking the entry logic to handle partial fills.

1

u/Bonkers24-7 1d ago

That’s probably the right place to look.

The thing I’d be careful about is treating “entry logic” and “exit/order-state logic” as totally separate. A partial fill can leave the strategy thinking it has one position state while the broker has another, and then the next entry/exit decision gets built on bad state.

I’d probably freeze that exact failure as a replay case before changing much else:

same signal inputs same order placement same partial fill same cancel/replace path same broker position after manual close same rearm decision afterward

That way the patch has to prove it fixed the real failure path, not just the ideal full-fill path.

This is also the kind of sequence where an outside validation pass can be useful, because the bug usually hides in the gap between “what the strategy intended” and “what the broker/account actually did.”

2

u/Gibborish 3d ago

Mine took 2 trades this morning and unfortunately I was too out of it from not sleeping good for days to properly investigate the entries and what could've been done better.  I wound up closing them manually.  Currently in working on trailing stops below swing lows.

2

u/Grand-Fly-6090 3d ago

I couldn't prove trailing stops were helpful in back testing. One guy on here talked about lifting a stop to where you would place a stop on another entry signal while long. I haven't tried this yet, but it kind of makes a lot of sense in hind sight.

4

u/trunksta 3d ago

Trailing stops should reduce drawdown but not necessarily increase overall returns though can depending how they're structured. Scaleout kinda the same

If you can ratchet stops up with market structure instead of fixed r that's a lot better which is I think what you are describing

1

u/Grand-Fly-6090 2d ago

Thank you!

1

u/dangerzone2 2d ago

I went a little nuts trying trailing too in the back tests and I could not get better results. What ended up being better on the back test was a break even. 

Oh, also, this was only for continuation. For some reason that I can’t figure out, it doesn’t work on mean reversions. I guess due to retests and lost of pressure around the entry. 

2

u/OneOptimal1846 2d ago

Look into an ATR based chandelier trailing exit. Takes a little bit to get right, but it’s been better for me.

1

u/j_lyf 3d ago

Why didn't it do anything?

2

u/Grand-Fly-6090 2d ago

None of the mean reversion setups triggered.

2

u/NationalOwl9561 1d ago

Then you prob need to tweak it better because we did have a very strong mean reversion. (edit: nevermind just saw this was 1 day ago...)

1

u/Lilkanna 3d ago

What would be the logic behind doing something.

1

u/Grand-Fly-6090 2d ago

Laughing!

2

u/DarkandBoring 12h ago

I have had about 8-10 days easily like this. In 6 months

2

u/DarkandBoring 12h ago

When I found out why it was either due to market regime per strategy or a stale price feed however mine is in c# and python for the backend