Determinisk
← Research
Engineering · Paper

How I autotrade and sleep at night

Letting software trade real money while you sleep is possible, but only once you trust the system, and that trust has to be earned.

By Ross MallacePublished 19 Oct 20267 min read
A lighthouse shining over a rocky coast at night
Photo: Evgeni Tcherkasski / Unsplash

People often ask me how I can let software trade real money while I am asleep. The honest answer is trust. I trust the system because I built it, because it has been through a great many situations, and because I know how it behaves when something goes wrong. That trust was not assumed at the start; it was earned, one problem at a time.

This is how the system is designed to earn it, and where it still needs me.

Decisions are made early, not in the moment

The most important design choice is that trades are not decided as the market moves. They are worked out and loaded well in advance, and then submitted as a separate step. Loading and submitting are distinct stages, each with its own checks, so nothing is improvised at the open or the close. By the time an order reaches the broker, the decision behind it was made earlier, on known information, and has already been checked.

Work out the trades

well in advance, on known information

Load

its own stage, with its own checks

Submit

a separate step, with its own checks

Reach the broker

a decision made earlier and already checked

This matters because a decision made in a hurry, on incomplete data, is the kind of decision that goes wrong. Making it early, and in stages, means there is time to catch a problem before it becomes a trade.

Layers of safeguards

No single control is enough on its own, so the system relies on several layers.

1

The process

Every stage runs as a separate step, and separate task runners check each other’s work.

2

The execution layer

Limits and rules on every order, for the situations the system is built to recognise.

3

The broker

Its own controls and limits, outside my system altogether.

Anything new or unrecognised

is not acted on automatically. It is held back and flagged for a person to look at.

The first is the process itself. Every stage of the trading day runs as a separate step, and separate task runners check each other’s work rather than trusting it. If one stage produces something unexpected, the next one notices before acting on it.

The second is the execution layer, which applies limits and rules to every order. These handle the situations the system has been built to recognise. Anything more complex, or anything it has never seen before, is deliberately not acted on automatically. It is held back and flagged for a person to look at.

The third is the broker, whose own controls and limits sit outside my system altogether and act as a final check on anything that gets through.

What actually goes wrong

Problems do happen, and most of them happen early. The most common is an order being rejected, for example because the shares needed to sell short are not available to borrow, because of a technical fault, or because something does not line up with the broker’s records. These usually appear before the market opens, which gives me time to act. Some rejections have a predetermined way of being handled. If a short sale is rejected because there are no shares available to borrow, for example, the order is not simply sent again. A separate process watches for borrow to become available and only then tells the trading system to register the order again. What the system never does is resend the same order blindly, because that is how runaway loops start. Anything outside its rules raises an alert and waits for a decision.

The other common case is a signal that triggers but does not fill. In the early days there were no set rules for this, so an alert would reach my phone and I would log in and decide whether to chase the price or leave the order working.

Over time, each problem like this, once understood, gets its own automated handler. That is how the system has matured. But new situations keep appearing that nobody has seen before, and for those there is no substitute for being told promptly and having someone look at the problem with their own eyes before acting.

The close is where it all comes together

Most of my strategies trade at the close of the market, and the close is also when the end-of-day adjustments happen: reducing positions to stay within margin limits, and reducing exposure where the rules require it. A lot happens in a short space of time, which makes it the part of the day that most often needs attention.

Some of the markets I trade close in the middle of my night, so there are nights when I set an alarm and wake up for it. I do that when markets are moving fast or are unusually volatile, when I know a lot of orders have triggered or are likely to, or when the portfolio is in a significant drawdown and carrying a lot of risk into the night. On those nights I would rather be watching. I trust the system fully, but you never know.

When something goes wrong, it stops, it tells me, and it waits.

Trust has to be earned

The reason I can sleep most nights is not that nothing goes wrong. It is that the system has been through a great many scenarios, has been deliberately tested against the ways it could break, and has shown me repeatedly how it behaves when something does go wrong: it stops, it tells me, and it waits.

That kind of trust only comes from two things together. One is experience: time spent running the system live and seeing what it does. The other is knowing how well the controls are engineered and how reliable they have proven to be. Experience on its own can simply mean you have been lucky so far, and good engineering on its own is untested until it has faced real markets. With both, sleeping while the system runs stops being a gamble and becomes a reasonable decision.

Related

  • Method

    RSI(2): a first look

    One of the most shared trading rules, tested across 42 settings, against holding SPY and against 500 random strategies with the same exposure. The edge is real. The trend filter usually added to it is the wrong one, and where the edge lives says what to try instead.

    Paper · 16 min · Published 30 Oct 2026
  • Method

    Not all backtest frameworks are equal. Are you clear how yours works?

    A backtest's headline return depends on how its trades were sized and how the tool calculates it. Before you trust one, yours or anyone else's, you need to know both.

    Paper · 8 min · Published 19 Oct 2026