What the Chart Cannot Tell You: Why a Stock Trading Robot Needs to Read the News

What the Chart Cannot Tell You: Why a Stock Trading Robot Needs to Read the News

3 September 2026, 09:12
Ivan Pochta
0
71

On the blind spot in every buy-the-dip strategy, and what an AI module actually does about it

A question with no technical answer

A stock you follow is down 12% in three days. Volume is elevated. RSI is deep in oversold territory. The price has come back to a support level that has held four times before. Every technical condition you use says the same thing: buy.

Should you?

The honest answer is that you cannot know from the chart. And this is not a shortcoming of your particular indicator set — it is a structural property of technical analysis itself.

Here are six situations. On a price chart, every one of them looks the same:

  • Profit taking after a strong quarter. Institutions trim, the price dips, buyers step back in within two weeks.
  • The company cut its full-year guidance. Analysts revise targets down, and the new price level is the correct one.
  • A clinical trial failed. A product that accounted for a third of the projected revenue no longer exists.
  • The SEC opened an investigation into the company's reporting. Nobody knows what the numbers really are.
  • The largest customer terminated its contract. The revenue base has changed permanently.
  • A dilutive share issue was announced. Every existing share is now worth proportionally less.

RSI, Stochastic, Bollinger Bands, moving averages, volume profiles — none of them distinguishes these six cases. They are all functions of price, and the reason for the fall is not contained in the price. It exists in a different place entirely: in the company's filings, in a court docket, in a press release published forty minutes before the market opened.

Stock Trader Pro product page: https://www.mql5.com/en/market/product/36161

Why this is the expensive problem, not an academic one

It is tempting to shrug this off. Diversify, use a stop, and the mistakes average out.

They do not average out, because the distribution is asymmetric.

In the first case, the trade behaves as designed: the price dips, the strategy buys, the price recovers, the position closes at target. A normal profitable trade.

In the other five, the price falls and keeps falling. The stop is hit — and then the stock continues down, because the stop was calibrated for ordinary market noise, not for a change in what the company is worth. Nothing about the decline is random, so nothing about it reverses.

A buy-the-dip strategy earns many small wins and takes rare large losses. The large losses come almost entirely from one source: buying a stock that had a reason to fall. Which means that for this class of strategy, removing bad entries is worth substantially more than finding new good ones. You are not optimising the win rate. You are cutting the tail.


Why the usual fixes do not close the gap

Every experienced developer has tried to patch this. The standard attempts and why each falls short:

"Don't trade around earnings dates." An earnings calendar is a small subset of what moves a stock. It contains nothing about lawsuits, withdrawn guidance, regulatory investigations, industrial accidents, cyber incidents, terminated contracts, or credit downgrades — and those arrive without a scheduled date.

"Filter by volume." Volume rises on institutional accumulation and on panic exits alike. The signal is identical in both directions; it tells you that something is happening, never what.

"Filter by the index." A broad market filter — an S&P 500 trend check, for example — genuinely helps against systemic risk. But it is blind to the individual company by construction: it either blocks everything or allows everything. It cannot tell you that this particular stock has a problem while the market is calm, and it cannot tell you that this particular stock is fine while the market is falling.

"Use a news API with sentiment tags." This is the closest attempt, and it fails at the most important step. A tagged feed delivers headlines and a positive/negative label. But "CEO steps down" can be a catastrophe or a planned succession announced eighteen months earlier. "Company under investigation" can mean a criminal fraud probe or a routine industry-wide inquiry that will end in nothing. The meaning lives in the context, not in the words.

"Read the news yourself." This works — for one stock, while you are awake. It does not scale to a portfolio, and the entries that hurt most tend to appear at inconvenient hours.

Here is what actually changed recently. The step that could not be automated was never getting the news — RSS and news APIs have existed for two decades. It was interpreting it: reading a paragraph of financial text and judging whether it materially threatens the reason you were about to buy. That step required a reader. Language models are the first tools that can perform it at scale, on demand, for every ticker, at three in the morning.

That is the entire premise of the AI module in Stock Trader Pro 4.0.


What the module actually does

The sequence matters more than any single feature. The technical strategy runs first, exactly as it always has: pullback conditions, moving averages, ATR, Stochastic, RSI across multiple timeframes. Only when a technical entry signal is confirmed does the module ask the model a question.

The model receives the ticker, the current price, the depth of the pullback from the recent high, and the baseline stop and target. It then checks current news on that specific company and returns a structured answer: a verdict — allow or reject — a confidence score from 0 to 1, proposed stop and target percentages, the publication date of the most recent news it relied on, and a written rationale with source links for factual claims.

A positive verdict is issued only if no material threat to the trade thesis is found. Otherwise the entry is rejected.

Note what this architecture makes impossible. The AI has a right of veto, not a right of vote. It cannot open a position the strategy did not find. It cannot invent a setup, override the technical logic, or trade on a hunch. The worst outcome of a wrong AI decision on entry is a trade you did not take.



The distinction that most news filters get wrong

If you build a naive news filter, it fails in a specific and predictable way: it sees a negative headline and blocks everything. Sooner or later it blocks the trades that would have been the best of the year.

The module is built to avoid this. The model is required to answer two questions independently: how does this news affect the market as a whole, and how does it affect this particular company? The prompt states directly that the answers frequently diverge, and gives the model the patterns to look for:

  • A war or a rising defense budget is bad for the broad market and good for a defense contractor.
  • An oil shock crushes airlines and lifts producers.
  • A rate cut lifts the market as a whole and compresses a bank's net interest margin.

The consequence is a rule that sounds obvious once stated and that almost no automated filter implements: general market fear is not, by itself, a reason to abandon a company that benefits from it. By default, the module will not close a position on systemic risk alone.

The screenshot below shows this happening on a live chart. Market: NEGATIVE. Company: POSITIVE. Thesis: intact. Damage assessed as MEDIUM and TEMPORARY. The broad market is under pressure from geopolitical strikes, higher oil and rising bond yields — and the position is held, because none of that damages this particular business.

The model is also required to classify any damage it finds as TEMPORARY or STRUCTURAL. A panic sell-off and a permanent change in the economics of a business are different events, and they call for different decisions. Conflating them is exactly how a good position gets closed at the bottom of a scare.


The second problem: knowing when to take profit

Entry filtering is the headline feature, but there is a second question that technical tools answer poorly.

A position is up 18%. Hold or close?

A trailing stop, by its nature, reacts after the move: it gives back part of the profit before it closes. And it cannot distinguish the two situations that matter:

  • The price has paused, but the reason it was rising is still in force — you should hold and move the target further out.
  • The price has paused because the driver has played out — you should take the profit.

Technically these look identical. The difference is entirely in the content: is there still a reason to rise from the current price?

The module asks this directly, and phrases it strictly: not "how much profit is there", not "how far from the entry", but is there a concrete driver capable of pushing this stock higher from where it trades right now? The model answers ALIVE , FADING or DONE , and is explicitly instructed that a profit is not itself a reason to exit, and that a small profit is not a reason to stay if there is nothing left to drive the price.

Four actions follow: HOLD, EXTEND_TP (the driver is alive, the target is too close), TAKE_PROFIT (nothing is broken, but the upside is exhausted), and CLOSE (the thesis is broken, and the damage is specific to this company).


Guardrails: why a model error costs you a trade, not your deposit

Language models are wrong sometimes. They misread context, they occasionally assert things that are not true, and they are overconfident about as often as people are. Any honest description of an AI trading module has to start there, and design around it.

What the module is not allowed to touch:

  • Position size. Never, in any mode. Lot calculation stays entirely with the strategy and your risk settings.
  • Per-trade risk limits and margin limits. Same.
  • The decision to open a trade. Veto only.

What every proposal is checked against, using limits you define:

  • A ceiling on the initial stop, so a "situational" stop cannot quietly become a wide one.
  • A minimum risk/reward ratio, so a proposed target must justify the risk taken.
  • A ceiling on the target, which is protection against optimistic fantasy.

If a proposal fails validation, the standard strategy levels are used instead.

Three further asymmetries are built in deliberately:

  • Closing requires higher confidence than entering. Closing a working position is a more expensive mistake than skipping a new one, so the threshold is higher — 0.75 against 0.60 by default.
  • A minimum holding time prevents the model from reacting to the noise of a position's first minutes.
  • Fail-closed by default. If the API is unreachable, the key is out of credit or the response cannot be parsed, the entry is rejected, not allowed. An infrastructure failure never turns into an uncontrolled trade.

And finally, the option that answers the objection "I am not handing my account to an AI": advisory mode. Each of the three roles can run in analysis-only mode, where the model evaluates every decision and writes its reasoning to the journal and the on-chart panel while executing absolutely nothing. You can run it that way for a month and read what it would have done.


The AI module and the S&P 500 filter

Version 3.0 shipped an S&P 500 trend filter that blocks trading during crashes and turbulent conditions. It works, it needs no external services, and it remains in v4.0.

But the two mechanisms answer the same question — is it safe to buy now? — at different resolutions, and they should not both be switched on.

The index filter is a blunt instrument. It evaluates the market and blocks every symbol at once, including the companies the sell-off does not touch and the ones that benefit from its cause. The AI module evaluates each ticker separately and already treats the state of the broad market as one of its inputs. Run both, and the coarse filter overrides the fine one: the AI approves an entry, the index filter blocks it anyway. Fewer trades, no improvement in selection.

The rule is simple:

  • Live or demo with the AI module on → turn the S&P 500 filter off.
  • Live or demo without an API key → keep the S&P 500 filter on. This is the v3.0 configuration and it works as it always did. The AI module is optional, not mandatory.
  • Strategy Tester → S&P 500 filter on, always. WebRequest is unavailable in the tester, so the AI module cannot run in backtests. All optimization and historical validation happens on the base strategy.

Installation

Three steps, and one of them is responsible for the overwhelming majority of "it doesn't work" messages I receive.

1. Allow WebRequest

In MetaTrader 5:

Tools → Options → Expert Advisors → tick "Allow WebRequest for listed URL", then add:

Do not skip this and do not mistype it. Without this permission, every request from the terminal fails silently — you will see error 4014 or 5203 in the journal and the panel will report no connection. This single step accounts for most support requests about AI-enabled EAs across the whole market, not just mine.

2. Get an OpenRouter API key

  1. Register at openrouter.ai
  2. Top up the balance
  3. Create an API key
  4. Paste it into the OpenRouter API key input

One security note: the key is stored in the EA's settings, which means it travels inside a saved .set file. Do not post your set files publicly without clearing that field first.

3. Enable the module and choose a model

Set "Master switch for every AI feature" to true , and turn the S&P 500 filter off.

The Analysis model input offers ready presets — GPT-5.6 Luna as the fast and economical default, plus Claude and Grok options — and the Custom model ID field accepts any OpenRouter model identifier in provider/model form. You are not locked into one vendor: a cheap fast model for routine filtering, a stronger one if you want deeper reasoning on ambiguous cases.

Leave "Ground analysis with current web news" enabled if you want verdicts based on live news rather than the model's training data alone.

4. Verify the connection

On startup the EA runs a single test request, and the on-chart panel reports the result:

Connection : YES · OK (HTTP 200)

If there is a configuration problem, you see it immediately at attach time — not three days later when the first signal arrives and silently fails. The panel also shows the current verdict, its confidence, the age of the last request, the cache state, and the full reasoning text.

What it costs

The API is billed by OpenRouter on a pay-per-use basis and is not included in the price of the EA. The cost depends entirely on the model you select.

In my testing, one request on GPT-5.6 Luna costs approximately $0.025.

Requests are not sent on every bar. Entry verdicts are cached — six hours in a calm market by default, and thirty minutes once the market turns turbulent, which is detected by the bar range exceeding ATR by a configurable multiple. The cache is also invalidated early when the price moves significantly, when volatility spikes, or when the S&P 500 trend reverses. In other words, the module re-analyses when the situation actually changes, not on a fixed timer. Open positions are re-evaluated on their own interval, sixty minutes by default.

The practical result on a light model is a few dollars per chart per month. If you want to spend less, the levers are all exposed: raise the cache duration, raise the management interval, analyse only positions already in meaningful profit, or switch to a cheaper model.


Honest limitations

These are worth stating plainly, because you will find them anyway:

  • The module does not work in the Strategy Tester. WebRequest is unavailable there. Backtests reflect the base technical strategy only, and the AI layer has to be evaluated forward, on a live or demo account.
  • It requires an API key and internet access from the terminal.
  • A model response takes seconds. This is irrelevant for a system that holds positions for weeks, and disqualifying for scalping.
  • Models are non-deterministic. The same input can produce a slightly different answer on a different run. This is precisely why hard limits, confidence thresholds and advisory mode exist.
  • Quality depends on there being news at all. For a large, widely covered company there is plenty to read. For an obscure one there may be nothing, and the verdict will be correspondingly thin.
  • It analyses long-side buy-the-dip logic, which is what this EA trades. It is not a general-purpose market oracle.

The point

Technical analysis is very good at answering when. It has never been able to answer why, and for a strategy whose entire premise is that a fall is temporary, why is the question that determines whether the trade works.

For the first time, that question can be asked automatically, on every entry, with the answer written down, dated, sourced and checkable — and constrained tightly enough that being wrong about it costs you a trade rather than an account.

That is what the AI module is for. Everything else about it — the limits, the thresholds, the advisory mode, the fail-closed behaviour — exists to keep it inside that boundary.


Trading financial markets involves risk of capital loss. The AI module is designed to reduce the probability of entering a stock with a known problem; it does not eliminate market risk and does not guarantee profit. Language models can be wrong and can misinterpret news, which is why every decision they make passes through limits you define. Past performance does not guarantee future results.