In short
- A black box can win for reasons you never learn, and lose for reasons you never see coming.
- A white box turns every trade, good or bad, into a lesson.
- Many "AI signals" are close to simple rules; rebuilding one takes minutes.
- Test it, read the losing trades, change one thing at a time.
Imagine two traders. One follows a paid black-box signal and is up 8% this month. The other wrote a simple rule, is down 2%, and knows exactly which three trades lost and why. Who is better placed next month? Usually the second. The first cannot tell whether the next drawdown is normal or the end of the signal; the second can adjust.
Why white box first
- You learn cause and effect. "It lost because the trend reversed before the crossover" is a lesson. "It lost" is not.
- You can size risk. Knowing the worst drawdown in a backtest tells you how much to risk per trade.
- You will not panic in a bad patch. You know losing streaks are part of the design.
- You can improve it. One change at a time, tested before and after.
Rebuilding a typical "AI signal"
Many signals sold as AI are close to classic trend-following with a filter. A common shape is "buy when short-term momentum turns up, but not when the stock is already stretched". As plain rules:

Without code: the strategy builder
In the StockYatra app, open Pro Chart → My builds → Build your own strategy and set:
- Buy when EMA 9 crosses above EMA 21, AND RSI 14 is below 70
- Exit when EMA 9 crosses below EMA 21
- Risk: stop-loss 3%, target 6%


With code: Pine Script
The same idea in Pine Script, which runs in the app's Pine editor:
//@version=5
strategy("EMA cross + RSI filter", overlay=true)
fast = ta.ema(close, 9)
slow = ta.ema(close, 21)
r = ta.rsi(close, 14)
plot(fast, "EMA 9", color=color.green)
plot(slow, "EMA 21", color=color.red)
if ta.crossover(fast, slow) and r < 70
strategy.entry("Long", strategy.long)
if ta.crossunder(fast, slow)
strategy.close("Long")
Reading the backtest honestly
Save and the strategy runs on the chart: every buy and sell is drawn, and the backtest card shows return, buy and hold, win rate, profit factor, maximum drawdown and each trade. Then:
- Compare with buy and hold. If doing nothing beat the strategy, the rules are not adding value on that stock.
- Read the losers. Were they in sideways markets? A trend filter (ADX, or price above a 50-day average) may help.
- Check other stocks and time frames. A rule that only works on one chart is probably fitted to noise.
- Change one thing at a time. Then test again.
When a black box makes sense
Later, as an experienced trader, you might use black-box tools as scanners to find candidates, or regulated execution algos to place orders efficiently. Even then, the decision to trade should rest on reasoning you can explain. In India, any black-box algo offered to retail investors must come through your broker from a SEBI-registered Research Analyst; see the SEBI rules explained.
Key takeaways
- Learn with transparent rules; every result becomes a lesson.
- Many "AI signals" can be rebuilt as a few readable rules.
- Judge a backtest against buy and hold, drawdown and other stocks.
- Use black boxes, if at all, as scanners, not as decision makers.
Practise with rules you can see
StockYatra is a free practice app for Nepal (NEPSE), India (NSE) and US stocks. Test 41 transparent strategies, write your own rules or Pine Script, and backtest them on the chart with virtual coins. Nothing is hidden and nothing is real money.
The black box AI series
- What is black box AI in trading?
- SEBI rules: white box vs black box algos
- AI trading bot scams: 10 red flags
- Can AI predict the stock market?
- Unusual volume, options flow and dark pools, explained
- Black box AI trading: the one-page guide
- Pro Chart: 41 strategies with every rule shown
StockYatra is an education app, not a broker, adviser or research analyst. Nothing here is a recommendation to buy or sell any security or to use any trading product. Rules and dates are summarised for learning; check the regulator's and your broker's current notices before acting. Practice prices are simulated and coins are virtual.



